Imagine that we need to develop an application for a hotel. What we need to make is a device with that has multiple buttons on it that correspond to certain actions: calling room service, requesting laundry service, getting latest menu from the restaurant, refilling refrigerator and so on. We want to be able to fit … Continue reading Command Pattern
Tag: python
Abstract Factory Pattern
There is a way to generate objects without being tied to concreteness of a certain object. That is called a Factory Pattern or a Factory Method. However, often what happens is that we need to create not one type of an object but several similar ones. Imagine running a restaurant, and needing to have several … Continue reading Abstract Factory Pattern
Factory Pattern
Every time we code something, we create new instances. We literally use word “new” all the time. That creates a concrete object for us. It is bound to a particular type, and we can’t change it after we created it. Every time you use “new” - you create “concrete” instance. This is opposite to what … Continue reading Factory Pattern
