PHP Classes

design patterns problem

Recommend this page to a friend!

      Top level forums  >  PHP Specialists  >  General  >  design patterns problem  
Subject:design patterns problem
Summary:for prof
Messages:3
Author:Ahmed
Date:2010-04-05 13:57:50
Update:2010-04-05 17:15:53
 

  1. design patterns problem   Reply   Report abuse  
Picture of Ahmed Ahmed - 2010-04-05 13:57:50
i have made a frame work implements singleton and registry patterns.
i have to store my core objects in the registry(database, template, user)
the problem is that:-
the user object depends on database object for the queries like (login, register, forget password, etc..)
i want to know the right way to use the database object in the user object.
1- may i call the global registry and store it in variable in the user object?
2- call new instance of the database object and store new connection only for user object?
3- destroy the user object and convert it to functions and use the global registry in the functions i need?
4- another way? what is it?

what i should use and why?

There are 2 replies in this thread, which are not being displayed.
Browsing this forum thread replies is available only to premium subscribers.


Go to the premium subscriptions page to learn how to become a premium subscriber and have full access to this forum.