26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Note : To remember structural pattern best is (ABCDFFP)<br />

Behavioral Patterns<br />

√<br />

Mediator:-Defines simplified communication between classes.<br />

√<br />

√<br />

√<br />

√<br />

√<br />

√<br />

√<br />

√<br />

√<br />

√<br />

Memento:-Capture and restore an object's internal state.<br />

Interpreter:-A way to include language elements in a program.<br />

Iterator:-Sequentially access the elements of a collection.<br />

Chain of Resp:-A way of passing a request between a chain of objects.<br />

Command:-Encapsulate a command request as an object.<br />

State:-Alter an object's behavior when its state changes.<br />

Strategy:-Encapsulates an algorithm inside a class.<br />

Observer:-A way of notifying change to a number of classes.<br />

Template Method:-Defer the exact steps of an algorithm to a subclass.<br />

Visitor:-Defines a new operation to a class without change.<br />

Note :- Just remember Music....... 2 MICS On TV (MMIICCSSOTV).<br />

Note:- No source code is provided for architecture section. As much of the things can be<br />

clear from good UML diagrams.<br />

(A)What’s difference between Factory and Abstract Factory Pattern’s?<br />

Note: - This is quiet a confusing architect question especially in design pattern section.<br />

<strong>Interview</strong>er can take you for a nice ride …. So get the difference’s in your heart.<br />

First read the definition provided in the first question about both these patterns. The<br />

common thing they have is that they belong to creational patterns. In short they hide the<br />

complexity of creating objects.<br />

The main difference between factory and Abstract factory is factory method uses<br />

inheritance to decide which object has to be instantiated. While abstract factory uses<br />

delegation to decide instantiation of object. We can say Abstract factory uses factory<br />

method to complete the architecture. Abstract Factory is one level higher in abstraction<br />

over Factory.<br />

150

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!