If you can simulate it (as in the example I just showed), does it really matter if it makes it into CF8?

Aaron

Andrew Scott wrote:
+1...
I agree, it would so good if we could create methods with different arguments. I have flagged this as a wish, so I doubt it will make CF8... But who knows...


On 4/25/07, *Aaron Roberson* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    I have a question that could be answered with method overloading but
    since CFML is dynamic we don't have that option. What I do you
    suggest
    I do instead?

    In my service layer I have a method called saveObject(). At present it
    takes an object as the argument and does this simple bit:

    return variables.objectDAO.save(object);

    At times, it seems that I can pull more logic out of the controller
    and placing it in my service layer by passing in parameters for each
    property of the object. Then in the saveObject() method I would have
    the following:

    object = createObject("component","path.to.object ");
    object.setProperty1(arguments.property1);
    object.setProperty2(arguments.property2);
    ....
    return variables.objectDAO.save(object);

    Both of these approaches are valid and have their place. If we could
    do method overloading I would create both methods and the problem
    would be solved. Since we can't, what do you suggest I do instead?

    Obviously I have to abandon one in favor of the other. Which approach
    do you use and why?

    Thanks,
    Aaron


    You are subscribed to cfcdev. To unsubscribe, please follow the
    instructions at http://www.cfczone.org/listserv.cfm

    CFCDev is supported by:
    Katapult Media, Inc.
    We are cool code geeks looking for fun projects to rock!
    www.katapultmedia.com <http://www.katapultmedia.com>

    An archive of the CFCDev list is available at
    www.mail-archive.com/cfcdev@cfczone.org
    <http://www.mail-archive.com/cfcdev@cfczone.org>




--



Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au <http://www.aegeon.com.au>
Phone: +613  8676 4223
Mobile: 0404 998 273
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/cfcdev@cfczone.org

Reply via email to