E63: Reflect on Design Patterns
When I begin to code something, I always face how to write first. I think people who work with coding a lot are easy to begin coding but I have not code a lot so It takes a long time for that. According to The book, Design Patterns: Elements of Reusable Object-Oriented Software, There are 4 people called Gang of Four. and They said
solve specific design problems and make object-oriented designs more flexible, elegant, and ultimately reusable. They help designers reuse successful designs by basing new designs on prior experience. A designer who is familiar with such patterns can apply them immediately to design problems without having to rediscover them.
To summrize it, People who can solve many difficulte problems, arrive at some kind of similar answer. These are design patterns.
I want to show good examples of design patterns but sadly I have no idea so I refer to some examples from a website. Design patterns can be categorized into three main types, Creational pattern, Structural pattern and Bihavioral pattern. And singleton pattern which is often mentioned, belongs to Creational pattern. It means the programming has only a single instance of a class that exists throughout an application and provides access to that instance from anywhere in the codebase.
There are some good things if we use design patterns like I mentioned. For example, When design patterns are applied and well designed, programs are very reusable. And this makes it easier to add and update functionality. It also makes it easier to identify the cause of bugs. This is a side effect of the clear role of each object. For example, if the process of connecting to a database is failing, the scope can be easily narrowed down because only objects related to the database need to be examined. The difference is obvious when compared to a case where the entire source code must be examined!
Design patterns are filled with the wisdom of our ancestors. They are full of know-how for better design of programs. And these are used very frequently so I think I should learn more about design patterns.