[내일 배움 캠프 Unity 4기] W6D4 05.23 TIL

김용준·2024년 5월 23일
0

내일배움캠프

목록 보기
20/47

Goals

  • Present the team project of avoid shit with the slide
  • Learn the principle of Object Oriented Programing

Slide with the video for the presentation

Slide
The introduction video was also uploaded via Youtube.

Principles of OOP

SOLID principle

  1. The S in SOLID means 'Single Responsibility Principle'
    It means the each class compose the program should have only one responsibility. For instance, imagine the class which is designed to operate actions of player. The class should not have the responsibility of other behavior such as the collision process for enemy. With this rule, the modification of player's action should be done in only one class.

  2. The O means 'Open Closed Principle'
    In OOP programming, the all scripts were opend for the expandancy not for the modification. In the case of implementing additional features on base project, The process should be done without the revision of base project. For that reason, the base project have to be organized for the scalability. That can be said to the 'closed for the modification'. To comply with the rule, programmer should write the project by applying abstraction.

  3. The I means 'Interface segregation principle'
    Similar with S of SOLID, this I works for the interface, not class. Separating the responsibility of Interface will increase the degree of neatness. In the C#, the class can be inherited the multiple interface. So the fine separation would be connected to the easy expandancy.

  4. The L means 'Liskov Substitution Principle'

  5. The D means 'Dependency Inversion Principle'
    The child class should be transfrom to the parent class. To be expained easily, assume the case of method which recieve the child class(or interface) as a mediator. Abiding with upper rules, the parameter should be formed to the parent class(or interface) because the features of parameter would be invoked. But be careful with the usage of overriding.

profile
꿈이큰개발자지망생

0개의 댓글