Here is our meal class: public class Meal In-keeping with the dinosaur theme, I thought we'd build some nice meals for our dinosaurs. The individual steps are then overwritten for each type of the object being built. ![]() This can be achieved via an abstract base class which defines the order in terms of a set of steps. One example of this is if there is a set order in which set up steps need to happen. The idea is that the builder allows you to do more complex set up for which a constructor would not be adequate. Like the other creational patterns, it also separates out the construction of an object from the object's use. The builder pattern is used when there is complex set up involved in creating an object. ![]() ![]() This week I'm continuing with the creational design patterns, this time focusing on the builder pattern! So, the other week I took a look at the Factory Method and Abstract Factory design patterns. By Carmel Eve Software Engineer I 6th June 2019
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |