Factory Design Pattern in C# with Examples

preview_player
Показать описание
Factory Design Pattern in C# with Examples
In this video, I am going to discuss Factory Design Pattern in C# with Examples. The Factory Design Pattern is one of the most frequently used design patterns in real-time applications. The Factory Design Pattern falls under the category of Creational Design Pattern and hence it is basically used to manage the object creation and initialization. As part of this video, we are going to discuss the following pointers.

What is Factory Design Pattern?
Understanding the Factory Design Pattern with Real-time Examples.
Example without using the Factory Pattern.
Understanding the Problem of not using the Factory Design Pattern.
Implementing the Factory Design Pattern in C#?
When to use Factory Design Pattern in Real-time Application?
Problems of the Simple Factory Design Pattern.

What is Factory Design Pattern?
According to Gang of Four, the Factory Design Pattern states that "A factory is an object which is used for creating other objects".

In technical terms, we can say that a factory is a class with a method and that the factory method will take the responsibility to create and return different types of objects based on the input parameter, it received.

In simple words, we can say that, if we have a superclass and n number of subclasses, and based on the input data provided, if we have to create and return the object of one of the subclasses, then we need to use the Factory Design Pattern.

In the Factory Design pattern, we create an object without exposing the object creation logic to the client and the client will refer to the newly created object using a common interface.

The basic principle behind the factory design pattern is that, at run time, we get an object of a similar type based on the parameter we pass.

0:00 Introduction to Factory Design Pattern in C#
1:20 What is Factory Design Pattern?
2:35 Understanding the Factory Design Pattern with Real-time Examples.
4:07 Example without using the Factory Pattern.
8:50 Understanding the Problem of not using the Factory Design Pattern.
9:30 Implementing the Factory Design Pattern in C#?
12:52 Real-Life Example of Factory Design Pattern
13:37 When to use Factory Design Pattern in Real-time Application?
14:18 Problems of the Simple Factory Design Pattern.

Most Recommended Design Pattern Books:

Friend, if you do have any questions or suggestions regarding this Factory Design Pattern in C# with Examples video, then please comment to us. In the next video, first I will clear your doubts and questions, then only proceed for the next video. I am going to read all the comments and will try to reply to you all.

If you like this video, then please subscribe to our channel for more videos, and don't forget to press the Bell Icons.

#FactoryDesignPatterninCSharpwithExamples #FactoryDesignPatterninCSharp #CSharpFactoryDesignPatternwithExamples #CSharpFactoryDesignPattern #FactoryPatterninCSharp #FactoryDesignPattern #FactoryPattern
Рекомендации по теме
Комментарии
Автор

Please watch and give your valuable feedback.

DotNetTutorials
welcome to shbcf.ru