1 / 15

Fusebox Application Object Model

Fusebox Application Object Model. Gabe Roffman, eTesters. Break Your Application Down. A quick way to simplify your application is to break it down Break your massively complex site (“Home” application) into many sub-directories (“Circuit” applications). Fusebox “Home” Application.

franceslong
Download Presentation

Fusebox Application Object Model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. FuseboxApplication Object Model Gabe Roffman, eTesters

  2. Break Your Application Down • A quick way to simplify your application is to break it down • Break your massively complex site (“Home” application) into many sub-directories (“Circuit” applications)

  3. Fusebox “Home” Application • This is your overall site. Such as: • www.etesters.com • www.fusebox.org • www.ebags.com • The Home application is more of a concept, it ties your circuit applications together

  4. Connect the Circuits • How can I connect all my circuit applications together? • How can a team of developers connect their circuits together? • How can one company connect another company’s circuits together?

  5. How EJBs do it • Java Beans are like circuit applications • Enterprise Java Beans are Beans that have standardized functions for communication

  6. How Javascript does it • Uses Document Object Model • DOM is a structure of every element on the page • Using DHTML, you can change any value in the DOM

  7. Javascript DOM Example: <html> <head> <title>Untitled</title> <script language="JavaScript"> // through the DOM, we can change the values of ‘myspan’ function change() { document.all.myspan.innerHTML = 'The text has changed'; } function changeback() { document.all.myspan.innerHTML = 'Now it has changed back!'; } </script> </head> <body> <span id="myspan“ onmouseover="change()" onmouseout="changeback()"> We'll change this text. </span> </body> </html>

  8. Problems with the JS DOM • Different model in Netscape and Internet Explorer • No visible map of what the model is We can do better!

  9. How would we do it? • Application object model • Similar to document object model in JS • Standardized structures for storing variables in the request scope • Stored in app_model for easy reference!

  10. CF Structures • It is possible to achieve this same style of ‘dot’ notation in CF using structures • <cfset users=StructNew()> • <cfset users.user_132=StructNew()> • <cfset users.user_132.first_name=“Gabe”> Stop me if you do not understand structures

  11. Request Variables • Request is a scope that is available both locally and within custom tags and even nested custom tags. • No need to use CFLOCK like with Application variables Stop me if you do not understand request variables

  12. App_Model.cfm • A new application file is being introduced called “App_Model.cfm” • App_Model.cfm is for setting your AOM structures • Gives a clean map of your Global variables • Include app_model from within Application.cfm

  13. Standard Global Variables • Which variables should we standardize on? • Can we categorize these standard variables? • What if I want to create my own?

  14. Example App_Model.cfm <cfset request.page = StructNew()> <cfset request.page.js = StructNew()> <cfset request.page.js.scriptfiles = ArrayNew(1)> <cfset request.page.js.onLoad = ArrayNew(1)> <cfset request.page.js.onunLoad = ArrayNew(1)> <cfset request.page.display = true> <cfset request.page.title = "eTesters"> <cfset request.page.cssFiles = ArrayNew(1)> <cfset request.page.nocache = "true"> <cfset request.page.head = ""> <cfset request.page.HTML = ""> <cfset request.page.headers = ArrayNew(1)> <cfset request.page.body = StructNew()> <cfset request.page.footers = ArrayNew(1)> <cfset request.site = StructNew()> <cfset request.site.cfMapping = ""> <cfset request.site.section = ""> <cfset request.site.subsection = "">

  15. Conclusion • The Application Object Model will assist tying many circuit applications together • More standardization makes for easier integration • Can have a forum at Fusebox.org to vote on components of the FOM

More Related