@Jared - Yes that makes sense, when I said UserService has a User I
meant that a User object is passed into a UserService method as an
argument (likely from a controller).

I think the funny thing was passing in a User object to a service, but
the service is composed into the User. Seems very circular, just need
to get my head around it.

Thanks,

Michael

On Dec 23, 5:23 pm, Jared Rypka-Hauer <[email protected]> wrote:
> Why does UserService have a User? UserService IS-A Service and HAS-A  
> UserDAO, but the only time the UserService interacts with a User is  
> when methods are called and user objects or properties are passed  
> into them.
>
> User HAS-A UserService HAS-A UserDAO works well because the User  
> should be the API to user-related behaviors, the Service is where  
> those behaviors are implemented at an application level and the DAO  
> serves the persistence needs. Generally when a User object calls a  
> UserService method, it's going to call UserService.save(this) or  
> something similiar:
>
> User.setId();
> User.load();
>
> User.load() internally does:
> <cfset this = variables.UserService.getUserById(arguments.id)>
>
> Is that making sense?
>
> J
>
> On Dec 22, 2008, at 11:58 PM, Michael Sharman wrote:
>
>
>
> > Thanks Mark, I considered that but I think I got held up on the
> > circular-ish dependancy.
>
> > UserService has a User <--> User has a UserService (which in turn has
> > a UserDAO)
--~--~---------~--~----~------------~-------~--~----~
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