Smart Design

03 Dec 2020

Design Patterns at first glance

Throughout the semester for Software Engineering class, we focused on different areas of coding. Learning something new every week has been challenging. Challenging but fun at the same time. I heard about the design patterns before from one of my friends but I didn’t really go deeper about it. I knew that we would be learning a lot of new things in this class but learning about design patterns never really crossed my mind. If my friend didn’t mention design patterns to me, I would never know.

Design Patterns at Work

In software engineering, design patterns are a template for how to solve a problem that can be used in different situations. If we have design patterns, we don’t have to start our code over again especially when it is working well, it takes a long time creating a code and making it work.It might be faster for the professional programmers but it takes me a long time to just fix mine. It is very helpful to be very familiar with how you fix the problem because it might show up again in the future, at least it won’t be hard anymore. There are different types of design patterns and they are “creational”, “structural” and “behavioral” .Factory design creates objects without exposing underlying logic, potentially returning objects associated with different classes, and creating dependent objects. It’s advantages is that it can return objects from different classes, return multiple objects and it can build additional dependent objects. Singleton, provides a global state in an object oriented manner and easy to implement lazy initialization. Although global state is not often wise. Observer connects to the other areas of the code because some of the objects need to be informed whenever there is a change. They all go together. When I was doing my part in our final project, I did a lot of this. I did the “foods available right now” page on our website and I had to connect it to the other codes because if I don’t, it won’t work. It allows open minded numbers of dependencies. While in Model-view-controller, this specific partitioning of responsibilities concurrent development by people with different skills. Overall, design patterns are very important in software engineering and I look forward to learning more about it.