MENU

Fun & Interesting

Фабричный метод (Factory Method) - Паттерны проектирования C#

CODE BLOG 26,214 lượt xem 5 years ago
Video Not Working? Fix It Now

The factory method is a generating design pattern that allows you to carry its instance creation into a separate class. That is, the base class defines the creation interface, and the implementation of the creation process is performed by the heirs.

We will look at the idea of ​​this design pattern in detail and implement it in the C # programming language. And also consider the advantages and disadvantages of the design pattern factory method.

Subscribe to my social networks, there are many interesting and useful for developers:
Vkontakte: https://vk.com/codeblog
Telegram: https://ttttt.me/codeblog

Support the development of the rope:
Donat: https://www.donationalerts.ru/r/shwanoff
Patreon: https://www.patreon.com/codeblog

The source code of the project is available on GitHub https://github.com/shwanoff/FactoryMethodCodeblog

Design patterns describe typical ways to solve common software architecture problems. Design patterns are not a specific code, but a general concept for solving a particular problem, which will still need to be tailored to the needs of your program. The generating patterns solve the problem of creating new class instances.

We implement the factory C # method (factory method c #) or, as it is, sometimes also called the virtual constructor using the example of several popular instant messengers with the ability to send messages of various types. Such C # design patterns (design pattern c #) allow you to save the class from being tied to specific products. The factory method pattern makes it easy to add new products to the program. Design Patterns C # implements the principle of openness / closeness. But it is important to remember that the factory method pattern can lead to the creation of a large number of parallel class hierarchies. C # templates (C # templates) should be used with caution and not implemented in places where they are not needed.

You can also read about this pattern on my website at https://shwanoff.ru/factory-method/

By the way, my name is Shvanov Vadim, and I am a professional .NET developer with over 8 years experience and the author of this channel CODE BLOG. I talk about IT technology and lead this course on the C # language from scratch. Within its framework, we will consider both the basic syntax of the C Sharp language, and its practical application and special technologies, such as ASP .NET, Core, MVC, Unity, WCF, WPF, data structures and algorithms, design patterns, computer science, software and much more. For me, it is important not only to show the practical application of the C # language, but also to explain the basic idea and basic concepts of Computer Science. Visual studio c # and visual c # projects are used as the main development tool.

Training course C # design patterns (C # design patterns):
https://www.youtube.com/playlist?list=PLIIXgDT0bKw5gOlwxV1TigVAeOPhR6kes

Detailed course on the C # programming language:
https://www.youtube.com/watch?v=p9QxqrwkPbA&list=PLIIXgDT0bKw4OmiZ9yGmShKsY0XncViZ8

Detailed course on data structures in the C # programming language:
https://www.youtube.com/watch?v=hZYQmNJBsKM&list=PLIIXgDT0bKw4DB9toGU73ntyYIZV7aJi5

Detailed course on sorting algorithms in C #:
https://www.youtube.com/watch?v=PD1Nn4fHcts&list=PLIIXgDT0bKw4n6pwBjymd3wCPyQ3_SLMo

Talk about programming, motivating, and answering IT questions:
https://www.youtube.com/watch?v=cjjA6SQ_i3Y&list=PLIIXgDT0bKw7oKRr2c1n-e_dUgR8Aqdsi

# programming #csharp # patterns #codeblog #ityoutubersru

Comment