Each application has different architecture to it. Architecture can vary based on functionality, extension, flexibility, and infrastructure. Programming for certain domains can require a certain approach. For instance, notice how a typical web application can be different from desktop application. Even without knowing the logic and purpose of the application, we know that they will … Continue reading Proxy Pattern
Tag: java
State Pattern
Programming application always involves dealing with a state of application at any point in time. State allows us to predict what application is going to behave like in certain point in time under certain inputs. Unless you are writing HTML code, which is stateless, you will get to deal with multiple states, and multiple logical … Continue reading State Pattern
Composite Pattern
In applications we get to deal with a variety of data structures: trees, lists, arrays, queues, stacks, etc. Making sure that you choose the appropriate data structure for a particular problem is very important. If you choose right, you will ease the process of creating an application. If not – you risk unnecessarily increase complexity … Continue reading Composite Pattern
Facade Pattern
Applications reach different levels of complexity within the development time span. Some settle down with just several classes. Others make to dozens of classes and complex interrelations between them. When that happens you want to make sure that you have proper mechanisms of controlling it, and that those mechanisms are simple enough for client to … Continue reading Facade Pattern
Adapter Pattern
Have you ever experienced inconvenience of having a different type of socket for your electric plugs, like when you travel to a different country? If you don’t have an adapter, you will not be able to use that socket and power up your devices. It’s good that adapters are generally well available to purchase in … Continue reading Adapter Pattern
Command Pattern
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
Singleton Pattern
In every application there is a need in some kind of globally accessible element that all other components can refer to. Configuration, for instance, is one of those important elements. Multiple classes and functions can refer to it at different points in time to base their output on a certain active configuration attribute. A lot … Continue reading Singleton Pattern
Decorator Pattern
We know that if we want to extend functionality of a particular class, we literally “extend” that class and create a subclass. It is one of the ways to do that. However, it is not the most flexible approach. Moreover, you might encounter often the case where subclassing will turn into a nightmare. Imaging you … Continue reading Decorator Pattern
Strategy Pattern
Imagine that you need to create a game where a character is able to fight. Character should be able to pick a weapon. Different weapon would preform different action. We need the character to be able to use his fists, a knife, and a gun. Every weapon can have its own set of attributes and … Continue reading Strategy Pattern
