Got a problem, a design pattern can help.
Design patterns are a tried and tested solutions to common problems in software programming. There hidden problems when engineering a solution yourself, these patterns are tried and true and will ensure you do not run into that. This is the first post of a series of blog posts going in depth into software design patterns, and the common problems it solves.
“At some point you will need to solve coding problems, and knows the types of design patterns to these common problems will help you solve these paradigms in a reusable and elegant way.”
Design patterns are agnostic to the programming language, and will help you and your teams solve common programming problems. I do like using patterns, but only when I need them. I like to keep code-base simple so that developers that are not familiar with the design patterns can easily maintain the code base after I am gone. I like to keep the code simple until it can no longer be due to performance, security or other issues, at this point using a design pattern makes sense.
3 types of Design Patterns
1. Creational - Creating an object or initializing a class? This is the patterns you should review. Some examples are singleton and factory.
2. Structural - Organization, Clean organization. Use this to assemble classes into larger structures , while still keeping these structures flexible and efficient. Some examples are Adpater, and Bridge
3. Behavioral - Communications between objects and thier responsibilties.
Some Examples are Strategy and on of my favorites, Observer.
Annnd there you have it, a intro to design patterns. I will be divining into my most used patterns in later blog posts. Have a super day.
Yorumlar