DEV Community


Discussion on: How to use Factory Method Design Pattern in C#

meanin profile image
Paweł Ruciński

Hi really nice article, thanks for sharing.

One question: Does 'build' method signature not implies that this is a builder pattern implementations? I used to implement a factory pattern with create method :)

gary_woodfine profile image
Gary Woodfine Author

You could use Make, Create, Fabricate, Manufacture,Build.

It really doesn't matter. In a Builder pattern, you will also invariably have a Create method too as part of your chain. An example of which you will find on NBuilder , Builder<SomeClass>().CreateNew().Build(); would form part of your chain.

In the example, I used Build as that was kind related to how Vehicles are built in a Factory, I could've used Manufacture() , but I thought Build would be a word that would be more widely understood.