Learn the pattern (books/websites).
Pick the right one (Repository, Factory, etc.).
Code it (interfaces, classes, leverage MVC).
Use Dependency Injection (optional).
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am new to building design pattern using factory design pattern, its C# asp.net mvc application which i am going developing my new web application,
please can you help me how to start from scratch.
I have worked one design pattern application which is designed by my seniors developed using factory design pattern they have developed using component class.
I have 8 years of experience never design, any design pattern from scratch just used develop by others.
Learn the pattern (books/websites).
Pick the right one (Repository, Factory, etc.).
Code it (interfaces, classes, leverage MVC).
Use Dependency Injection (optional).
You should study design patterns. There are books and online courses.
The factory pattern is one of the simplest. instead of creating class instances with the new operator, you call a "factory" method to create the instance. typically an interface is returned rather than a class type. It is not uncommon to use a factory for the factory, especially if plugins are used.
a common use besides configuration is unit test mocking.
simple online example:
Hi @coder rock,
MVC is a Model-View-Controller - high-level architectural pattern which intend is separating UI from from model. Factory is a low-level pattern which intend is a creation of objects.
You can check out the following links:
Getting started with ASP.NET MVC 5
https://github.com/nemanjarogic/DesignPatternsLibrary
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Learn the pattern (books/websites).
Pick the right one (Repository, Factory, etc.).