OOP设计原则
Software Architecture & Engineering · 8 notes
- Open–Closed Principlehistorical
The open-closed principle favors extension without modifying existing code, reducing the risks introduced by maintenance changes.
- Liskov Substitution Principlehistorical
The Liskov substitution principle requires subclasses to preserve the meaning and expectations of parent-class methods. These notes examine inheritance and extension through it.
- Dependency Inversion Principlehistorical
Dependency inversion favors interfaces over implementations and avoids direct high-level dependence on low-level details. These notes examine extensibility through that principle.
- Single Responsibility Principlehistorical
The single-responsibility principle keeps a class's responsibilities focused. These notes examine readability and maintenance through that idea.
- Interface Segregation Principlehistorical
Interface segregation keeps interfaces focused on clear responsibilities. These notes examine decoupling and readability through that requirement.
- Law of Demeterhistorical
The Law of Demeter asks a class to know as little as possible about other objects' internals, reducing coupling.
- Composition Reuse Principlehistorical
Composite reuse favors composition or aggregation over inheritance. These notes examine code reuse and extension through that principle.
- Object-Oriented Design Principleshistorical
Object-oriented design principles aim to improve maintainability, extensibility, and reuse. This page links notes on the individual principles.