|
I prefer the less verbose option as
long as it does not compromise on
the clarity. Verbosity causes clutter, and clutter makes it more difficult to find the serious type bugs ( logical and higher order bugs as opposed to simple first or second order issues) Hence: <cfscript> customerController =3D createObject("component","CustomerController"); // And some docstring if required customerStruct =3D customerController.getCustomer(customerId = checkCustomer.customerID); // doc string ...... </cfscript> Rather than <cfinvoke method="getCustomer" component="customerController" returnVariable="customerStruct"> <cfinvokeargument name="customerId"
value="#checkCustomer.customerID#"/>
</cfinvoke> The above verbosity makes it allot more tedious to read than the equivalent cfscript code. So where I can and where not HTML needs to be generated we stick to script where possible. Where possilbe stick to the Model View Controller paradigm (remember that the MVC paradigm is NOT an application architecture per se - it is just a minimum good practive pattern for business logic and interface seperation). But - ultimately each groups sorts out its standards - and the rest shoud stick to what is defined already - except if it is a bad habit... Sincerely Hardy Jonck ----- Original Message -----=20 From: Jay Gibb=20 To: [EMAIL PROTECTED] Sent: Friday, October 03, 2003 9:42 PM Subject: RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and why? Hey Paul, I've been wrestling with the same question lately and I've concluded = that you shouldn't paint your entire application with the same brush. = Meaning, it's really a case-by-case decision. Here are some options for you: <!--- option 1 ---> <cfscript> myCustomerControllerInstance =3D CreateObject("component", = "customerController"); customerStruct =3D = myCustomerControllerInstance.getCustomer(checkCustomer.customerID); </cfscript> <!--- option 2 ---> <cfobject component=3D"customerController" = name=3D"myCustomerControllerInstance"/> <cfinvoke method=3D"getCustomer"=20 component=3D"#myCustomerControllerInstance#"=20 customerId=3D"#checkCustomer.customerID#" returnVariable=3D"customerStruct"/> <!--- option 3 ---> <cfinvoke method=3D"getCustomer"=20 component=3D"customerController"=20 customerId=3D"#checkCustomer.customerID#" returnVariable=3D"customerStruct"/> <!--- option 4 ---> <cfinvoke method=3D"getCustomer"=20 component=3D"customerController"=20 returnVariable=3D"customerStruct"> <cfinvokeargument name=3D"customerId" = value=3D"#checkCustomer.customerID#"/> </cfinvoke> |
- [CFCDev] CFINVOKE vs. CFOBJECT -- which way and why? Paul Giesenhagen
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Jay Gibb
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way... Leo Schuman
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which... Dave Cordes
- Re: [CFCDev] CFINVOKE vs. CFOBJECT -- which way... Marcantonio Silva
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which... Barney Boisvert
- RE: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Knight, Matt
- Re: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Hardy Jonck
- Re: [CFCDev] CFINVOKE vs. CFOBJECT -- which way and... Rob Brooks-Bilson
- Re: [CFCDev] CFINVOKE vs. CFOBJECT -- which way... Marcantonio Silva
- [CFCDev] Length of a CFC Dave Cordes
- RE: [CFCDev] Length of a CFC Barney Boisvert
- RE: [CFCDev] Length of a CFC Barney Boisvert
- Re: [CFCDev] Length of a CFC Ben Curtis
- RE: [CFCDev] Length of a CFC Barney Boisvert
