Designing Factories

01 May 2018

I know you are probably wondering, why would I ever want to design a factory? Well, we are not actually designing and building factories, but there are designs that relate to almost any designing in any field. Design patterns are the crux of anything that requires planning ahead. What about designing factories that facilitate this Design patterns? Nothing, but factories can be used as way to understand design pattern and how they work. First, design patterns are a design (duh) that can solve almost any problem given within that field of subject. Second, design patterns are now the be all and end all, they have ups and downs. Finally, design patterns are not always the same, there are variation that work under the same concept but function differently. There are four design patterns that we can represent; singleton, factory, observer, and MVC. The Singleton factory, can only produce one item, let’s say a phone. This phone is the only thing this factory can make; thus, it is easy to make more of these factories that is on a global scale available anywhere. However, the drawback is the abundance of too many phones and having to manage factories all over the world can be difficult.

The Factory’s Factory, this factory works for a big company, and this company want this factory to make different board games. That is what the factory does it can make checker, chess, and backgammon. This factory is then used by other companies to make phones, vehicles, and clothes. This factory can create multiples of these object types and can do it from other companies. However, the factory is complex to make and therefore takes a long time to build anywhere else.

The observer factory is a versatile yet simple factory that can change its process on request. If a company asked this factory to build BRZ™ car, then the factory will do so. Let’s say the company is bought out by a different company and want to redesign the car to a different form factor. The factory will observe the companies request and immediately, change the process and start building the new form factor. This means the factory is observing what the company wants and changes quickly to a new method of building. However, this can take time if something more complex comes along or the company does not have the tools for a change. This also leads to having difficulty fixing any issues that arise since the machines are complex to easily change.

Finally, the Model View Control or MVC factory, and this is the most complexed. This factory is very private about how their machines work. This factory will only show the product, and no one outside can enter. Companies can control what is made but can not see how the factory makes the product, but the factory can make almost anything. The factory will present multiple variation of the product if the company desires and notified if any product have been changed. The factory can make almost anything because it utilizes people from different skill sets to make machines that do their specific skill, and it can help create different views of the product. However, there is not enough manpower to go around as it is hard for people to learn a skill set, and the factory is complex.

There are a lot more design patterns, and these design patterns are used almost anywhere. Even here in software development, these can all be replaced by class, method, functions and would still apply. That is the nature of design patterns and even designing a website or program, I myself have experienced. I have to make sure how each page can access the same object stored in a database or functions that can be utilized amongst other classes instead of making each individual function.