These patterns deal with the composition of objects structures. The concept of inheritance is used to compose interfaces and define various ways to compose objects for obtaining new functionalities.
This type of design pattern more focuses on how the classes and objects can be composed to form relatively absolute and robust application structures. This pattern is generally used to inherit to compose the interfaces or their implementations.
Match interfaces of different classes
Allow a system to use classes of another system that is incompatible with it.
Allow communication between a new and already existing system which are independent of each other
Ado.Net SqlAdapter, OracleAdapter, MySqlAdapter are the best example of Adapter Pattern.
(Tr) Bu tasarım deseni, mevcut bir sınıfın arayüzünün başka bir arayüz olarak kullanılmasına izin veren bir yazılım tasarım modelidir.
Separates an object’s interface from its implementation
Abstractions and implementations should be modified independently.
Changes in the implementation of an abstraction should have no impact on clients.
The pattern is used when a new version of a software or system is brought out, but the older version of the software still running for its existing client. There is no need to change the client code, but the client needs to choose which version he wants to use.
(Tr) Soyutlamayı uygulamadan ayırmanıza olanak tanır
A tree structure of simple and composite objects
Hierarchical representations of objects are required
A single object and a group of objects should be treated in the same way
The Composite pattern is used when data is organized in a tree structure (for example directories in a computer)
(Tr) Nesneleri ağaç yapılarına dönüştürmenize ve daha sonra bu yapılarla tek tek nesneler gibi çalışmanıza izin veren yapısal bir tasarım modelidir.
Add responsibilities to objects dynamically
Add additional state or behavior to an object dynamically.
Make changes to some objects in a class without affecting others.
(Tr) Aynı sınıftaki nesnelerin davranışını etkilemeden, tek bir nesneye davranışın dinamik olarak eklenmesine izin veren bir tasarım modelidir.
A single class that represents an entire complex system
The abstractions and implementations of a subsystem are tightly coupled.
Need an entry point to each level of layered software.
The facade design pattern is particularly used when a system is very complex or difficult to understand because the system has a large number of interdependent classes or its source code is unavailable
(Tr) tek bir sınıfın tüm bir alt sistemi temsil etmesini sağlamak için kullanılır, karmaşık alt sınıfları maskeler.
Uses sharing to support large numbers of fine-grained objects efficiently.
Flyweight is used when there is a need to create a large number of objects of almost similar nature and storage cost is high.
A few shared objects can replace many unshared ones.
Most of the state can be kept on disk or calculated at runtime.
(Tr) bellek kullanımı ve optimizasyon konusunda ciddi iyileştirmeler sağlar
An object representing another object
Objects need to be created on demand means when their operations are requested.
Access control for the original object is required.
Allow accessing a remote object by using a local object(it will refer to a remote object).
(Tr) Istemcinin kullanacağı bir nesneye kontrol ve erişim için vekillik sağlanması gerektiği durumlarda kullanılır.