Skip to Main Content
Pro PHP MVC
book

Pro PHP MVC

by Chris Pitt
October 2012
Beginner to intermediate content levelBeginner to intermediate
500 pages
10h 29m
English
Apress
Content preview from Pro PHP MVC

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Pro PHP Programming

Pro PHP Programming

Peter MacIntyre, Brian Danchilla, Mladen Gogala
Ajax Design Patterns

Ajax Design Patterns

Michael Mahemoff

Publisher Resources

ISBN: 9781430241645Purchase book