Design Pattern vs Design Principles #140
-
Hello, What are the differences between Design Patterns and Design Principles? Is DI(dependency injection) a design pattern or a design principle? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Varun gives a convenient answer here: https://stackoverflow.com/questions/31317141/whats-the-difference-between-design-patterns-and-design-principles A design principle provides high-level guidelines without implementations, e.g. Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, Dependency Inversion Principle. A design pattern suggests a specific implementation for a specific object-oriented programming problem. You can also check the Wikipedia article Dependency Injection describing the dependency injection design pattern. |
Beta Was this translation helpful? Give feedback.
Varun gives a convenient answer here: https://stackoverflow.com/questions/31317141/whats-the-difference-between-design-patterns-and-design-principles
A design principle provides high-level guidelines without implementations, e.g. Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle, Dependency Inversion Principle.
A design pattern suggests a specific implementation for a specific object-oriented programming problem.
You can also check the Wikipedia article Dependency Injection describing the dependency injection design pattern.