Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 16. More Design Patterns > Creational Patterns

16.1. Creational Patterns

By using patterns to manage object creation, we gain flexibility that makes it possible to choose or change the kinds of objects created or used at runtime and to manage object deletion, especially in large software systems. Proper management of the creation of objects is an essential part of managing the separation between layers of code and ensuring the proper disposal of objects at destruction time.

In C++, a factory is a program component, generally a class, that is responsible for creating objects. The idea of a factory is to separate object creation from object usage.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial