Title: XFB
1XFB
- There's a fine line between genius and insanity.
I have erased this line.Oscar Levant -
2Origins of XFB
- XFB (Extended Fusebox) grew out of a desire to
tip the scale of project success. - XFB combines technical innovations (XFAs, query
sims, nested circuits, nested layouts, integrated
security, etc.) with project management features.
370 Failure
4Time Expended
Nike Method
Design
Testing
Delivery
Coding
Architecture
Requirements
www.halhelms.com
5Time Expended
Extended Fusebox Method
Coding
Testing
Delivery
Architecture
Requirements/Design
www.halhelms.com
6Main Points of XFB
- Project Management
- wireframes
- prototypes
- devnotes
- Technical
- xfas
- fusedocs
- nested circuits
- nested layouts
- query sims
- security
- assertions
7Wireframe
8Wireframe
- Wireframes provide a "booster rocket" to help us
escape the gravitational pull of our prejudices
and assumptions about what clients want.
9Wireframe
- The wireframe is a skeleton-model of an
application. - It is meant to help clients and developers
discuss what an application should do.
10Wireframe
11Wireframe
12Wireframe
- Download available at www.bjork.net
13Prototype w/DevNotes
14Why a prototype?
- "Requirements gathering" doesn't work
- The Musee d'Orsay in Paris wants to hire you to
reproduce a famous painting Arrangement in Black
and Grey No. 1 - Specification "The work shall be oil on canvas,
56-1/4" x 63-1/4"..."
15Is this what they want?
16Is this what they want?
17Is this what they want?
18Is this what they want?
19Is this what they want?
20THIS is what they want!
21Why the prototype?
- Clients can only tell you what they want after
they see it
22What is the prototype?
23Leaving no "wiggle room"
The prototype
The deployed application
24An iterative process
- The wireframe forms the basis for the first cut
of the prototype - Prototypes have minimal codeand are often best
handled by non-programmers - The prototype is refined through interaction with
client and developer using DevNotes
25What is DevNotes?
- DevNotes is a simple, threaded message system
that sits below each individual prototype page. - All issues related to the application are
recorded as DevNotes
26What are DevNotes used for?
- Client direction "Move the buttons to the
left/Make the blue a little more like cornflower
and less like slate" - Developer questions "Where will the product
information come from?/Is there an existing
database or file with authorized users?" - Client answers "I think the IT people have a
spreadsheet or something with users."
27What are DevNotes used for?
- Developer self-notes "Use JavaScript for client
processing of this procedure"
28Prototype freeze
- We are done with the prototype when both client
and developer are confident that - all questions regarding functionality have been
resolved - all content has been received from client
- graphical interface/look and feel has been
approved - any changes occurring after this point will
either become a new release or will be
exorbitantly expensive
29Fusebox architecture
30Unplanned program flow
Module F
Module E
Module B
Module C
Module A
Module D
31Architected program flow
Module E
Module F
Module C
Module A
Module B
Module D
32A Fusebox request
validateLogin
the fuseaction
loginUser
Fusebox
qryValidateLogin.cfm
validateLogin
actValidateLogin.cfm
newUser
fuses
the fusebox
fuseactions
33Fuses always make requests of the fusebox
ltform actionindex.cfm methodpostgt ltinput
typehidden namefuseaction valuevali
dateUsergt ltinput typetext nameusernamegt lt
input typepassword namepasswordgt ltinput
typesubmitgt lt/formgt
Fusebox
a fuse
the fusebox
34The fusebox copies all URL and form variables
into attributes scope
ltcf_FormURL2Attributesgt
url.productID 1027 form.lastName Helms
attributes.productID 1027 attributes.lastName
Helms
35The fusebox
ltcfswitch expression attributes.fuseactiongt
ltcfcase valueloginUsergt ltcfinclude
templatedspLoginUser.cfmgt lt/cfcasegt ltcfcas
e valuevalidateLogingt ltcfinclude
templateqryValidateLogin.cfmgt ltcfinclude
templateactValidateLogin.cfmgt lt/cfcasegt lt/cfs
witchgt
The fusebox
36Fuseactions
- The fuseaction is the motivating force in an
application. - Suggestion use name is form of verbNounPhrase
such as - addItemToCart
- getUserInfo
- showProductInfo
37The fusebox
ltcfswitch expression attributes.fuseactiongt
ltcfcase valuedoSomethinggt ltcfinclude
templateaFuse.cfmgt lt/cfcasegt . ltcfcase
valuedoSomethingElsegt ltcfmodule
templateanotherFuse.cfmgt lt/cfcasegt lt/cfswitch
gt
The fusebox
38Including a fuse
The fuseaction
doSomething
ltcfswitch expression attributes.fuseactiongt
ltcfcase valuedoSomethinggt ltcfinclude
templateaFuse.cfmgt lt/cfcasegt . ltcfcase
valuedoSomethingElsegt ltcfmodule
templateanotherFuse.cfmgt lt/cfcasegt lt/cfswitch
gt
yetAnotherFuse.cfm
The fuses
The fusebox
39Nested circuits
40Benefits of nested circuits
- More and easier code reuse
- Independent, concurrent development of code
modules - Descendant modules inherit variables from parents
- Variables from parents are inherited by children
- Layout files can be nested
- Exceptions bubble upwards
41XFB nested circuits
42Conflicting circuit names
43Resolving circuit naming conflicts
- Create a Circuits.cfm file
- Alias name conflicts
bpcf/completed/circuits.cfm
44FB3 nested circuits
- Fusebox 2 worked with the concept of a federation
of circuits,each having to know of the existence
of each other - Fusebox 3 works with the concept of
interchangeable circuits that can be reused in
different applications
45Inheritance
ltcfset dsn "OurApplication"gt
ltcfquery datasourcedsngt
46Bubbling exceptions
- Lets architect determine where certain exception
types will be handled - Lets coder write fuses without worrying about
handling certain classes of exceptions
47Example Bubbling exceptions
lt!-- index.cfm --gt ltcftrygt ltcfcatch
typeUserAlertgt ltscriptgt alert( lt/scriptgt
lt/cfcatchgt lt/cftrygt
lt!-- index.cfm --gt
lt!-- aFuse.cfm --gt ltcftrygt ltcfinclude
templatemyPage.cfmgt ltcfcatchgt
ltcf_LogException messagecfcatch.messagegt lt
cfthrow typeUserAlertgt lt/cfcatchgt lt/cftrygt
48XFAs
49XFAs
- A typical Fusebox 2 page has fuseactions
hardcoded in place. - Examples
- ltform action"index.cfm?fuseactionupdateProductIn
fo"gt - lta href"index.cfm?fuseactionshowUserMenu"gt
- ltcflocation url"index.cfm?fuseactionshowMainPage
"gt
50XFAs
- XFAs are variables that lets fuseactions be
resolved at run time - Examples
- ltform action"index.cfm?fuseactionXFA.submitForm
"gt - lta href"index.cfm?fuseactionXFA.next"gt
- ltcflocation url"index.cfm?fuseactionXFA.home"gt
51Identifying XFAs
- Mark up the prototype for any exit points any
point at which the user or the system can make
another fuseaction request
52Identifying XFAs
53Assigning values to XFAs
- Login XFA.submitForm ? validateUserLogin
- Login Validation XFA.success ? showMainCatalogPage
- Product Detail XFA.buyItem ? addItemToCart
- Cart XFA.adjust quantities ? adjustCartQuantities
- Cart XFA.removeItem ? removeItemFromCart
- Registered User XFA.editInfo ? editUserInfo
- Registered User XFA.saveInfoUpdate ? saveUser
- Admin Page XFA.newUser ? newUser
Identifying common nouns
54Identifying circuit and fuseaction
55Identifying needed fuses
56Fusedoc
57Fusedocs
- Provide documentation/PDL (program design
language) for each fuse - Tells coder what they need to know to write a
fuse without knowledge of the application - XML-based with DTD for validation
58Nested layouts
59ltcf_bodycontentgt tag
- Used to capture the output of code and save as a
request-scoped variable - Replaced in ColdFusion release 5 with
ltcfsavecontentgt
60Example ltcf_bodycontentgt
ltcf_bodyContent name"me"gt ltcfset reverseColor
RandRange( 0, 1 )gt lttable border"2"gt lttrgt
lttdgtI am the left sidelt/tdgt lttdgtI am
the right sidelt/tdgt lt/trgt
lt/tablegt lt/cf_bodyContentgt ltcfinclude
template"layout.cfm"gt
61Example ltcf_bodycontentgt
ltcfoutputgt ltcfset thebg "white"gt ltcfset thefg
"black"gt ltcfif reversecolorgt ltcfset thebg
"black"gt ltcfset thefg "white"gt lt/cfifgt ltstylegt
td background-color thebg color thefg
lt/stylegt ltpgtrequest.melt/pgt lt/cfoutputgt
XMLSpy/FD4 validateLogin.cfm
62Nested layouts
Parent
Child
GrandChild
UKDAXF/SampleFB3/
63Post-processing decision making
- Because the child is returned to the parent as a
variable (rather than simply output onto the
screen), the parent can make decisions based on
the results of the child's processing
64Implementing nested layouts
- Wrap the code in index.cfm with ltcfsavecontentgt
(version 5) or ltcf_bodycontentgt (version 4) using
the circuit's alias as the name of the variable - (Illustration next)
65Implementing nested layouts
- ltcfsavecontent variable"Users"gt
-
- ltcfinclude template"app_locals.cfm"gt
- lt!--- Peel off the first layer and determine
whether to delegate the fuseaction. ---gt - ltcfif ListLen( attributes.fuseaction, '.' ) GT 1gt
- ltcfinclude template"ListFirst(
attributes.fuseaction, '.' )/index.cfm"gt - ltcfelsegt
- lt!--- I'm going to get one (and only one)
fuseaction at a time. Fuseactions - correspond to methods or messages in OO
languages. ---gt - ltcfswitch expression "attributes.fuseaction
"gt - ltcfcase value"home"gt
- ltcfinclude template"UserInfo.cfm"gt
- lt/cfcasegt
- ltcfdefaultcasegt
- ltcfoutputgt
- I am the GetDirectoryFromPath(
GetCurrentTemplatePath()) fusebox and I received
a fuseaction called ltBgtltFONT COLOR"000066"gt - "attributes.fuseaction"lt/FONTgtlt/Bgt that I don't
have a handler for. - lt/cfoutputgt
- lt/cfdefaultcasegt
66Implementing nested layouts
- If the child is to display something, call the
layout file after the ltcfsavecontentgt tag - ltcfinclude template"dsp_layout32a.cfm"gt
67Query sims
68Query sims
- Provides a simulated query to work with code
- Allows code architecture to be done before all
database decisions have been finalized - Provides instruction to SQL coders on what
information is needed - Lets architect determine data variable names
test/QSimSample
69Test harnesses
- Provides an easy-to-implement way of unit-testing
fuses - Should accompany all completed fuses
70Example test harness
ltcfset selfTestMe.cfmgt ltcfset XFA.submitForm
gt ltcfset XFA.cancelForm gt ltcfset
attributes.userID 101gt ltcfinclude
templatedspEditUser.cfmgt
71Proving the concept
- We all agree that your theory is crazy, but is
it crazy enough?Niels Bohr
72(No Transcript)