I Have no Idea What I’m Doing

02 Dec 2020

Here is a scenario, you are given a task to build a component of this giant application. But there is just one problem, you have no idea where to start. The title of this essay is probably something you never want to hear or say when working in Software Engineering. So, you resort to asking Google or your colleagues for help. And to your surprise they all suggest similar algorithms or templates to follow. Why is that? The answer is something called Design Patterns.

Design Pattern in a Nutshell

Design Patterns is a repeatable solution to a common problem for software design. Another way of thinking about this is using an existing template or idea to solve your problem. Now this may seem like a copy and paste but, remember it is the idea you are copying not the actual code. And now going back to the scenario, had you chosen to ignore what your colleagues and Google recomended, your tasks may have never been finished on time. And most likely, you had been fired. Using the Design patterns speeds up your development process because these Design patterns were already created and tested. As a programmer if this is your first-time hearing about this concept then you would be surprised that you had been using Design pattern without realizing it.

Wait, I Was Using Them This Whole Time?

Despite being a Computer Science student this is my first-time hearing about Design patterns. And to my surprise, I had been using some of them this whole time. After doing some reading online, the 26 Design patterns are classified into 3 types Creational, Structural and Behavioral. For instance, one of the Creational designs is the Factory Method. This method takes me back to the time when I was learning about Object-Oriented Programming by implementing the Manoa Brewery. So, in this small project we had to implement a Brewery by creating the parent class called beer and the types of beers as the child of beer. Then the Brewery class would brew the beers or in this case create the beers. So, in a sense, the factory here would be the Brewery because it is the one that was creating the classes.

Currently Using A Design Pattern

Something I recently learned is that I had been using the MVC or Model View Controller pattern for a while now. With the introduction of Mongos, React, and semantic I found one way of officially making a working website. And by using those three things I had also been using the MVC design pattern. Currently I am working on creating a prototype that uses the MVC pattern. The Model is the interaction with the data. This is where Mongo comes in as it manages the data. The View is the interface of the application or the design. For this we used React, Semantic, CSS and HTML. As for the Control, this is how the user interacts with the application. So, for the web application the user will be interacting with our map. The user can request the server to edit the map by adding new data or changing some of the data. In which the controller then takes those data to the Model to update the data.

In Conclusion

When it comes to tackling new things it is best to just stick with what has already been proven to work. I mean why go through the trouble of trying to be creating something that would probably take longer than it must be. Even though it may seem like trying to copy something that has already been done. Just remember that these ideas are not codes, they are just templates or ideas for you to use to create an effective software design. But if you really know what you’re doing then go ahead and create something new.