Mark Stanton wrote:

Then you have to set a cfargument for every possible variable that comes in
to your cfc


Yeah - I do that anyway really. Like Taco says required first &
optional last. I've never really thought all these scenario's clearly,
I've just always done it that way.

I also generally use the object.method(argName=simpleValue,
argName=simpleValue, argName=simpleValue) style and keep the values as
simple & opaque as possible (i.e. not pass through complex structs if
I can help it). I know everyone has their own ways of doing this but I
just find that its better to be as verbose as possible, especially
when working with CFC's because reuse is a major aim.


Yeah man, like CFMX is a language and others for the matter where you can get away with it, use it. Its just other languages get strict in the way you pass arguments into methods - admittedly though situations like Java, allow you to write methods based on the number of arguments (and types for that matter) - which i think the technical term is "overloading" heh new bing buzzword for me l8ly.


ie

public function init(arg1) {
        do stuff
}

public function init(arg1,arg2) {
        do similiar stuff but more complex

}       

public function init(arg1,arg2,arg3) {
        do something really cool
}

I've seen this approach use a lot, and it took me a while to grasp it and i always put it down to the fact that you had to pass in arguments strictly into methods thus its counter-act solution.

If *We* as a collective CFMX community wanted to have a super() solution with a similiar technique above, well we could write a method wrapper to do this and just interogate the arguments being pushed in, allowing us to route routines accordingly.

I don't forsee that is typically a bad thing as in your sub-methods you could catch any data integrity issues.


<forest gump> Thats all i have to say on that matter Jennah </forest gump>

In the couple of cases where I have used super() I've just been
passing a single argument so I've done the super(arg) and had no issue
- or maybe I did & thought I was wrong rather than CF when it didn't
work???
Your not cool unless you pass multiple in, didn't you get the "how to be CFMX cool handbook?" nah its academic on what you do with the super, different strokes for different folks.




Regards Scott Barnes Senior Web Developer Alpha Business Systems [EMAIL PROTECTED]

1/31 Thompson St
Bowen Hills QLD 4006
Ph +61 07 3216 0999
http://www.alphabus.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