Hi folks,
I need to ask what you more experienced folks thing about my application
design. I have some reservations about the number of CFC's loaded into the
application scope and the number of calls to CFC methods per request.
Background:
- Client variable DB storage
- Not able to use session vars
- 2 web servers
- 60+ CFC's loaded into the application scope
- Application is for form design software (like a simplified web based
Adobe Designer sort of thing..)
On the front end (ExtJS) the client builds a form by adding textfields,
selects, radios etc. This creates a JSON packet on the server side that
describes the form model. Example:
{
Formname:'myform',
Id:'123',
isSecure:true,
children:[
{
class:'TextField',
name:'First Name',
id:'123'
}
,
{
Class:'Select',
Name:'Province',
Options:['BC','AL'....]
}
]
}
This is highly simplified of course. So the way it works is that this JSON
structure is read from the client scope or the database and then for any
method for a particular form element, its corresponding CFC is called. For
example, we loop over the collection of fields and call the corresponding
CFC in the application scope passing the entire formModel and the individual
node (by reference):
application.form.elems.Select.render(formModel,node)
Within the Select.cfc component we act on arguments.node and update it and
update the formModel. Its kind of like a pseudo object-orientated design. In
fact, it corresponds to a real OOP model on the client side where Select.js
is an instantiated class.
On a single request to generate a form for example, there may be something
like 100 method calls on various application scoped CFC's, all passing in
what can be a large formModel structure.
So my question is, does anyone see anything inherently evil in this design.
Is there a performance hit for invoking so many CFC methods (they are all
app scoped).
I will be doing some load testing shortly, but wanted to see what the
general consensus was. On that note, if any one specializes in load testing
and optimization of CF apps - please contact me offlist..
Brook Davies
Logiforms.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:335303
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm