1 / 23

Fusebox 101

Fusebox 101. Brian Kotek INDUS Corporation. Goals for the next 45 Minutes. Crash course in Fusebox Concepts and definitions Discuss the XML configuration files Walk through a very simple Fusebox request A more complex example Quick Overview of FLiP Q & A. What is Fusebox?.

kacy
Download Presentation

Fusebox 101

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. Fusebox 101 Brian Kotek INDUS Corporation Brian Kotek

  2. Goals for the next 45 Minutes • Crash course in Fusebox • Concepts and definitions • Discuss the XML configuration files • Walk through a very simple Fusebox request • A more complex example • Quick Overview of FLiP • Q & A Brian Kotek

  3. What is Fusebox? • Fusebox is a framework for building web-based applications. • Free downloadable set of “core files” at fusebox.org that implement the framework. • Does a lot of the grunt work for you under the hood, so you can concentrate on creating maintainable applications that meet customer requirements. Brian Kotek

  4. Benefits of Fusebox • Code reuse • Team development • Easier maintenance • Easier testing • Separation of business logic from presentation • Vibrant community Brian Kotek

  5. Concepts and Definitions Brian Kotek

  6. Starting Small: The Fuse • A fuse is the basic building block of a Fusebox application. • A fuse is an individual code file. • 3 typical types: action, query, display. • Typically prefixed with “act”, “qry”, “dsp”. • Examples: qry_getNews.cfmdsp_news.cfm Brian Kotek

  7. The Fuseaction • Users call fuseactions not fuses. • A fuseaction is made up of one or more fuses. • Fuseaction “showNews” could run fuses qry_getNews.cfm and dsp_news.cfm. • Fuseactions can be requested by users via URL or form posts by passing a variable called fuseaction. Brian Kotek

  8. Circuits: Related Fuseactions • Circuits are logical associates of related fuseactions. • Circuits map to a directory. • Could have a “queries” circuit that holds fuseactions related to database queries. • Could have a “display” circuit that holds fuseactions related to outputting HTML. • Good circuits have internal consistency. • Good circuits are self-contained. Brian Kotek

  9. Circuit-Qualified Fuseactions circuit fuseaction news.showNews • A fuseaction with the format “news.showNews” is a “circuit-qualified fuseaction”. • “news” is the circuit being called. • “showNews” is the fuseaction within the circuit “news” that is being called. Brian Kotek

  10. Using Circuit-Qualified Fuseactions • URL: index.cfm?fuseaction=news.showNews • Form: <form action=“index.cfm” method=“post”><input type=“hidden” name=“fuseaction” value=“news.showNews”></form> Brian Kotek

  11. Key Concepts Reviewed • Fuse: an individual code file, written in CFML (or PHP script, etc.) • Fuseaction: executes one or more fuses to fulfill a specific requirement. • Circuit: logical group of fuseactions • Circuit-qualified fuseaction: news.shownews Brian Kotek

  12. The XML Configuration Files Brian Kotek

  13. Fusebox.xml • Central configuration file (1 per app). • Written in XML. • Define your circuits. • Set other application-level items like global fuseactions (run on every request automatically), plugins, etc. Brian Kotek

  14. Circuit.xml • 1 per circuit (an app may have many) • Define the fuseactions that the circuit is responsible for:<circuit> <fuseaction> … </fuseaction></circuit> • Within the fuseaction element, define what it does using XML verbs. Brian Kotek

  15. Primary XML Verbs • Fuseactions often include one or more fuses: <include template=“dsp_showNews.cfm”/> • Fuseactions can also call other fuseactions:<do action=“queries.getNews”/> Brian Kotek

  16. A Few More XML Verbs • <set>: sets a variable • <if>: performs true/false test • <loop>: runs a conditional loop • <relocate>: forwards user • Relatively basic, encourages you to perform complex logic in fuses. Brian Kotek

  17. Parsed Files • XML doesn’t do much on its own. • At runtime, the core files read the XML and generate parsed files. • The parsed files are actual code. • Typically one parsed file for each fuseaction that a user can call. Brian Kotek

  18. Fusebox Execution Timeline • User requests a circuit-qualified fuseaction. • Core file copies all FORM and URL variables into ATTRIBUTES scope. • Core file looks up target circuit. • Core file looks up fuseaction within target circuit. • Core file generates a parsed file from circuit XML. • Core file executes parsed file corresponding to the requested fuseaction. Brian Kotek

  19. Our First Fusebox Request Brian Kotek

  20. A Composite Layout Brian Kotek

  21. FLiP • Fusebox Lifecycle Process • Development methodology • Central tenant: “Users can’t tell you what they want until they see it.” • To client, the interface IS the application. Brian Kotek

  22. FLiP Stages • Wireframe (text-based skeleton) • Prototype (complete interface) • Signoff • Architecture (fusedocs, etc.) • Coding and Testing Brian Kotek

  23. Questions? Brian Kotek

More Related