Integration of Artificial Intelligence in Business
Design patterns, most of them were analyzed by many smart brains yet. There are plenty of them, but they all have similar structure and became described. Every pattern can be defined fully as it follows:
The main cause of use.
What problems does it solves.
Range of application
It's an analysis of where it can be used, implemented - where it's useful.
Visual schema of how it works with other components of project. These are UML diagrams for instance.
More technical info on how to organize code.
This is important for coders mainly.
Sometimes problem repeats and have already an implementation or more.
When design pattern is done, it may implicate others. One on another pattern, cause possibility to describe problem by exact patterns, not by code. More of those helps to understand the code structures for programmers.
When we want to extend class it’s simple, we just use extend keyword in our class definition to do that. But what if we don’t want to change class definition? Is there solution for that ? Yes, there is - decorator pattern. It helps to keep original object class with no change inside of it. It’s very useful if for some reason we don’t want to touch original class definition. Let’s take a look at code below, to understand it more.
Universal pattern for every solution - does it exist ? There is one interesting thing, that may be at some part. It is called “Picture that explains almost everything” and the concept is made by Mariusz Gil, specialist in design patterns and code brainstorming. He claims that it can solve almost every problem that is given. Here is the link to the picture on Mariusz Gil’s Twitter: