SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Some help with the registry pattern

    In the application Im trying to develop I need to be able to access a class in other classes, regardless what I named the instance. Im thinking a system like the registry pattern would be what I need to use. However, I'm having trouble understanding how to use it in code. Would I create the main class and then add it to the registry directly afterwards?

    Thanks for all your help.

  2. #2
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pretty much. As far as I understand it, the registry is a singleton. You create objects normally, and store them in the registry. Then, everything works out by reference.

    http://phppatterns.com/index.php/art...leview/75/1/1/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •