June 2016
Beginner to intermediate
292 pages
6h 8m
English
The factory pattern and the builder pattern have a similar goal and may be confused if they are not properly understood. Both patterns allow to create objects, but each one has its own peculiarity and scope of application.
In particular, the factory pattern focuses on object creation on the basis of a category or other ways to group objects. When a client asks an object to a factory, it specifies the category of object it needs. However, all objects created by the factory implement the same interface or inherit from the same object so that the client can manage them in the same way without actually knowing its real type.
The builder pattern focuses on building complex objects. Unlike the factories, the builders ...
Read now
Unlock full access