From the course: C#: Design Patterns Part 1

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Factory Method pattern definition

Factory Method pattern definition - Python Tutorial

From the course: C#: Design Patterns Part 1

Start my 1-month free trial

Factory Method pattern definition

- A factory, the place where a specific type of object is produced, the definition may seem obvious, but the clarity of the term that the pattern is named after is an important part of using design patterns. A factory method is constructing a concrete object of any type, that implements a specified interface from a method in another concrete type. This allows the use of an object without knowing the details of what it is, just knowing what it does. It goes on to decouple, a consumer of an interface from the implementation of that interface. This allows, the use of an object without knowing the details of what it is, just knowing what it does. It decouples a consumer of an interface from the implementation of that interface. It also makes it possible to defer the creation of that object so that the type of returned object can depend on the running applications context. The factory method is another one of the most commonly used…

Contents