Difference between factory and abstract factory patterns, DOT NET Programming

Assignment Help:

What is the difference between Factory and Abstract Factory Patterns?

The main basic difference between factory and Abstract factory is factory method uses the  inheritance to decide which object has to be instantiated while the abstract factory uses the delegation to decide the instantiation of the object. We can say that Abstract factory uses factory method to done  the architecture. The Abstract Factory is one level greater  in abstraction over the Factory.

The 2  class figure  below will provide the overview of what is the actual difference. First figure shows a sample  of the implementation of the Factory Patterns. In this figure there are2  basic sections:-

1)The actual product section that  is  Class "Product" it inherits from an abstract class "AbstractProduct".

2)The creational aspect part that is . "ConcreteCreator" class which inherits from class "Creator".

3)Now there are various rules that the client will have to follow who will require the "Product" object. He will never suggest directly to the actual "Product" object he will suggest  the "Product" object by using the "AbstractProduct".

4)The Second client will never use the "New" keyword to create the "Product" object but will use "Creator" class which in turn will use "ConcreteCreator" class to create a  actual "Product" object.

502_factory pattern.png

Figure: - Class diagram of a factory Pattern

Now let's look at the second class diagram that provides an overview of what actually the "Abstract factory" pattern is. It creates objects for families of the classes. In brief it describes the collection of factor methods from different families. In brief it groups related to factory methods. For e.g.  in this the class "Creator" is implemented by using the "Abstract" factory pattern. It then  creates objects from the multiple families rather than one product.

2080_factory pattern1.png

Figure:-Class Diagram of Abstract Factory


Related Discussions:- Difference between factory and abstract factory patterns

Inventory billing and management application in .net, Inventory billing and...

Inventory billing and Management application in .net Project Description: Digital Inventory management Main Features         Multi user User friendly windows based s

Develop c# routines for website back end, Project Description: We requir...

Project Description: We require some routines written in C# (.NET) to: * Parse several RESTful APIs to change and push data to RabbitMQ * Pop objects from RabbitMQ and inp

Emr onc mu2 certification, EMR ONC MU2 CERTIFICATION Project Description...

EMR ONC MU2 CERTIFICATION Project Description: We are looking for someone with experience in EMR MU2 certification per ONC needs. If you have experience and participate in

Stakeholder, Who is a stakeholder? The stakeholder is anyone who has so...

Who is a stakeholder? The stakeholder is anyone who has something to gain or lose as a result of the completion or failure of the project or phase. The stakeholder is not on

I need help in calendar integration into site using .net, I need help in Ca...

I need help in Calendar integration into site using .net I'm demanding to create a web-based proof of concept for the following scenario. I'd like to permit a user to select

Data hiding and encryption would be done on images, Data hiding and encrypt...

Data hiding and encryption would be done on images. Both these process should have a data hiding key and an encryption key correspondingly. Another user should be able to decrypt t

Three tier architecture, What is three tier architecture? The 3 tier so...

What is three tier architecture? The 3 tier software architecture was comes into action in the 1990s to overcome the limitations of the 2 tier architecture. There are 3 laye

Gaming tracks company for a mobile game developing, Require Guys in Gaming ...

Require Guys in Gaming Tracks Company for a mobile game developing Project Description: I want a team of game developers for life-time as mobile dev team in my company. So, i

I need online slot video game for a facebook, I need Online Slot Video Game...

I need Online Slot Video Game For A Facebook Project Description: Prepare an online slot video game for a Face book promotion in order to attract new visits and Increase the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd