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?