I've always wondered what "service" means in this context - comment service. I hear references sometimes to the service layer, or a "_____" service in an app and although i get the general sense, i'm wondering what distinguishs a service from anything else.
I like this general concept better. I just ran into this here, specifically with "comments". I originally built it coupled with content versions, but the moment it appeared in the app, a user asked if they could add a comment to a page. My hand hit my forehead in less than a second. (Why didn't i couple comments and versions like that!!!) I'd also say that i've found that EDITING and RENDERING are 2 very different things in an app of this nature, and gradually i've learned that it's important to treat them separately. Perhaps this seems academic at first glance, but i ran smack into that distinction as soon as i tried to code my first attempts. RenderPage, to be flexible and efficient, shouldn't need to traverse a changing sea of hierarchy to throw a page together. And users can only deal with one bit of content at a time. All these things imply, in my limited experience, that components of a page shouldn't be tightly coupled. How to accomplish that in a well constructed model is a bit of a challenge. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Bill Rawlinson Sent: Wednesday, January 12, 2005 6:02 PM To: [email protected] Subject: Re: [CFCDev] When to Use Composition (Was: Newbie approach...) boy, this discussion is getting busy. Another thought is to create a comment service that anything could use. For instance you might have a photo that needs comments. Then your photo functionality could register with the comment service. Likewise your articles. Maybe you want to post some documents on your site and let people comment on them. Then you have a document manager that registers with the comment service. (technically, a photo is just a document afterall). plus, with a comment service you could use the onc service across many apps including the blog without havnig to recreate comment functionality each time. The service could provide the form for posting the comment and everything if you wanted it to (which you could then style to fit in your sites look and feel). On Wed, 12 Jan 2005 11:46:56 -0500, Brian Kotek <[EMAIL PROTECTED]> wrote: > Thoughts on why that would be better or worse than this in the manager: > > public void addComent( int articleID, commentTO commentTO ) { > commentDAO.save( articleID, commentTO ); > } > > In that case you don't need to call the articleDAO at all, nor is the > article responsible for doing anything with the comment. And if you had > the articleID as part of the commentTO you could actually just do: > > commentDAO.save( commentTO ) > > > > >From the ArticleManager's point of view, this is all that happens: > > > > var article = ArticleDAO.getArticle( articleID ); > > var comment = article.addComment( commentTO ); > > ArticleDAO.createComment( comment ); > > > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at www.mail-archive.com/[email protected] > -- -------------- [EMAIL PROTECTED] http://blog.rawlinson.us I have 9 gmail invites,want one? ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
