>> Just having empty methods that only throw an exception upon being
called is most likely all you'll really need--and probably the most
practical.


agreed: 

this example (below) is from 
http://www.sys-con.com/coldfusion/article.cfm?id=606

and shows the empty method in a base class


<cfcomponent displayname="abstractStrategy">
  <cffunction name="Execute" access="public">

    <cfabort showerror="This Method is Abstract and needs to be
overridden">

  </cffunction>
</cfcomponent>


just my 2c worth
barry.b


-----Original Message-----
From: Paul Kenney [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 27 July 2004 3:16 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: CFC Abstract Base Class

Mark, 
You probably will want to keep this as simple as possible.  Just
having empty methods that  only throw an exception upon being called
is most likely all you'll really need--and probably the most
practical.

It is a lot of work to duplicate the way Java handles abstract
classes, and in the end what does it get you?  If anything, all you
really need to do is convey to the user of a base class that it is
must be extended to be completely functional.



On Mon, 26 Jul 2004 19:55:57 -0700, Spike <[EMAIL PROTECTED]> wrote:
> In the past I've done this by just having the method implementations
> throwing the errors.
> 
> Usually, it doesn't really matter too much whether the error gets
thrown as
> soon as the component is initialized, or when the first method is
fired.
> 
> You could probably hack around with the core java classes of the
ColdFusion
> server and use the TemplateProxy or something similar, but I wouldn't
> recommend this.
> 
> Spike
> 
> --------------------------------------------
> Stephen Milligan
> Code poet for hire
> http://www.spike.org.uk
> 
> Do you cfeclipse? http://cfeclipse.tigris.org
> 
> 
> >-----Original Message-----
> >From: [EMAIL PROTECTED]
> >[mailto:[EMAIL PROTECTED] On Behalf Of
> >Mark Mandel
> >Sent: Monday, July 26, 2004 5:50 PM
> >To: CFAussie Mailing List
> >Subject: [cfaussie] CFC Abstract Base Class
> >
> >Hey all -
> >
> >Just wondering what the best way to implement a abstract base class,
> >to ensure that the class cannot be instantiated, but can be inherited
> >from.
> >
> >I tried dropping <cfthrow type="com.AbstractBaseClassException"
> >message="This class cannot be instantiated" > in the top of the cfc,
> >but that fires when a CFC that extends it is created (which makes a
> >degree of sense).
> >
> >So I'm a bit stuck.
> >
> >Any thoughts?
> >
> >Mark
> >
> >--
> >E: [EMAIL PROTECTED]
> >W: www.compoundtheory.com
> >ICQ: 3094740
> >
> >---
> >You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> 
> 
> >To unsubscribe send a blank email to
> >[EMAIL PROTECTED]
> >Aussie Macromedia Developers: http://lists.daemon.com.au/
> 
> ---
> You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
[EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
> 


-- 
Paul Kenney
[EMAIL PROTECTED]

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to