Fusebox Application Object Model - PowerPoint PPT Presentation

About This Presentation
Title:

Fusebox Application Object Model

Description:

Break your massively complex site ('Home' application) into many sub ... Using DHTML, you can change any value in the DOM. Javascript DOM Example: html head ... – PowerPoint PPT presentation

Number of Views:47
Avg rating:3.0/5.0
Slides: 16
Provided by: steven102
Category:

less

Transcript and Presenter's Notes

Title: Fusebox Application Object Model


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 companys
    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
lthtmlgt ltheadgt lttitlegtUntitledlt/titlegt
ltscript language"JavaScript"gt // through the
DOM, we can change the values of myspan
function change() document.all.myspan.innerHTM
L 'The text has changed' function
changeback() document.all.myspan.innerHTML
'Now it has changed back!'
lt/scriptgt lt/headgt ltbodygt ltspan id"myspan
onmouseover"change()" onmouseout"changeback()"
gt We'll change this text. lt/spangt lt/bodygt lt/htmlgt

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
  • ltcfset usersStructNew()gt
  • ltcfset users.user_132StructNew()gt
  • ltcfset users.user_132.first_nameGabegt
  • 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
ltcfset request.page StructNew()gt ltcfset
request.page.js StructNew()gt ltcfset
request.page.js.scriptfiles ArrayNew(1)gt ltcfset
request.page.js.onLoad ArrayNew(1)gt ltcfset
request.page.js.onunLoad ArrayNew(1)gt ltcfset
request.page.display truegt ltcfset
request.page.title "eTesters"gt ltcfset
request.page.cssFiles ArrayNew(1)gt ltcfset
request.page.nocache "true"gt ltcfset
request.page.head ""gt ltcfset request.page.HTML
""gt ltcfset request.page.headers
ArrayNew(1)gt ltcfset request.page.body
StructNew()gt ltcfset request.page.footers
ArrayNew(1)gt ltcfset request.site
StructNew()gt ltcfset request.site.cfMapping
""gt ltcfset request.site.section ""gt ltcfset
request.site.subsection ""gt
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
Write a Comment
User Comments (0)
About PowerShow.com