Design Patterns vs Design Principles
Table of Contents
INTRODUCTION
Design patterns and design principles are important terms in the area of software development. Generally, although these terms are often used interchangeably, they are different things. Understanding two concepts helps to receive a better software design. In this context, the article highlights the difference between Design Patterns and Design Principles.
DESIGN PATTERNS
Design patterns provide implementation details and give general solutions to solve specific design problems in code. Namely, it should be considered as low-level solutions related to implementation. However, design patterns are not specific to a programming language. If the language supports the necessary features that come with OOP, the same design pattern can be applied to that language.
Using design patterns helps to enhance the maintainability and scalability of code. For this reason, design patterns are preferred instead of temporary solutions when any problem is encountered. Singleton, Adapter, Factory, and MVC patterns are examples of these design patterns.
DESIGN PRINCPLES
Design principles are considered as overarching guidelines at the top of the implementation process. They provide high-level guidelines for the design of maintainable and flexible software systems. SOLID (Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Injection), DRY (Don't Repeat Yourself), KISS (Keep It Simple, Stupid), and YAGNI (You Aint' Gonna Need It) are some of the most well-known design principles.
CONCLUSION
Both concepts are essential in software design. By using these concepts, code can be made more maintainable, flexible, and reusable. Design Patterns provide low-level solutions to specific problems, while Design Principles offer high-level guidelines. Understanding these concepts helps developers to choose appropriate approaches for each situation, which encountered problems or when deciding stage of design and create more efficient solutions.
REFERENCES
[1] https://www.tutorialsteacher.com/articles/difference-between-design-principle-and-design-pattern