Experiencing Design Patterns!

01 May 2018

Patterns make everything easier

Software engineers are expected to handle extensive pieces of code, but efficiency can be significantly determined by use of design patterns. Design patterns are essentially templates or patterns that act as resuable solutions to problems that programmers often encounter. When different pieces of code interact to form an application, design patterns are often implemented to show relationships and interactions between classes or objects. This is because design patterns prevent unneccessary re-implementation of certain bits of code, which could otherwise be accessed and processed more efficiently. When a pattern is applicable, a fixed repeatable solution can save time as well as making the structure of the application more clearly represented. For example, a behavioral pattern can manage re-occurring interactions between objects by having a mediator that can be re-used.

My experience with basic Design Patterns

Being a student who is still considers himself to be merely at the front gate of software engineering, I was surprised to find that I have already been using design patterns in my assignments, including my final ics314 project. I often had to re-use code and thus, unknowingly exposed myself to following basic design patterns when attempting to manage objects or components. For example, in my final ics314 project, I needed to handle and re-use elements of a database collection that could be modified and accessed. As such, I used behavioral design patterns such as an “observer” to publish and subscribe data to be available for different classes of code. You can also see in the image below, an example of my use of protoype design patterns for this set of classes in the API directory which encapsulate the Mongo collections I used. Ultimatley, coding involves the use of many design patterns to handle data in an efficiently systematic and organized manner.