Hey Andrew
"Can you explain more on the CFC based viewlets? Personally cfm templates should be for views and CFC for everything else."
Yeah .cfm being the convential way of doing MVC views. Referencing the ColdBox Doc a Viewlets can be defined as:-
“…a self sufficient view. A view that can live on its own, its data is pre-fetched and can just be renderer as is.”
http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbLayoutsViewsGuide#Viewlets
My argument is, what’s the difference between these and how a CFC works in the model? ColdBox has Plugin support I know but what I’m talking about is taking something like a JS DataGrid, encapsulating that in a Viewlet CFC and giving a user Coldbox support for something like :-
event.setView(jsData.displayByQuery(myQuery)).
With ColdBox looking for a View CFC of the name jsData.
"I just don’t see how a CFC viewlet would be beneficial."
Aside from the points I mentioned in the previous post?
It’s maybe not beneficial over what’s there just now in terms of View management but it could be looked at as an alternative convention-based approach.
Taking the theory a step further. Normally you’re handler / view folder structure would look something like this:-
Handlers
– handler1
– handler2
Views
– handler1
— view1
— view2
— view3
– handler2
— view1
— view2
etc.
A View CFC approach could see things slimmed down into a structure like this…
Handlers
– handler1
– handler2
Views
- handler1.cfc
- handler2.cfc
With each view .cfc matching a handler and containing methods view1,view2 etc.
I know HTML is a bit of a Taboo when it comes to CFCs but seeing how loose / open to abuse our project’s views currently sit I could see this as a benefit in controlling what’s actually passed in and used in the views.
Cheers,
James