2010年8月22日星期日

RE: [fw-mvc] Re: Centralized Stack/Broker or something for Models

> At once I had my models as singletons.

Well, how much sense does that make?

> But then the wise men said that
singleton is evil. =)

It's not - it depends on whether you want to apply a design pattern for the mere application or whether you actually want to accomplish something - like, solve a problem. For example, your log and your mvc instance are singletons. Can't be that evil, then. Doesn't make much sense, though, to have singleton models, because in most cases you don't want something to happen just once, so should be able to juggle around with as many instances of a model class as you like, or some implemented logic allows for, but not just one.

> So I try not to use singletons though
> my current goal is basicly working
> similar as singeletons.

But what for? And why?

> But now I can any time make a new
> instance of my model if needed...

And what's up with that?

> Butbasicly I'm using
> my stack of models (array) in my
> application bootstrap.

And what for?


Best regards,

Andreas

没有评论: