2010年8月22日星期日

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

You should try implementing a service layer.

What I do in my ZF web apps, is have at least one application service
for each module. If you want to use a model, or really interact with
the domain layer, then you must go through this application service.
This service serves as the API for your module. Also, it is a great
place for caching, logging, etc.

On 8/22/2010 7:28 AM, Marko78 wrote:
> Hi Dolf,
>
> At once I had my models as singletons. But then the wise men said that
> singleton is evil. =)
> So I try not to use singletons though my current goal is basicly working
> similar as singeletons.
>
> But now I can any time make a new instance of my model if needed... But
> basicly I'm using
> my stack of models (array) in my application bootstrap.
>
> br, Marko
>
>
> -----
> br,
> --------------------------
> Marko Korhonen
> Technical Consultant

没有评论: