On 12/4/07 12:12 PM, "Sean Corfield" <[EMAIL PROTECTED]> wrote:

> I'm starting to find that having save() on an object is much more
> convenient than requiring access to a service,

Yes and no. It is my preferred approach, but let's say you have a Flex app
for managing content. User adds a new article in Flex, flex send the article
back to ColdFusion. If you want to just write a generalized remote proxy for
your service layer, by having (say) an ArticleService.save(), that is
automatically exposed to the Flex app without additional code. Otherwise
you're going to have to write an additional remote method for save that
instantiates a transient Article and then calls Article.Save (which is
actually how my ArticleService.save() operates under the hood).

So I like the Bean.save() idiom, but I also wrap that with a Service.save()
method to complete my remote API.

One question I have. I know you advocate a service layer where there isn't a
1:1 correlation between beans and service components. When generating apps,
I typically generate one service class per business object and effectively
treat it like a meta-class - a collection of class methods for things like
new(), delete(), getList(), save() and the like. I then use ORM for
relationships, so if I getThread() in a discussion group, depending on lazy
load settings it may or may not return the topics within the thread.

For the (fairly straightforward) apps I generate, that works really well.
What are some of the cases you have come across where a 1:1 mapping between
business objects and service classes is NOT appropriate (or optimal)? I
definitely buy that it isn't always the right approach, but I'm trying to
get some real world examples!

Best Wishes,
Peter






--~--~---------~--~----~------------~-------~--~----~
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