Oooh! Nice concept Brian, I hadn't thought about extending DAO's like
that...I like it ....a lot.

I now knight thee, Brian The Brain Kotek

Thanks mate,

Rob

-----Original Message-----
From: Brian Kotek [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2007 18:25
To: CF-Talk
Subject: Re: CFC Composition and/or Extention

I would follow the same subtype/supertype idiom in your DAO objects. Have an
abstract MediaDAO which handles all the database interaction for the Media
table, and have concrete subtypes for each type of Media (VideoDAO,
ImageDAO, etc.) so that they can handle their own type-specific data. I
would have the concrete DAOs first run something like super.insert(data) so
that the superclass will handle whatever has to happen with the Media table,
and then they can go on doing their own type-specific database interactions
with their own tables.

On 10/9/07, Robert Rawlins - Think Blue
<[EMAIL PROTECTED]>
wrote:
>
> Thanks again Brian, another great reply,
>
> Yes these will defiantly be staying as a cast type, i.e. a image will
> always
> be an image and nothing more so at the moment I think the extended super
> class kind of makes good sense for me, taking a base Media object with the
> common attributes and extending it to the other sub classes which contain
> individual/unique properties. I then keep control over the whole lot with
> a
> service.
>
> One other thing I am wondering is how to organise my DAO's for this,
> should
> the Media class have its own DAO separate from the sub types? Or should
> the
> DAO's for my sub types deal with the media table as well as their own? I'm
> guessing the former, so that in my service saveImage() method it passes
> the
> super inited Image object to both the MediaDAO and the ImageDAO and they
> can
> just suck out the properties they need to persist it. Does that sound like
> the best option?
>
> Thanks again mate,
>
> Rob
>
>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Enterprise web applications, build robust, secure 
scalable apps today - Try it now ColdFusion Today
ColdFusion 8 beta - Build next generation apps

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290694
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to