#Design_Patterns
#Creational_patterns
👉Creational patterns
In software engineering, creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.
1️⃣ #Abstract_Factory_Design_Pattern
▪️Creates an instance of several families of classes
2️⃣ #Builder_Design_Pattern
▪️Separates object construction from its representation
3️⃣ #Factory_Method_Design_Pattern
▪️Creates an instance of several derived classes
4️⃣ #Object_Pool_Design_Pattern
▪️Avoid expensive acquisition and release of resources by recycling objects that are no longer in use
5️⃣ #Prototype_Design_Pattern
▪️A fully initialized instance to be copied or cloned
6️⃣ #Singleton_Design_Pattern
▪️A class of which only a single instance can exist
@javaCode☕️
#Creational_patterns
👉Creational patterns
In software engineering, creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.
1️⃣ #Abstract_Factory_Design_Pattern
▪️Creates an instance of several families of classes
2️⃣ #Builder_Design_Pattern
▪️Separates object construction from its representation
3️⃣ #Factory_Method_Design_Pattern
▪️Creates an instance of several derived classes
4️⃣ #Object_Pool_Design_Pattern
▪️Avoid expensive acquisition and release of resources by recycling objects that are no longer in use
5️⃣ #Prototype_Design_Pattern
▪️A fully initialized instance to be copied or cloned
6️⃣ #Singleton_Design_Pattern
▪️A class of which only a single instance can exist
@javaCode☕️
#Design_Patterns
#Structural_patterns
▪️In Software Engineering, Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities.
1️⃣ #Adapter_Design_Pattern
Match interfaces of different classes
2️⃣ #Bridge_Design_Pattern
Separates an object's interface from its implementation
3️⃣ #Composite_Design_Pattern
A tree structure of simple and composite objects
4️⃣ #Decorator_Design_Pattern
Add responsibilities to objects dynamically
5️⃣ #Facade_Design_Pattern
A single class that represents an entire subsystem
6️⃣ #Flyweight_Design_Pattern
A fine-grained instance used for efficient sharing
7️⃣ #PrivateClassData_Design_Pattern
Restricts accessor/mutator access
8️⃣ #Proxy_Design_Pattern
An object representing another object
@javaCode☕️
#Structural_patterns
▪️In Software Engineering, Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities.
1️⃣ #Adapter_Design_Pattern
Match interfaces of different classes
2️⃣ #Bridge_Design_Pattern
Separates an object's interface from its implementation
3️⃣ #Composite_Design_Pattern
A tree structure of simple and composite objects
4️⃣ #Decorator_Design_Pattern
Add responsibilities to objects dynamically
5️⃣ #Facade_Design_Pattern
A single class that represents an entire subsystem
6️⃣ #Flyweight_Design_Pattern
A fine-grained instance used for efficient sharing
7️⃣ #PrivateClassData_Design_Pattern
Restricts accessor/mutator access
8️⃣ #Proxy_Design_Pattern
An object representing another object
@javaCode☕️
#Design_Patterns
#Adapter_Design_Pattern
👉Intent
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
▪️Wrap an existing class with a new interface.
▪️Impedance match an old component to a new system
@javaCode☕️
#Adapter_Design_Pattern
👉Intent
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
▪️Wrap an existing class with a new interface.
▪️Impedance match an old component to a new system
@javaCode☕️
☕️JAVA Language Community
#Adapter_Design_Pattern @javaCode☕
#Design_Patterns
#Adapter_Design_Pattern
👉Discussion
Reuse has always been painful and elusive. One reason has been the tribulation of designing something new, while reusing something old. There is always something not quite right between the old and the new. It may be physical dimensions or misalignment. It may be timing or synchronization. It may be unfortunate assumptions or competing standards.
It is like the problem of inserting a new three-prong electrical plug in an old two-prong wall outlet – some kind of adapter or intermediary is necessary.
Adapter is about creating an intermediary abstraction that translates, or maps, the old component to the new system. Clients call methods on the Adapter object which redirects them into calls to the legacy component. This strategy can be implemented either with inheritance or with aggregation.
Adapter functions as a wrapper or modifier of an existing class. It provides a different or translated view of that class.
@javaCode☕️
#Adapter_Design_Pattern
👉Discussion
Reuse has always been painful and elusive. One reason has been the tribulation of designing something new, while reusing something old. There is always something not quite right between the old and the new. It may be physical dimensions or misalignment. It may be timing or synchronization. It may be unfortunate assumptions or competing standards.
It is like the problem of inserting a new three-prong electrical plug in an old two-prong wall outlet – some kind of adapter or intermediary is necessary.
Adapter is about creating an intermediary abstraction that translates, or maps, the old component to the new system. Clients call methods on the Adapter object which redirects them into calls to the legacy component. This strategy can be implemented either with inheritance or with aggregation.
Adapter functions as a wrapper or modifier of an existing class. It provides a different or translated view of that class.
@javaCode☕️
#Design_Patterns
#Bridge_Design_Pattern
👉Intent
▪️Decouple an abstraction from its implementation so that the two can vary independently.
▪️Publish interface in an inheritance hierarchy, and bury implementation in its own inheritance hierarchy.
▪️Beyond encapsulation, to insulation
@javaCode☕️
#Bridge_Design_Pattern
👉Intent
▪️Decouple an abstraction from its implementation so that the two can vary independently.
▪️Publish interface in an inheritance hierarchy, and bury implementation in its own inheritance hierarchy.
▪️Beyond encapsulation, to insulation
@javaCode☕️
#Design_Patterns
#Structural_patterns
#Composite_Design_Pattern
👉Intent
▪️Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
▪️Recursive composition
▪️"Directories contain entries, each of which could be a directory."
▪️1-to-many "has a" up the "is a" hierarchy
@javaCode☕️
#Structural_patterns
#Composite_Design_Pattern
👉Intent
▪️Compose objects into tree structures to represent whole-part hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
▪️Recursive composition
▪️"Directories contain entries, each of which could be a directory."
▪️1-to-many "has a" up the "is a" hierarchy
@javaCode☕️