Showing posts with label Design Pattern. Show all posts
Showing posts with label Design Pattern. Show all posts

Monday, 12 August 2013

Download AbstractFactoryDesignPatternExampleWithCSharp.zip C# Example.
Download AbstractFactoryDesignPatternExampleWithVB.Net.zip VB.Net Example.


Abstract factory pattern is expanded version of basic factory pattern. In Abstract factory pattern we unite similar type of factory pattern classes in to one unique interface.

Factory classes helps to centralize the creation of classes and types. Abstract factory help bring equability between related factory patterns classes. Which create more simplified interface for the client.

Now let's understand basic details of how to implement abstract factory patterns. We have the factory pattern classes which integrate to a common abstract factory classes through inheritance. Factory classes lay over concrete classes which are derived from common interface.
For instance in below figure we demonstrate "Implementation of abstract factory".

Abstract  Factory Design Pattern
(To view original image , click on image)


Both the concrete classes "ConcreateClass1" and "ConcreateClass2" inherits from one common interface. The client has to only interact with the abstract factory and the common interface from which the concrete classes inherit.

Saturday, 29 June 2013

 Click Here to Download FactoryPatternSampleWithCSharp.zip C# Example.
 Click Here to Download FactoryPatternSampleWithVBNET.zip VB.Net Example.

Factory Design Pattern is type of creational patterns. We can architect software with the help of factory design pattern. With the help of factory pattern we can centralize creations of objects and also reduce object creation logic at the client side.

Let's see some example on this.
We take booklet display example. You have functionality like display booklet on screen in two ways one is with header and footer and other is plain without header and footer.

In traditional approach you might take two classes "BookletWithHeaderFooter" and "BookletPlain" and create objects depending on your requirement on client side like below code.