Hello All, My introduction to OOP in CF is a rewrite of a CF5 application generator in CFMX 7. I have a pretty good domain object model but am having trouble finding best practices for the UI.
All of the controller (index.cfm) and model (various cfc's with a simple façade abstracting the business objects) runs first and then the model uses rules to determine what screen template to include. For instance, if form validated, display a list and a "added OK" message, if it failed, re-display the form screen. It then calls the appropriate screen. The screen is currently looking like being a simple CFML template that knowledgeable graphic designers can edit and that is comprised of static HTML, support for variables and basic logic using a generic syntax (so I can generate in other languages), and a number of widgets. The widgets are produced by a code generator that generates (and can save to files at design time) common UI widgets (table with pagination, simple form, n-record update table, etc.) from a set of primitives. The generated UI widgets can then be passed certain runtime properties (object type to display, display properties for this instance, etc.) and generate the appropriate HTML which is then pulled together by the page and screen templates. I'm tempted to describe the widgets something like: <Element name="PagedTable" Property1="value1" . . . /> for the designers. I can then use a Regex/parser to turn that into any appropriate format/include/call. How would you recommend calling the user interface widgets? I'm tempted to put them into methods of a UI CFC which returns the HTML string to display. That would also make it fairly easy to refactor to a Factory pattern to support n-output methods (optimized for different devices, etc.) but no less than Ben Forta suggests using custom tags for UI. Are there some considerations I'm missing? Be gentle on me. This is my first OOP projects and I've been thinking about this less than a week!!! Best Wishes, Peter ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected]
