Yep, Brian, you're exactly right.  I'm not talking about the classes,
Chris, but rather the text that defines the init() method signature. If you copy the init() method, you couple the subclass and
superclass's in a weird way (they're obviously already coupled via
inheritance, but avoiding the copy/paste of a method is kind of the
point of inheritance).  I think we can all agree that copy and pasting
is pretty much never a desirable method of coding, and absolutely
never at the method level (with the exception of copying an abstract
method when building a concrete version).

If you use a "shadow" init() as I proposed in my first email, you save
the coupling, but lose the documentation of the params.  If you let
the init method be inherited, you get the best of both worlds,
especially if you use a decent documentation tool (CFCDoc), that gives
you inherited method information.

cheers,
barneyb

On 5/10/06, Brian Kotek <[EMAIL PROTECTED]> wrote:

Chris, I think (could be wrong though) he means that if he wants his subclass 
CFC init() method to have proper API documentation, it would mean literally 
copying and pasting the cffunction and cfargument tags from the superclass and 
pasting them into the subclass, and then adding the call to  
super.init(argumentCollection=arguments) to the subclass. Any time he changes 
the superclass init(), he'll have to change all the subclass init() methods as 
well.

That seems to make sense to me, but on the other hand one could probably argue 
that if you have a subclass with no init(), not having the init() method show 
up in the API documentation for your subclass at all is just about as bad.


--
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 100 invites.

Reply via email to