On Wed, 12 Jan 2005 15:27:24 +0000, Greg Stewart <[EMAIL PROTECTED]> wrote: > Not to throw a spanner in the works, but since we are talking about a > blog, what if you wanted to extend it, to be say a photo Blog. Photo > blogs can also have comments
Great question. One solution would be to create a BlogEntry, and have Article and Photo extend BlogEntry. Then move the functions related to comments up to BlogEntry. I would also have to create a BlogEntryDAO and have have ArticleDAO and PhotoDAO extend it. BlogDAO would persist the comments and any other attributes that are common to both articles and photos (title? date?). ArticleDAO and PhotoDAO would persist the parts are specific to them. I understand that when OO gurus have to make a change they prevent themselves from having to make the same type of change in the future. BlogEntry is now closed against new kinds of content. If I want to add videos to the blog, all I have to do is create a couple of new CFCs that extend BlogEntry and BlogEntryDAO. > Usual disclaimer about possibly being way of track applies here... ;) Ditto. Patrick -- Patrick McElhaney 704.560.9117 http://pmcelhaney.blogspot.com ---------------------------------------------------------- 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]
