From the course: Complete Guide to Java Design Patterns: Creational, Behavioral, and Structural

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

What are creational design patterns?

What are creational design patterns?

When we first start writing programs, it's quite common to put a lot of the logic in the class. But as applications grow, this becomes less practical. Creational design patterns are a set of patterns that help you to manage this complexity. This is the first of the three types of design pattern that I'm going to be looking at in this course. As an example, say that I start creating an application to keep track of invoices for a store. In the beginning, I might just create a class called invoice, and I'd keep all my logic in that class. Then over time, I would add new classes that use my invoice class. So in lots of places in the code, I would have the words "new invoice." Then one day I might need to change how invoice objects are created. For example, I might want to change the constructor, or I might want to have different configurations for different types of invoice. This is tricky because now all my code is tightly coupled to this invoice class and how new invoice objects are…

Contents