It's Essential!

29 Nov 2018

Design pattern? What is it? As always, when people who are not familiar with software engineering, they either relate it to the things they know or just think it is some random stuff. So to make it easier for everyone to understand, let’s continue.

It’s like manufacturing process

I think everyone know how manufactories make the products that the stores sell. There are certain ways to make certain products, which are similar to the design patterns. For example, the process of making a car is like the creational design pattern. This pattern is found in the sheet metal stamping equipment used in the manufacture of Japanese automobiles. The stamping equipment is an Abstract Factory which creates auto body parts. The same machinery is used to stamp right hand doors, left hand doors, right front fenders, left front fenders, hoods, etc. for different models of cars. For me, this design pattern is kind new, I never used in my code.

A thing only certain people could understand

If you never learn anything about the music, you can never interprete the music. Which is similar to the interpreter design pattern. Thuis pattern define a representation for its grammar along with an interpreter that uses the representation to interpret sentences in the language. There are many different languages in computer science such as Java and C++. These example have two different interpreter design pattern. Musicians playing the music from the score are able to reproduce the original pitch and duration of each sound represented. When I was learning the Java, C++ and C, I’m pretty sure the deign pattern is through the entire programming language.

It can also make it better

Everyone likes pretty things and things that are accurate and easy to use. Well, the decorator design pattern which does this to your code. It’s like you can apply certain “decorations” to make an assault gun more accurate, silent and devastating while it is already a deadly weapon.

Furtheremore, there are many other design patterns that I could not talk about this time. They are all useful and helpful when coming to write the code because it sometimes makes the code easier to write and understand. And also make it having consistancy. It is an one of the important things to use when programming.