[pLog-svn] Some programming questions?

Mark Wu markplace at gmail.com
Tue Mar 4 23:21:37 EST 2008


Then, that sounds a good idea.

So, your idea is not change all DAO method to static method. Your idea is
apply singleton pattern to all DAO objects.

I think, It might reduce the memory usage.

But, does there any drawbacks if we change to this?

If not, I think it worth to give it a try.

Mark

> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net 
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of howard chen
> Sent: Wednesday, March 05, 2008 12:06 PM
> To: LifeType Developer List
> Subject: Re: [pLog-svn] Some programming questions?
> 
> On Wed, Mar 5, 2008 at 12:00 PM, Mark Wu <markplace at gmail.com> wrote:
> > Hi Howard:
> >
> >  All DAO are extended from Model. And the model object include db 
> > connection  and basic CRUD method.
> >
> >  If we change to static method, I am not sure we can do this easily.
> >
> >  Take $blogs->addBlog(xxx) for example, if we change it to static 
> > method,  Blogs::addBlog(xxx), we need to change the method to the 
> > following(psuedo
> >  code)
> >
> >  function addBlog(xxxx) {
> >  $model  = Model::getModelInstance();
> >  $model->table = Model::assignTable("blogs");  ....
> 
> I think maybe follow the same way as $config is already good 
> enough, e.g.
> 
> $articles = Articles::getInstance();
> $articles->addArticle(...)
> 
> 
> Howard
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn



More information about the pLog-svn mailing list