(oops submitted the form by accident)

I'm in the same camp as both of you. So lets look at a situation where for
one event you interact with a USER in the session scope, but for other
events the USER is created on the request. If your service is creating a new
USER on every invocation, then clearly it can't directly interact with the
user stored in your session. So do you handle this by using the newly
created request USER to populate the session USER? Something along the lines
of session.User.setMemento(RequestUser.getMemento())? (of course i am
leaving out all complexities, facades and such)

Baz



On Jan 13, 2008 3:35 PM, Baz <[EMAIL PROTECTED]> wrote:

> I'm in the same camp as both of you. So lets look at a situation where for
> one event you interact with a USER
>
>
> On Jan 13, 2008 3:26 PM, Peter Bell < [EMAIL PROTECTED]> wrote:
>
> >  Exactly the same. My controllers are extremely dumb. Usually they just
> > call a service method and then either select a view or redirect to another
> > URL. I have a "new()" method in my BaseService (which all of my service
> > classes extend) so if I want a blank bean, all I have to do is:
> >
> > var User = THIS.new();
> >
> > If I want a bean populated based on an ID, I call my UserService.getByID(ID:
> > int) method which does the following:
> >
> > var User = THIS.new();
> > var Recordset = DAO.getByID(ID);
> > user.load(Recordset);
> >
> > Best Wishes,
> > Peter
> >
> >
> > On 1/13/08 4:42 PM, "Derek P." <[EMAIL PROTECTED]> wrote:
> >
> > For me, transients make sense in the service. I like to think of it like
> > this:
> >
> > If I am the library developer developing for another developer, would I
> > put the responsibility on them to know what type of transient to pass into
> > my services?
> >
> > I am interested to see what others say on this topic.
> >
> > -D
> >
> >
> > On Jan 13, 2008, at 1:23 PM, Baz 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.
> >
> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to