----- Original Message -----
From: "Matt Liotta" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, July 11, 2002 1:59 PM
Subject: RE: Component Calls: What would you do?

You said it yourself...

> If the language supports
> overloading than the constructors can be overloaded, if the language
> doesn't then the constructors can't be overloaded.

So - CF doesn't support overloading, that doesn't mean that what you call
the component body isn't a default constructor.  Infact, it just means that
Macromedia was sensible - they decided that there was no need for a special
constructor method for CFC's because each CFC may only have a default
constructor (and by definition, a default constructor cannot have
arguments).

Lets say, for example, that MM took what you call the "component body" and
turned that into a method that every CFC must have, that takes no arguments,
would you be happy to call that a constructor.  I think so.  So what
difference does it make if that method is given a name, as a specific
method, or just remains nameless as the "component body", it still does the
same thing, at the same time, is compulsory and takes no arguments.

I think if you said to any Java or C++ programmer, "see this bit of code,
that is what CFC's use as thier one and only constructor", they will
instantly recognize that this happens when the object is "constructed", that
it's a "default constructor" and that because CF doesn't support
overloading, that it's the "only constructor".

And likewise I think if you said to any CFC programmer, "see this Java
function, this is what Java classes use as thier default constructor, but
because you can overload in Java you may specify more non-default
constructors that can take arguments", it would be quite plain that this
function happens when the object is "constructed", that it's a "default
constructor" and that because Java supports overloading, it's not the "only
constructor".

The concept is the same - a bit of code, that gets executed when the object
is created, that can be used to initialize everything that object needs, be
it written in Java, C++, Python, Smalltalk or ColdFusion.

---
James Sleeman



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.373 / Virus Database: 208 - Release Date: 7/9/2002

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to