[pLog-svn] Some programming questions?

Jon Daley plogworld at jon.limedaley.com
Tue Mar 4 15:16:16 EST 2008


How do you set the _provider variable in your example?  A global?

There are some classes that could be treated as singletons, and perhaps 
Users is one of them, I think you would have to be careful in applying the 
"static principle" across the board, because I'd expect that sometimes the 
class objects are meant to be used and thrown away, and not influence 
other people instances of the objects.

On Sat, 1 Mar 2008, howard chen wrote:

> Hello,
>
> Some questions concerning the programming styles used in LT:
>
> 1. For all the DAO classes, in fact, why not use static for speed, e.g.
>
> $users = new Users();
> $users->doSomething();
>
> why not:
>
> Users::doSomething();
>
> So there will be no need to invoke the object creation every time, for
> speed, for simplicity, for reuse!
>
>
> Thanks.
>
> Howard
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>

-- 
Jon Daley
http://jon.limedaley.com/

If at first you don't succeed, you're doing about average.
-- Leonard Levinson


More information about the pLog-svn mailing list