Ooooo - Dogfish Head is my favorite brewery. The Midas Touch is my favorite, but the Raison and the 90 Minute IPA run a very close second.
:) I take it you live in the North East? (I'm in Philly) Roland -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Rinehart Sent: Wednesday, April 06, 2005 8:16 PM To: [email protected] Subject: Re: [CFCDev] Question on class / subclass > This is exactly what interfaces are for: specifying behaviour for > types, without requiring inappropriate inheritance hierarches. > There's a reason every OO language has them; they're damn near > essential for good OO design. Aye. I can't remember what vote number I am for having them in the next CF, even the the significant difficulty they may be to add. > Maybe I'm missing something, or maybe > it's just personal style, but I don't see any value to definine these > "things" (be they interfaces or roles) in code, rather than in > metadata where they belong. Defining things in code (but not in individual classes, which I'll get to in a sec) lets you dynamically creates sets of behavior - you no longer have to account for every permutation at compile time, which can become literally impossible. > With the abstract behaviours, you're packaging the functionality up in > a resuable way, but you're still not providing any means of > determining if a given instance of Vehicle (or whatever the top-most > type is) has the ability to tow a boat. And even at that, you still > have to have all those individual classes anyway, because each one > will have a different init method (for creating the various behaviours > it has) and different get/set/do methods for each behaviour. Sorry, I should've written more, but my better half was asking me to get off the pc and come eat. :) I'd typically use a factory for "known" collections of behavior, instead of individual classes. If you needed to dynamically create a "new" collection of behavior, having the behaviors seperated from the classes provides an API for doing so at runtime. I.E: <cfcomponent name="VehicleFactory"> <cffunction name="CreateEconobox"> <cfset var car = createObject("component", "vehicle").init() /> <cfset car.setTowBehavior(createObject("component", "ZeroTowBehavior")) /> <cfset car.setSpeedBehavior(createObject("component", "LousySpeedBehavior")) /> <cfreturn car /> </cffunction> </cfcomponent> > Now if we were instead to define "plugin" points for the Car class, > and then each car instance could be dynamically extended at runtime > with specific behaviour (i.e. add a trailer hitch or a supercharger), > then we'd be getting somewhere. That's *exactly* what I'm trying to describe, but I may be using poor terminology. > Each Car would have a boolean canDo(string:x) method > or something, which would return if the instance could do the specific > task, whether it was a built-in function or an dynamic add-on. Instead of canDo(), we'd just return a towing behavior of "I'm weak and couldn't tow a fly." Have a good one barney/all others, I'm going to go have a brew (Dogfish Head Brewery, "Raison D'etre" - "A Deep mahogany ale brewed with Belgian beet sugars, green raisins, and a sense of purpose." Sounded strange to me, too, but it's really tasty.) Joe -- Get Glued! The Model-Glue ColdFusion Framework http://www.model-glue.com ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.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' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
