Smart, Clean, & Beneficial Design

01 May 2018

Picture this:

You need to get from point a to point b. This is certainly something that you have done numerous times, but this particular commute is a bit different. You plan out different ways you can get to your destination. You can take a bus, walk, ride a bike, or catch a taxi. From previous experiences of utilizing these ways you come up with the best mode of transportation.

This is exactly what design patterns are.

Design patterns promote effectiveness in programming and the ability to rehash code. With this code we can reuse and apply it to familiar problems in software design. Essentially the main idea of design patterns is to have a sketch or an outline for how to go about solving a problem, that can be used multiple times and ways for a variety of conditions.

The Importance & Purpose

The key concepts of design patterns are to establish constructs of communication between people and to have semi-done solutions for familiar problems. When we encounter problems we have to be able to know what pattern to apply in order to efficiently and correctly solve this problem. These concepts support one another, since they allow us to not only be able to solve problems quickly, but to also be able to effectively communicate to others how we solved that particular problem.

Types

There are a variety of design patterns that are appropriate for different tasks. There are: factory, singleton, observer, MVC, prototype, and many more. In this class, I have utilized Prototype, Factory, MVC, and Observer. Factory is basically utilized when there is a super class that contains sub classes, and from the input, you return one of the sub classes. Singleton allows our code to have universal variable. Observer can be used for events that occur from a reaction of objects that have changed as a result. MVC or Model-View-Controller is an interface seen in web design, that involves 3 components which are model, view, and controller. Lastly, the prototype design pattern allows the ability to create objects based off of current objects utilizing a copying feature.

Final Comments

From being in this course I was able to get my feet wet and learn a few design patterns. As I continue on this path in software engineering, I hope to learn more and understand how to utilize them for my future career.