StatCounter

View My Stats

Sunday, February 8, 2009

What is the MVC Pattern (Model View Controller Pattern)?

What is the MVC Pattern (Model View Controller Pattern)?


The MVC Pattern (Model View Controller Pattern) is based on the concept of designing an application by dividing its functionalities into 3 layers. Its like a triad of components. The Model component contains the business logic, or the other set of re-usable classes like classes pertaining to data access, custom control classes, application configuration classes etc. The Controller component interacts with the Model whenever required. The control contains events and methods inside it, which are raised from the UI which is the View component.
Consider an ASP.NET web application. Here, all aspx, ascx, master pages represent the View.
The code behind files (like aspx.cs, master.cs, ascx.cs) represent the Controller.
The classes contained in the App_Code folder, or rather any other class project being referenced from this application represent the Model component.
Advantages: * Business logic can be easily modified, without affecting or any need to make changes in the UI.
* Any cosmetic change in the UI does not affect any other component.

What is the Gang of Four Design Pattern?

What is the Gang of Four Design Pattern?


The history of all design patterns used in modern day applications derive from the Gang of Four (GoF) Pattern. Gang of Four patterns are categorized into 3 types:

1 - Creational2 - Structural3 - Behavioral

The term “Gang of Four” (or “GoF” in acronym) is used to refer to the four authors of the book Design Patterns: Elements of Reusable Object-Oriented Software. The authors are Erich Gamma, Ralph Johnson, Richard Helm and John Vlissides.

What are the different types of Proxy Patterns?

What are the different types of Proxy Patterns?


1 - Remote Proxy - A reference is given to a different object in a different memory location. This may be on a different or a same machine.

2 - Virtual Proxy - This kind of object is created only & only when really required because of its memory usage.

3 - Cache Proxy - An object that behaves as a temporary storage so that multiple applications may use it. For example, in ASP.NET when a page or a user control contains the OutputCache directive, that page/control is cached for some time on the ASP.NET web server.

What is a behavioral design pattern?

What is a behavioral design pattern?


Behaviorial design patterns focus on improving the communication between different objects. Following are different types of behavioral patterns:
1. Chain Or Responsibilities Pattern - In this pattern, objects communicate with each other depending on logical decisions made by a class.
2. Command Pattern - In this pattern, objects encapsulate methods and the parameters passed to them.
3.Observer Pattern - Objects are created depending on an events results, for which there are event handlers created.

What are Structural Design Patterns?

What are Structural Design Patterns?


A structural design pattern establishes a relationship between entities. Thus making it easier for different components of an application to interact with each other. Following are some of the commonly known structural patterns:
1. Adapter Pattern - Interfaces of classes vary depending on the requirement.
2.Bridge Pattern - Class level abstraction is separated from its implementation.
3.Composite Pattern - Individual objects & a group of objects are treated similarly in this approach.
4.Decorator Pattern - Functionality is assigned to an object.
5. Facade Pattern - A common interface is created for a group of interfaces sharing a similarity.
6. Flyweight Pattern - The concept of sharing a group of small sized objects.
7. Proxy Pattern - When an object is complex and needs to be shared, its copies are made. These copies are called the proxy objects.

What are Creational Design Patterns?

What are Creational Design Patterns?


The Creational Design Patterns focus on how objects are created and utilized in an application. They tackle the aspects of when and how objects are created, keeping in mind whats the best way these objects should be created.
Listed below are some of the commonly known Creational Design Patterns:
(*) Factory Pattern
(*)Factory Pattern
(*)Builder Pattern
(*)Lazy Pattern
(*)Prototype Pattern
(*) Singleton Pattern

How to maintain the session state all web server across the webform

How to maintain the session state all web server across the webform


The singleton object aspnet_state.exe still maintains the session state information across
all web servers in the web farm.