On Mon, Mar 7, 2011 at 10:56 AM, Nathan Strutz <str...@gmail.com> wrote:
> If you have a lot of arguments, one way to refactor that is to make a
> component that encompasses those arguments - essentially a bean, maybe a
> couple of beans if the arguments are unrelated. In your first public method,
> instantiate that bean with the arguments, then just pass that bean around.
> Follow that, and you've gone from just using components to actual
> object-oriented programming.

Hardly.

A bean that's just a glorified struct with dumb get/set methods isn't
OOP, it's just a struct with overhead.

Frankly, creating new components just to group related arguments is a
waste of time in CFML and just slows down your code.

In answer to Brook's original question: yes, it is probably better
practice to declare the arguments in the private method, for
documentation purposes, especially if you are referring to those
arguments in the code...
-- 
Sean A Corfield -- (904) 302-SEAN
Railo Technologies, Inc. -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:342942
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to