Abstract Factory Design Pattern

preview_player
Показать описание
Text version of the video

Healthy diet is very important both for the body and mind. If you like Aarvi Kitchen recipes, please support by sharing, subscribing and liking our YouTube channel. Hope you can help.

Slides

Design Patterns Tutorial playlist

Design Patterns Text articles and slides

All Dot Net and SQL Server Tutorials in English

All Dot Net and SQL Server Tutorials in Arabic

In this session we will learn
1. What is Abstract Factory Design Pattern
2. Implementation Guidelines
3. Abstract factory implementation
4. Differences between Factory Method and Abstract Factory Pattern

What is Abstract Factory Design Pattern

Gang Of Four Definition : "The Abstract factory pattern provides a way to encapsulate a group of individual factories that have a common theme without specifying their concrete classes"

The Abstract Factory Pattern provides an interface for creating families of related or dependent objects without specifying their concrete classes

Abstract Factory pattern belongs to creational patterns and is one of the most used design patterns in real world applications

Abstract factory is a super factory that creates other factories

Implementation Guidelines

We need to Choose Abstract Factory Pattern when
1. The application need to create multiple families of objects or products
2. We need to use only one of the subset of families of objects at a given point of time
3. We want to hide the implementations of the families of products by decoupling the implementation of each of these operations

Business Requirement : Handout computers to Contract and Permanent employees based on the designation and employee type with below specifications

Permanent Employee
1. Managerial Position is eligible for Apple MAC Book Laptop
2. Non Managerial Position is eligible for Apple IMac desktop

Contract Employee
1. Managerial Position is eligible for Dell Laptop
2. Non Managerial Position is eligible for Dell desktop

Abstract Factory Representation
1. Client is a class which use AbstractFactory and AbstractProduct interfaces to create a family of related objects.
2. AbstractFactory is an interface which is used to create abstract product
3. ConcreteFactory is a class which implements the AbstractFactory interface to create concrete products.
4. AbstractProduct is an interface which declares a type of product.
5. ConcreteProduct is a class which implements the AbstractProduct interface to create product.

Difference between Abstract Factory and Factory Method
1. Abstract factory pattern adds a layer of abstraction to the factory method pattern
2. Abstract factory pattern implementation can have multiple factory methods
3. Similar products of a factory implementation are grouped in Abstract factory
4. Abstract Factory uses object composition to decouple applications form specific implementations
5. Factory Method uses inheritance to decouple applications form specific implementations
Рекомендации по теме
Комментарии
Автор

you explains very well for singleton and factory pattern. But starting from Factory method pattern you stopped explaining at all why you are doing this. you just saying loud what you are typing and running the program. please give appropriate reason for why you are doing all this operations. it will be helpful for us in preparing for interviews.

chandanasoundararajan
Автор

looks tedious and slept in the middle of the video :D

MrKaviraj
Автор

Really great example, most tutorials stop at the if/else statement for creating the concrete product. Connecting with the front end form made much more sense!

rsdntevl
Автор

Hi Aviash
You did a great job. It was wonderful video, you explained very clear and neatly. Now its easy to understand anyone have knowledge in the programming. Good job. Keep up the good job. Thanks again.

govindarajkrishnan
Автор

Very good videos, my colleague recommended them to me and I already start to understand much more. Thanks for the very good and easy to understand explanations.

HippieInHeart
Автор

Thanks for the patience and explanation. I have been struggling from years to understand diff between factory and abstract factory. Now it's clear ☺

deepthireddy
Автор

this is the best video tutorial in the youtube that explain this design pattern in a clear way, alot of thanks bro

enghazymeh
Автор

I notice that you dont reply to comments. Also I noticed you used interface. Do we use abstract classes with the Factory Method. If so I was wondering why? Thanks for your help !

trustingod
Автор

All he is doing is just keep adding interfaces and classes without any explanation.

Me.anything
Автор

uffff that was a long ride. i am tried now.. bye

satyammishra
Автор

Please illustrate UML diagram of your example before jumping to Implementation.

abhiind
Автор

Thanks for the video. Please make video for Repository pattern, Builder Pattern, Iteratory Pattern, Decorator Pattern

sunnydeck
Автор

Sir, I am a. NET Developer just because of your videos, Please make a video series on MSBI.

manindar
Автор

Does people use this complex implementation in their projects🫡

afsaraf
Автор

Please be clear while explaining .u r are not very clear u r just adding this class that class it would be better if u can relate something real-time then go to business requirements .and also it would be lil clear if u briefly summarize of wat u have done in the whole video at last

akhilarao
Автор

I don't understand... only understand adding new items 😂

nagarjunapappula
Автор

Thanks for making this video. But lot of confusion. Not understand very well...

sailutummuru
Автор

I understand the simplicity part of it, and it should cover beginners... Albeit that being said please do not use methods in interfaces when a property can be used... thanks

uddishh
Автор

Interface are by default public why we need to make interface public at 19.50?

rahulsharmanew
Автор

Half of the time he was coding and I got lost in multiple classes.

mrinal