Download presentation
Presentation is loading. Please wait.
Published byWillis Russell Modified over 9 years ago
1
©2003 TeraTech, Inc Fusebox 4 Michael Smith, TeraTech, Inc. michael@teratech.com http://www.teratech.com 301-881-1440 x110 Copyright TeraTech 2003
2
©2003 TeraTech, Inc Overview What is Fusebox What is Fusebox 4? How Fusebox works Circuit syntax Fuseactions Layouts and Content variables Extending Fusebox 4 with plugins
3
©2003 TeraTech, Inc Speaker Information Who am I? Michael Smith President of TeraTech, Inc Rockville MD >http://www.teratech.com/ >ttWebReportServer, CFXGraphicserver MDCFUG, CFUN-03, Fusebox Conf Articles in CFDJ, Fusion Authority Winner CFDJ award Best CF Consulting
4
©2003 TeraTech, Inc More About Me 22 years programming 7 years with ColdFusion 4 years with Fusebox Also work with SQL, JavaScript, HTML, VB, Oracle, Access Teach one-on-one and custom classes On site and custom development Fusebox and Process Methodology
5
©2003 TeraTech, Inc What is Fusebox? Way to organize code and files A methodology for programming A core file that supports the above A non-profit organization (fusebox.org) that coordinates the above
6
©2003 TeraTech, Inc Benefits of Standardization Better team communication Cheaper maintenance Can pick up others code faster Fewer bugs due to different styles Can think about the fun stuff instead of code structure
7
©2003 TeraTech, Inc Why Fusebox? Fusebox began and continues to be guided by a developer community concerned with making their projects more successful, their clients happier, and their own work less frustrating and more rewarding.
8
©2003 TeraTech, Inc What makes Fusebox 3 Routes via index.cfm?fuseaction=c.fa Separate HTML, SQL, CF in fuses Central switch for control Nested Circuits Nested Layouts Compound Fuseactions Exit Fuseactions (XFA’s) XML Fusedocs
9
©2003 TeraTech, Inc Fusebox Project Life Cycle Wireframe HTML Prototype Prototype + Devnotes Final Code + Devnotes Sign off
10
©2003 TeraTech, Inc Fusebox 3 Core Concepts Fusebox 3 core concepts >all actions of the software occur as a response to a request made of the fusebox >code is encapsulated in circuits >circuits are made to be as independent of each other as possible (new requests return to the fusebox rather than being routed directly to another circuit) >fuses are based on "pipes and filters" where the output of one file becomes the input of the other, allowing for ease of reuse
11
©2003 TeraTech, Inc New capabilities in Fusebox 4 Fusebox 4 makes development even easier >XML configuration files provide language independence >multiple fuseactions in a single HTTP request allows for more flexible design patterns such as MVC >pre-parsing of files means better performance >layout files lose their minority status—simply another fuse >the tag can now be used >plugins let developers modify functionality without editing the core files >content component variables allow developer to break page into multiple component blocks
12
©2003 TeraTech, Inc What about CFCs? Nothing in Fusebox 4 prohibits the use of CFCs, but they are not required Fusebox MX addresses the issue of object oriented programming with CFCs
13
©2003 TeraTech, Inc Fusebox terminology : fuseaction A fuseaction is the request made of a Fusebox application >
14
©2003 TeraTech, Inc Compound Fuseactions A request made of the server to perform some action is known as a fuseaction. Fuseactions are made up of the circuit name, a dot separator, and the actual request. >Cart.addItem >Users.login >Scheduler.requestMeeting >Noun.verb
15
©2003 TeraTech, Inc Fusebox terminology : circuit A circuit is a logical grouping of related fuseactions >www.teratech.com/index.cfm?fuseaction=Training.details >www.teratech.com/index.cfm?fuseaction=Training.register >www.teratech.com/index.cfm?fuseaction=Training.confirm
16
©2003 TeraTech, Inc Fusebox terminology : fuse A fuse is an individual code file used either singly or in combination with other fuses to carry out a fuseaction FB4 FB3
17
©2003 TeraTech, Inc The Fuse Rules Length Challenged Reuseable Standard Prefix: qry_, dsp_, act_ Prefix Rebels HTML, SQL or CF only Contains Fusedocs Clueless – blackbox – no includes Check inputs Good Name – no abv Name recordset after fuse name qry_FuseName
18
©2003 TeraTech, Inc Fusebox processing Index.cfm calls FB core file with circuit and fuseaction from URL or Form variables. FB core parses circuit names from fusebox.xml.cfm FB core parses correct circuit.xml.cfm and fuseaction from circuit.xml.cfm >Select fuses or fuseactions to execute from circuit.xml >Repeat for rest of Fuse Queue >Save to compiled CFM >Run the CFM At certain point in core processing plugins may be added
19
©2003 TeraTech, Inc A sample page viewed by a user…
20
©2003 TeraTech, Inc …is seen as a collection of requests made of the Fusebox application… Company.getCurrentStockPrice Employment.newestJobs Training.upcomingEvents Benefits.notes
21
©2003 TeraTech, Inc Fusebox 4 demonstration The code used in this demonstration is available at beta.fusebox.org
22
©2003 TeraTech, Inc New features Plugins let you change how FB core behaves Better for MVC – run fuse built in Compiled – faster FBX config files now in XML format
23
©2003 TeraTech, Inc Fusebox.xml.cfm This XML file configures your Fusebox application Circuit definitions and locations and parents Global fuseactions Plugin phases In app root directory Replaces fbx_circuits.cfm Uses.cfm file extension to prevent hackers from browsing and to allow editing in CF Studio (VTML helpers available)
24
©2003 TeraTech, Inc Defining Circuits FB3 FB4
25
©2003 TeraTech, Inc Fusebox Parameters
26
©2003 TeraTech, Inc More parameters
27
©2003 TeraTech, Inc Global fuseactions Can run fuseactions at the beginning or end of every page request Used for header and footers
28
©2003 TeraTech, Inc Plugins Let you change what happens in the core without having to edit its code >preProcess: called once, at the beginning of the request processing >preFuseaction: called once per fuseaction, prior to the invocation of any fuseaction >postFuseaction: called once per fuseaction, after the invocation of any fuseaction >fuseactionException: called once per fuseaction, if any exception was thrown during that fuseaction >postProcess: called once, at the end of the request processing >processError: called once, if any error was thrown during the request processing
29
©2003 TeraTech, Inc Circuit.xml.cfm Replaces fbx_switch.cfm and fbx_layout.cfm Contains fuseactions and fuses to call May also contain logic Content Variables Uses XML FB language format similar to CFML without the CF on the front of each tag Parsed by FB4 compiler into CFML.
30
©2003 TeraTech, Inc Circuit syntax Including a fuse: Calling another fuseaction:
31
©2003 TeraTech, Inc In FB 3 that would have been: Including a fuse: Calling another fuseaction:
32
©2003 TeraTech, Inc XFAs Exit FuseActions are variables to avoid hardcoding exit points in your code In the circuit.xml.cfm you can use
33
©2003 TeraTech, Inc Content Component Variables Create by “do action”ing a fuseaction Result is streamed into the variable for later output Uses CFSAVECONTENT tag Output variables in layout file – good for portal applications. Note: fusebox.layout variable is no longer automatically created
34
©2003 TeraTech, Inc Layout Example Layouts are no longer special cases, but just regular fuses.
35
©2003 TeraTech, Inc Final thoughts Why use Fusebox? >easier to develop applications >easier to maintain existing code >aids in code repurposing >standard for web application development >supports teams of diverse talents and skills >provides a standardized documentation >exceptionally helpful community of developers >cross-language >helps ordinary developers achieve extraordinary results
36
©2003 TeraTech, Inc Why not? Why not use Fusebox? >you're being paid by your competitor to sabotage your company's development efforts >framework? you don't need no stinkin' framework >you have a strong masochistic streak that enjoys the pain of your current software development process >you made a decision against Fusebox early on and haven't bothered to reevaluate it >call you crazy, but you just like to code by the seat of your pants!
37
©2003 TeraTech, Inc How about a Fusebox book? Discovering Fusebox 4 by John Quarto- vonTivadar with Sandra Clark, Brian Leroux and Perry Woodin Consise coverage of Fusebox 4 framework www.techspedition.com www.techspedition.com Out by September 4
38
©2003 TeraTech, Inc How to get Fusebox 4 Currently FB 4 in beta Free download from beta.fusebox.org Requires ColdFusion MX CF 5 version in the works (uses XML parsing add on).
39
©2003 TeraTech, Inc Questions michael@teratech.com
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.