What are design patterns
What are design patterns ?
Design patterns are recurring solution to recurring problems in software architecture.
(A) Can you list down all patterns and their classification ?
Note :- This is advanced question because anyone who asks to list down all patterns can only be crazy for what he is asking. But it is always a win-win situation for the interviewer. There are three basic classification of patterns Creational, Structural and Behavioral patterns.
ã Abstract Factory:- Creates an instance of several families of classes
ã Builder :- Separates object construction from its representation
ã Factory Method:- Creates an instance of several derived classes
ã Prototype:- A fully initialized instance to be copied or cloned
ã Singleton:- A class in which only a single instance can exist
Note :- The best way to remember Creational pattern is by ABFPS (Abraham Became First President of States).
ã Adapter:-Match interfaces of different classes. ã Bridge:-Separates an objectfs interface from its implementation.
ã Composite:-A tree structure of simple and composite objects.
ã Decorator :-Add responsibilities to objects dynamically.
ã Facade:-A single class that represents an entire subsystem.
ã Flyweight:-A fine-grained instance used for efficient sharing.
ã Proxy:-An object representing another object.
Note : To remember structural pattern best is (ABCDFFP)
ã Mediator:-Defines simplified communication between classes.
ã Memento:-Capture and restore an object's internal state.
ã Interpreter:-A way to include language elements in a program.
ã Iterator:-Sequentially access the elements of a collection.
ã Chain of Resp:-A way of passing a request between a chain of objects.
ã Command:-Encapsulate a command request as an object.
ã State:-Alter an object's behavior when its state changes.
ã Strategy:-Encapsulates an algorithm inside a class.
ã Observer:-A way of notifying change to a number of classes.
ã Template Method:-Defer the exact steps of an algorithm to a subclass.
ã Visitor:-Defines a new operation to a class without change.
Note :- Just remember Music....... 2 MICS On TV (MMIICCSSOTV).
Note:- No source code is provided for architecture section as much of the things can be clear from good UML diagrams.
2007-10-24, 5253👍, 0💬
What are the different storage classes in C? C has three types of storage: automatic, static and all...
What is the quickest sorting method to use? The answer depends on what you mean by quickest. For mos...
How to convert a Unix timestamp to a Win32 FILETIME or SYSTEMTIME? The following function converts a...
How do I force the Dispose method to be called automatically, as clients can forget to call Dispose ...
How To Create an Add-to-Netvibes Button on Your Website? - RSS FAQs - Adding Your Feeds to RSS News ...