English
[1Day-1CS] Design Principles of OOP

[1Day-1CS] Design Principles of OOP

1 CS a Day: A Brief Summary of Design Principles in Object-Oriented Programming

Single Responsibility Principle

Single Responsibility Principle

Every class should have only one responsibility.

Open-Closed Principle

Open-Closed Principle

Existing code should be modified as little as possible during maintenance, and it should be easy to extend.

Liskov Substitution Principle

Liskov Substitution Principle

Objects must be replaceable with instances of their subtypes without breaking the program’s correctness. This means that inheritance must function properly without issues.

Interface Segregation Principle

Interface Segregation Principle

Create multiple specific interfaces instead of a single general interface

Dependency Inversion Principle

Dependency Inversion Principle

The upper layer should be independent of changes in the lower layer; to avoid being affected by elements that change more frequently than itself, a superclass or abstract interface should be used.

댓글 작성

게시글에 대한 의견을 남겨 주세요.

댓글 0