Structural Patterns describe how objects and classes can be combined to form larger structures. The difference between class patterns and object patterns is that class patterns describe abstraction with the help of inheritance and how it can be used to provide more useful program interface. Object patterns, on other hand, describe how objects can be associated and composed to form larger, more complex structures.
There are seven structural patterns.
1) Adapter :- Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces.
2) Bridge Patter :- The Bridge pattern is used to separate the interface of class from its implementation, so that either can be varied separately.We can do it by using abstract class instead of interface.
3)Composite Pattern :- The composite pattern describes that a group of objects are to be treated in the same way as a single instance of an object.
i.e The Composite pattern allows you to create a tree like structure for simple and complex objects so they appear the same to the client. An XmlDocument,TreeView are example of composite pattern.
4) Decorator Pattern :- A Decorator design pattern is a design pattern that allows new/additional behavior to be added to an existing object dynamically.
5) Facade :- Facade - The front(face) of a building,In Facade pattern a single class represent the entire system and hide the complexity of the system.
6) Flyweight Pattern :- When we need to share information between many objects than we use Flyweight pattern. If an information is shared between many objects than we can remove it from each object and referenced. This eliminates the redundancy and we can save memory. So instead of storing the same information n times for n object, it is only stored once. This object that contains all of the intrinsic(basic) information is called a flyweight object.
7) Proxy :- The Proxy pattern is used when you need to represent a complex object by a simpler one. If creating an object is expensive in time or computer resources, Proxy allows you to postpone this creation until you need the actual object. A Proxy usually has the same methods as the object it represents, and once the object is loaded, it passes on the method calls from the Proxy to the actual object.
Saturday, November 13, 2010
Subscribe to:
Post Comments (Atom)
Followers
Link
Labels
Agille
(3)
Angular 2
(96)
Architecture
(7)
ASP .Net
(30)
C#/VB .Net
(161)
Entityframework
(11)
General
(33)
Git
(2)
Hosting
(2)
HTML
(4)
Interview
(12)
Interview-Agile
(1)
Interview-Angular
(25)
Interview-ASP .Net
(3)
Interview-C#
(16)
Interview-JavaScript
(1)
Interview-MVC
(30)
Interview-SQL Server
(4)
Interview-WCF
(2)
Islam
(6)
Java Script
(37)
JQuery
(1)
MVC
(53)
NodeJS
(1)
Puzzles
(1)
React-Native
(3)
Security
(1)
Shayri
(10)
SQL Server
(41)
VC++
(5)
WCF
(21)
Web API
(27)
WPF
(21)
No comments:
Post a Comment