Shared Object
| From: | Alessandro Vitale | Date: | Mon, 26 Apr 2004 08:15:18 +0000 |
| Subject: | Shared Object | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184610@lists.php.net to get a copy of this message | ||
I would like to open a discussion about this question:
"which is the best solution for creating shared objects"
I am working on a PHP framework which should speed up the development of web
applications. Each section of the application is managed by a different
object but most of the objects rely on a set of common facilities (DB
object, Log object, etc.). At the moment, in order to share the common
objects, I use this approach:
all the objects are created by one single .php script following these steps:
- create all the shared services
- create any other object that needs access to the shared object and pass it
reference to the shared services
I would like to enhance this mechanism and meet the following requirements:
- the mechanism should be scalable (i.e., including a new service should be
straightforward)
- the implementation code in the client objects should be readable (e.g.,
$this->DbObject->query($query);)
- each service should be persistent
If anybody has used the same architecture, I would like to learn about
different approaches because I am not very much satisfied with my solution.
Cheers,
Alessandro
-------------------------------
Alessandro Vitale
Jr Software Engineer
Tiscali International Network
avitale@tiscali.com
-------------------------------