-----Original Message-----
From: Steven Boynes [mailto:[EMAIL PROTECTED]
Sent: Thursday, 25 November 2004 8:54 a.m.
To: [EMAIL PROTECTED]
Subject: Re: AW: AW: [CFCDev] Validation---------------------------------------------------------- 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 [EMAIL PROTECTED]>From: Sean Corfield <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Re: AW: AW: [CFCDev] Validation >Date: Tue, 23 Nov 2004 23:27:28 -0800 > >On Tue, 23 Nov 2004 12:57:28 -0800, Steven Boynes <[EMAIL PROTECTED]> wrote: > > I use inheritance to create what I think is called an "interface", requiring > > certain methods to be overridden and to ensure that all of the components > > can be serialized. Is this proper use? > >Well, ColdFusion doesn't have the concept of an interface so this is a >bit of a hack however you look at it. > > > component that has serialization/deserialization methods, as well as a debug > > output method and every component in my system extends this component. > >It's not really an "is-a" relationship so you shouldn't use >inheritance (although if you really must insist on doing this, you >might just as well modify WEB-INF/cftags/component.cfc). >-- >Sean A Corfield -- http://www.corfield.org/ >Team Fusebox -- http://www.fusebox.org/ >Breeze Me! -- http://www.corfield.org/breezeme >Got Gmail? -- I have 1 invite > >"If you're not annoying somebody, you're not really alive." >-- Margaret Atwood >---------------------------------------------------------- >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 [EMAIL PROTECTED]hmm...what would you suggest as a good approach to this problem? I am building a system where my objects need to be serialized into WDDX packets for storage; the problem is that they may be composite objects and so had to have the serialization/deserialization methods in order to recursively check and serialize or deserialize. Any object thats added in the future needs these methods in order to function in the system. I guess I could just replicate them in each new object but I thought it would make sense to extend a base component.
I'm not sure I understand why this isn't an "is-a" relationship. The basic component is called a PageElement, and all of the classes that extend are PageElements. For example, an "image is a page element" and a "text block is a page element", is this too general of a way to use inheritance? An element must be serializable, deserializable, and must have a display() method.
...or are you thinking that these are two separate kinds of properties of the objects. So for inheritance you might have a Canine class that extends an Mammal class, but the inheritance relationship applies only to characteristics (four legged, warm blooded...) and not behaviors?
##
##
