by Chris Pitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo

CHAPTER 6

images

Registry

One of the great things about object-oriented programming is the ability to reuse code by creating multiple instances of a class. When we make changes to a class, all instances will inherit those changes, so we only have to make the change once.

Goals

  • We need to understand the Registry design pattern and the problems it helps us to overcome.
  • We then need to build a Registry class to store object instances. This is an essential part of an efficient framework, so it will be our only focus in this chapter.

Singleton

There will, however, be times when we expect to only use one instance of a given class. We can achieve this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required