Scala Design Patterns.
上QQ阅读APP看书,第一时间看更新

Creational design patterns

The creational design patterns deal with object creation mechanisms. Their purpose is to create objects in a way that is suitable to the current situation, which could lead to unnecessary complexity and the need for extra knowledge if they were not there. The main ideas behind the creational design patterns are as follows:

  • Knowledge encapsulation about the concrete classes
  • Hiding details about the actual creation and how objects are combined

We will be focusing on the following creational design patterns in this book:

  • The abstract factory design pattern
  • The factory method design pattern
  • The lazy initialization design pattern
  • The singleton design pattern
  • The object pool design pattern
  • The builder design pattern
  • The prototype design pattern

The following few sections give a brief definition of what these patterns are. They will be looked at in depth individually later in this book.