- Creational
- Structural
- Behavioral
In what is called software engineering, a design model describes a solution that is determined by the problems found in the design of the software. It makes it possible to represent practices that are best and which evolve over a longer period of time through gaming but also testing that is done by software experienced developers.
1)Creational Design Patterns are patterns that explain how an object can be created. These models make it possible to reduce the complexity but also the instability that they have by making the creation of objects in a more controlled way.
In most cases, the new operator is often considered harmful as it distributes objects throughout the application. This can become even more challenging over time, in order to change the implementation, for the sole reason that the classes have a very close relationship with each other.
Creative design models address this issue here by making the client disconnect from the initialization process that is currently underway.
1. Singleton – Makes it possible to provide a single instance of an object that exists during an application.
2. Factory Method – It is possible to create different objects of different classes that are related, but without making specifications in the exact object that can be created.
3. Abstract Factory – Makes possible the creation of families that are dependent but also connected together.
4. Builder – Has the ability to build complex objects using one approach after another, or in other words step by step.
2) Structural design patterns– These are models that have to do with what is called the organization of objects and classes that are different, but also that change the formation of structures from the largest, but at the same time to make it possible to provide the functionality of ri.
Explain how the structural design model is used-
At the moment when we have two interfaces that have an incompatibility with each other but also that want to have a relationship between them by having adaptation with each other, it is also called as the adapter design model. This model, also known as the adapter model, converts an interface of a class to an interface or another class that the client expects. In other words, what is called adaptability somehow allows the classes to work together, which at another point due to incompatibility could not have happened otherwise.
3)Behavioral design patterns represent the responsibility but also the interaction of different objects.
By generalizing these design models, the interaction that takes place through objects should be in such a way that they too can talk smoothly to each other.
Translated into simpler words, in order to avoid dependencies but also difficult coding, the application and the client at the same time should be connected as loosely as possible.
Behavioral design models have 12 types usable for this model:
1. Enterprise chain model
2.Command model
3.Performer model
4.Iterator Models
5.Broker model
6.The model of memories
7.Observer model
8.The state model
9.Strategy Model
10.Template model
11.Visitor model
12.Object Null
References:
https://www.gofpatterns.com/design-patterns/module2/three-types-design-patterns.php
https://howtodoinjava.com/design-patterns/creational/
https://howtodoinjava.com/design-patterns/structural/
From the blog CS@worcester – Xhulja's Blogs by xmurati and used with permission of the author. All other rights reserved by the author.