Hi everyone, Thanks for all the positive feedbacks on benorama.com ColdFusion content.
The articles I've put online are a set of "Best practices" and general design techniques that I daily used for advanced CFMX application development (in our company, a collaborative plate-form). They are certainly not perfect (it is not 100% MVC on the controller part) but they work very well. The idea is that you can take whatever you like and adapt them to your needs. I should add some more details on my use of CFCs, but I haven't updated the site since august 2002... For the moment, here it is on CF-Talk. I usually create : - Entity CFCs that correspond to physical persistent entity (usually a single row in one or several database tables). they inherits from a base Entity.cfc with "init" and "getProperties" methods, they usually have at least "load", "create", "store" and "remove" methods, Ex. : <cfscript> newsEntityInstance = createObject("component","com.mycompany.news.NewsEntity"); newsEntityInstance.load(1011); newsEntityInstance.title = "I have changed the title"; // or newsEntityInstance.setTitle("I have changed the title"); // if you create setter/getter functions for each properties newsEntityInstance.store(); </cfscript> - Utility CFCs that encapsulate generic business logic and are not persistent and stateless. Ex. : <cfscript> newsUtility = createObject("component","com.mycompany.news.NewsUtility"); lastNewsRecordSet = newsUtility.getLastNews(); </cfscript> - Session CFCs that act as a facade to handle the client session (statefull). Ex. : <!--- use the com.mycompany.member.MemberSession CFC put in session scope ---> <cfif session.currentMember.hasTheRightToDoThat()> ... </cfif> This is how I use CFCs for a 100% ColdFusion-based application, but if you have good J2EE skills in your team and if it is required, you might replace those CFCs by EJBs (with all their pros and cons...). Last month, I also spent some time to try to establish methodologies/best practices for complex Flash MX application development : how to nicely apply MVC to Flash MX and Flash remoting. Right now, I used facade CFCs on the server side and ActionScript "proxy" class on the client side, encapsulated in Flash components. Each Flash components correspond more or less to a CF "pagelet". But Flash components are not only a "View" with some "Model" calls to get content, they integrate the full MVC pattern and use at least four ActionScript class (per component) : - a View class that dynamically display the content and set the layout, - a Model class to hold the data of the component, - a Controller class (the Broadcaster class based on the events listener/broadcaster mechanism), - a Service class to call the server components through one or several facade CFCs (the only CFCs with a "remote" access), - the main component class that contains and uses all those classes. But I am still not completely happy with that (pretty complex to develop and to maintain). I am going to re-work on it when I'll have sometimes during the following months. As soon as I have got something more "clear and elegant", I'll put in online in the Flash section of benorama.com. Any feedbacks or suggestions on all those stuffs (ColdFusion or Flash) are welcome! Benoit Hediard www.benorama.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4