On Jan 13, 2008 3:23 PM, Baz <[EMAIL PROTECTED]> wrote:
> I am curious where most of you are creating your transient objects as I
> have seen it done in the controller and service an equal number of times.
>
I have a router which looks at the URL and decides what type of object is
being requested, along with an action. It then instantiates a controller
for that object and calls the action in that controller.
Typically, the action method or init method on the controller will then
create the model and view, feeding the former to the latter.
So I guess I do it in the controller, but the router is also a controller of
sorts (a front-controller?)
Dunno if that helps any.
Sam
>
> Do you do it like this (pseudo code):
>
> *IN THE CONTROLLER
> *var UserID=get('UserID');
> var UserBean=create('UserBean);
> var UserService=create('UserService');
> var Result=UserService.load(UserBean); //returns fully populated userbean
> (or populates it by reference)
>
> ---------
>
> Or do you do it like this:
>
> *IN THE SERVICE
> *var UserID=get('UserID');
> var UserService=create('UserService');
> var Result=UserService.load(UserID); //creates and returns fully populated
> userbean
>
> Cheers,
> Baz
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CFCDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cfcdev?hl=en
-~----------~----~----~----~------~----~------~--~---