|By Hal Helms||
|November 1, 2001 12:00 AM EST||
Someone once said that people should never see how laws or sausages are made. I think I can safely add technical standards to that list. There have been passionate arguments and some painful missteps along the way, but that's all eclipsed as people begin discovering the new power and ease-of-use in Fusebox 3.0.
What's New in Fusebox 3.0
Here's a rundown of some of the key features:
- A nested model for communication between circuits created to make reuse and distributed development easier
- A nested layout model that opens up possibilities for highly dynamic, flexible layouts
- XML-based Fusedoc providing both PDL (Program Definition Language) and documentation for fuses
- A stable set of key files that forms a Fusebox skeleton, making the learning process easier for people new to Fusebox and making it much easier to generate a new Fusebox application
- Exit fuseactions (XFAs) for greater reusability of fuses and circuits
- An API that exposes key variables within a Fusebox structure defined by the key Fusebox file
The core Fusebox files begin with an FBX_ prefix. A sample application is assumed with the circuit structure shown in Figure 1.
The component Fusebox files are:
This file is optional and is used to set variables that are needed by the application. Each circuit may have its own FBX_Settings.cfm file. If a fuseaction such as grandchild.main is resolved to home/parent/ child/grandchild.main, FBX_ Settings.cfm will be called in each directory in order. This allows you to set general variables at higher levels and override them, if needed, in child directories. This file replaces myGlobals.cfm, app_ Globals.cfm, and app_Locals.cfm.
Required in the home circuit, FBX_ Circuits.cfm maps circuit aliases to physical paths. In the sample application shown, the contents of FBX_Circuits.cfm are:
Fusebox.Circuits.home = 'Grandparent';
Fusebox.Circuits.parent = 'Grandparent/Parent';
Fusebox.Circuits.Child = 'Grandparent/Parent/Child';
Fusebox.Circuits.grandchild = 'Grandparent/Parent/Child/Grandchild';
The circuit alias is a key within a structure called Circuits, with the reserved structure Fusebox. The circuit alias doesn't have to be the same name as the physical directory, as shown by aliasing the top directory (Grandparent) as home. This allows for directories at different levels to have the same name.
This file is placed in every circuit that handles fuseactions; FBX_Switch.cfm is a <cfswitch> statement with <cfcase>s for every fuseaction the individual circuit is to handle.
Required in any circuit that implements a separate layout file, FBX_Layouts.cfm is responsible for setting the variables, Fusebox.layoutDir and Fusebox.layoutFile. The layout file pointed to in Fusebox.layoutFile must, at a minimum, output Fusebox.layout. Conditional processing is possible within FBX_Layouts.cfm. If, for example, a child sets a Boolean variable called QueryReturnedRecords, a parent might implement this simple logic in FBX_Layouts.cfm:
Used if the ColdFusion server version is below version 5.0, this file is the widely popular <cf_bodycontent> tag.
Of the files FBX_Fusebox30_CF50.cfm, FBX_Fusebox30_CF45.cfm, and FBX_Fusebox30_CF40.cfm, only one will be called in index.cfm, depending on which version of ColdFusion server is running. The index.cfm file should have this code in it:
<cfif Val(ListGetAt(Server.ColdFusion.ProductVersion, 1)) LT "5">
<cfif Val(ListGetAt(Server.ColdFusion.ProductVersion, 2)) is "5">
<cfinclude template="fbx_fusebox30 _CF45.cfm">
<cfinclude template="fbx_fusebox30_ CF40.cfm">
Note: If you create circuit applications, the only file that's absolutely required for a circuit that only runs beneath other circuits is the fbx_switch.cfm file. The other files are needed only if you have special settings to set and special layouts to handle. Circuits are defined only in the home circuit. Of course, you do have to supply your own fuseactions and fuses; we had to leave some of the work for you, after all!
In addition to the core Fusebox files, DefaultLayout.cfm is provided. This file simply outputs Fusebox.layout. This is a useful file when you don't care about a given circuit adding any layouts and simply want it to display the layout. Note, however, that while the fuseaction path must have one layout file, you don't need any files in circuits that don't have any special layout requirements. In the "family" application whose directory structure is shown in Figure 1, a request for grandchild.main might, for example, have layout handled in only one of the circuits involved. In such a case the other circuits wouldn't require an FBX_Layouts.cfm file nor the use of DefaultLayout.cfm.
Reserved Variables: The Fusebox 3.0 API
There are two complex variable structures. The first, the FB_ structure, is used for internal calculations by the FBX_Fusebox_CFxx.cfm file. You should neither read nor write to this structure since it will immediately render your code non-Fusebox 3.0-compliant and may well break your application.
The second reserved variable structure is the public "API" called Fusebox (see Table 1). Again, you shouldn't make any changes to this API. You'll find some variables within this structure very useful. You can use these public variables anywhere within your code, as any changes to the Fusebox standard will support these variables going forward, even if the underlying code that calculates these variables is modified.
Core Fusebox 3.0 Concepts
With the new terminology, API, and required files under our belts, let's turn our attention to the latest additions to the "core Fusebox" methodology that makes its appearance in Fusebox 3.0. These are exit fuseactions (XFAs), Fusedocs, and nested circuits.
XFAs address issues of severability and reuse; Fusedocs address code documentation, especially in a distributed developer environment; nested circuits address inheritance, layouts, and exception handling. Although these are largely separate concepts, they do weave into the overall Fusebox scheme and are absolutely essential toward realizing the advantages that Fusebox 3 can deliver.
Exit Fuseactions (XFAs)
The first of the new concepts for Fusebox 3.0 is exit fuseactions. XFAs are the identified exit points of a particular fuse. In Fusebox the meaning of an exit point is not "Where do we go next?" (we always go back to the fusebox!), but rather, "What fuseaction are we going to take upon our return to the fusebox?"
For example, take the case where a user fills out a form to win the $1 million we're giving away. The user begins by getting an exciting, unexpected e-mail from us (really, it's not spam!) on which appears a link (see Figure 2):
<a href="http://scamsRus.com/index.cfm? fuseaction=showContestForm">Click here to win a million dollars</a>
When the user submits that form, we want to store the information to a database while the user expectantly awaits a celebrity spokesperson's arrival with a substantial cashier's check. Regardless of what the spokesperson does, the form had only one possible way to return to the fusebox - by the user clicking the OK button. We might assign an exit fuseaction of "saveToDatabase" to that exit point, and represent it like this:
The problem with such a fuseaction is that it's a hard reference. To reuse the fuse - either in a new application or in a new context in the same application - I need to either change code or introduce conditional logic into the fuse. Neither path is optimal.
A much better way to handle our sample case is to identify the exit points of a fuse - those paths out of the fuse - and to assign variable names to them. The fuse then becomes completely independent of the application or context in which it operates, allowing it to be easily reused. The form code looks like this:
The value of XFA.submitForm is then set (by the architect) in the new FBX_ Switch.cfm file.
<cfset XFA.submitForm = "saveToDatabase">
Introducing XML Fusedocs
As programmers, we know that we should document our code, but we often create little or no documentation or, at best, documentation is done afterwards. At some firms documentation is taken much more seriously, but often the reason for that documentation is not conveyed. Without knowing why we should do something, how we should do it will never be clear. About the only thing that everyone seems to agree on is that documentation is something that's good for you, like castor oil. That was the old way.
Fusedoc is different. It's not about documenting your code; it's about coding your documentation. The Fusedoc process makes the application architect responsible for documenting the application before coding even starts. Fusedoc supplies all the information the coder needs to complete the fuse.
Fusedoc details exactly what the fuse is expected to do, and the variables and resources it uses and produces (inputs and outputs). It takes the form of a comment at the top of the fuse file.
<fusedoc fuse="fuse_name" version="2.0" language="ColdFusion">
fusedoc elements go hereŠ
In Fusebox 2.0, Fusedocs used a proprietary format that I developed. Starting with Fusebox 3.0, they're now XML-based. If you're familiar with XML, reading a Fusedoc is simple. If you're new to XML, you may find the Fusedoc to be a great confidence builder toward working more with XML.
We're trying to provide enough information so that a competent programmer, who knows nothing of the application nor of the underlying database, can write the code. It's sometimes referred to as programming by contract because the comments provided form a sort of "work order" that tells the coder exactly what to do. The "contract" promises the programmer, "You fulfill this work order and you will be done with the code. You have no responsibility beyond what the document tells you."
With Fusebox 3, Fusedoc goes from a proprietary symbology to the open standard of XML. There's a document type definition (DTD) available at www.halhelms.com that provides the formal specification for Fusedoc. To give you a taste of what one looks like, Listing 1 provides a complete Fusedoc for a fuse, act_ValidateLogin.cfm.
More information on Fusedocs and Fusebox 3.0 is available at www.halhelms. com.
Nesting Circuits and Layouts
In Fusebox 2, integration between separate fuseboxes consisted mainly of "tricks" for sending a browser from one insular fusebox to another. But the true goal is a "drag-and-drop" type of functionality, in which a fusebox consists of one of more circuits (a file directory), all of which can access each other without direct dependence on the underlying directory structure and that, when done, can be dragged-and-dropped to another fusebox, requiring only a few small settings to be changed to the definition of the circuits.
If this type of nesting is combined with some sort of a standard with respect to how a fusebox operates within its own framework, we're able to write large amounts of reusable code. If we continue to adhere strictly to a standard for doing that, like Fusebox 3.0, then people can write entire applications that can be stamped as "Fusebox 3.0-compliant" and then dropped into our own code, saving time and money.
Fusebox 3.0 has its own concept of inheritance that, while very different from object-oriented languages, allows children to inherit properties from their parent, grandparent, and so on. Each of these circuits can be "dragged-and-dropped" into a parent circuit, resembling those wooden Russian dolls in which one doll contains another one. This pattern continues for as long as the artistry of the maker can sustain itself. In Fusebox 3.0 the grandparent circuit may contain one or more parent circuits that may contain one or more child circuits, and so on.
Each circuit, from the top or home circuit and continuing down each intervening circuit to the target circuit, has a settings file called FBX_Settings.cfm. The more global an item in a settings file is, the "higher up" the circuits tree that item would be loaded. So if your application accesses a data source called customers, you may want to set Request.DSN in the home circuit.
Suppose you dropped in a shopping cart circuit that needs a products data source. It might set one as part of its own settings file since that DSN may only be needed by that circuit or one of its child circuits. Of course you, as the architect of your program, can determine whether you want to force it to have a certain value by using cfset or whether you want it to inherit a value from a higher-level circuit - if such a value has already been set - by using a cfparam. In earlier versions of Fusebox, you included the app_globals.cfm once and then used app_locals.cfm for all second-tier circuits. In Fusebox 3.0 there's no hard meaning to "global" or "local" - anything set in a circuit is available to all circuits nested beneath that circuit. Again, remember the Russian doll.
Fusebox automatically reads in any FBX_Settings.cfm files from all circuits in the fuseaction path. Once the target circuit is reached, FBX_Switch.cfm is called, executing the target fuseaction within that circuit. This concept has not changed from Fusebox 1.0.
The concept of nested layouts is a very exciting addition. Having walked "down" the fuseaction circuit tree and executed the fuseaction, Fusebox now walks "up" the tree from the bottom "target" circuit where the fuseaction was found, up through each parent circuit up to the home circuit. Each of those circuits, in order, will have the opportunity to apply its own layout as determined by the FBX_Layouts file, just as you might put a Russian doll back together - each of the larger dolls taking what they got from the smaller doll and wrapping their own wrapper around it. While you can make use of every circuit in the fuseaction path, you don't need to. Figure 3 is a teaching example that shows the use of layouts at each circuit in the fuseaction path.
Migrating from Fusebox 2 to Fusebox 3
The learning curve for FB3 has been made easy due primarily to the standardization of the underlying core Fusebox code combined with a standardization in the naming convention. For these same reasons your migration path from FB2 to FB3 will be fairly easy, especially after you've achieved your first application with the new standard.
What about some of the underlying files you've dealt with before? Well, app_locals.cfm and app_globals.cfm are now combined into a single file called FBX_Settings.cfm. Application.cfm is still not a required file since the functionality you might put there can be put into FBX_Settings.cfm as well.
If you were a fan of Steve Nelson's <cf_bodycontent> custom tag for "wrapping" layout with common design elements, that functionality is still there too. Now, though, you don't need a "header" and a "footer" file, rather you can define actual layout files that include both header and footer elements in a way that's fairly transparent. Again, the "frozen" core fusebox file will pick up your layout files as well.
In Fusebox 2, index.cfm (or the default document) had all the core functionality of Fusebox written into it. In Fusebox 3.0 a new file, FBX_Fusebox30_CFxx.cfm - where xx is a version that's appropriate for the version of the ColdFusion application server your machine is running - takes its place.
Circuits are a new idea for the standard, one that entirely replaces Fusebox 2's ad hoc "dot-dot-slash" method of making one fusebox talk to another. With Fusebox 2 a fuseaction usually had a verb-noun phrase syntax, such as addItem ToCart. In Fusebox 3, fuseactions are written with a circuit_ alias.fuseaction syntax. To solve the problem of circuits on different levels having the same name, an FBX_Circuits.cfm file has been introduced. It maps individual circuits to an alias of your choosing. Nesting/inheritance in Fusebox 3.0 is done for you automatically by the core fusebox file, FBX_Fusebox_CFxx.cfm, using the FBX_ Circuits.cfm file's mappings. Assume that we have an application with the circuit structure shown in Figure 4.
Assume that a fuse within the Granddaughter circuit executes this code:
The variable, self, is defined in the home circuit's FBX_ Settings.cfm as index.cfm (or default file) of the home circuit - Grandmother, in our case. In addition the variable XFA.continue is defined within FBX_Switch.cfm as Grandson.sayHello. All of this is under the control of the application architect.
All action returns to the home circuit's default file. This file includes the version of FBX_Fusebox30_CFxx.cfm that's appropriate for the ColdFusion server that's running. Within this file Fusebox translates the fuseaction, Grandson.sayHello, to the fuseaction path, in effect saying, "You said Grandson.sayHello, but I see from FBX_Circuits.cfm that what you really mean is Grandmother/Father/Son/Grandson.sayHello. Let me execute that for you." All that's required from you is that you properly map the circuits in FBX_Circuits.cfm, a very easy matter, and use the compound circuit_alias.fuseaction syntax.
Fusebox 3.0 represents a major landmark in the Fusebox community's approach to creating a methodology that consistently produces predictable success in Web application development, but it is just that - a landmark, a waystation in an ongoing journey. Fusebox began with ColdFusion and is being adopted by developers working in PHP, ASP, and JSP.
Where do we go from here? Much work remains to be done. With Fusebox 3.0 we've achieved a platform on which we can build even more firmly. In the coming months new work will begin on making ColdFusion even better. We hope that you'll be a part of this venture.
How can you be involved? First, join the Fusebox community officially by signing up at www.fusebox.org. Next, join the Fusebox mailing list; a signup form is available at www.halhelms.com. If you'd like to participate in making the future of Fusebox, sign up for the Fusebox steering mailing list by sending an e-mail to [email protected].
To learn more about being a contract "Fusecoder," check out Steve Nelson's Web site at www.secretagents.com. Lee Borkman is heading up an open-source effort to make wireframes even better; information is available at www.bjork.net. Jeff Peters has some wonderful tools available for Fusecoders at www.grokfusebox.com. John Quarto-vonTivadar has articles available at www.grokdotcom.com (free newsletter signup) and www.johnquarto.com. Finally, you may want to sign up for my free Occasional Newsletter at www.halhelms.com..
Alan Kay, the creator of the language Smalltalk, once said, "The best way to predict the future is to invent it." Let's get busy.
"Once customers get a year into their IoT deployments, they start to realize that they may have been shortsighted in the ways they built out their deployment and the key thing I see a lot of people looking at is - how can I take equipment data, pull it back in an IoT solution and show it in a dashboard," stated Dave McCarthy, Director of Products at Bsquare Corporation, in this SYS-CON.tv interview at @ThingsExpo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
Dec. 3, 2016 11:00 PM EST Reads: 949
The cloud promises new levels of agility and cost-savings for Big Data, data warehousing and analytics. But it’s challenging to understand all the options – from IaaS and PaaS to newer services like HaaS (Hadoop as a Service) and BDaaS (Big Data as a Service). In her session at @BigDataExpo at @ThingsExpo, Hannah Smalltree, a director at Cazena, provided an educational overview of emerging “as-a-service” options for Big Data in the cloud. This is critical background for IT and data professionals...
Dec. 3, 2016 11:00 PM EST Reads: 4,131
Fact is, enterprises have significant legacy voice infrastructure that’s costly to replace with pure IP solutions. How can we bring this analog infrastructure into our shiny new cloud applications? There are proven methods to bind both legacy voice applications and traditional PSTN audio into cloud-based applications and services at a carrier scale. Some of the most successful implementations leverage WebRTC, WebSockets, SIP and other open source technologies. In his session at @ThingsExpo, Da...
Dec. 3, 2016 09:30 PM EST Reads: 1,599
As data explodes in quantity, importance and from new sources, the need for managing and protecting data residing across physical, virtual, and cloud environments grow with it. Managing data includes protecting it, indexing and classifying it for true, long-term management, compliance and E-Discovery. Commvault can ensure this with a single pane of glass solution – whether in a private cloud, a Service Provider delivered public cloud or a hybrid cloud environment – across the heterogeneous enter...
Dec. 3, 2016 06:15 PM EST Reads: 1,513
"IoT is going to be a huge industry with a lot of value for end users, for industries, for consumers, for manufacturers. How can we use cloud to effectively manage IoT applications," stated Ian Khan, Innovation & Marketing Manager at Solgeniakhela, in this SYS-CON.tv interview at @ThingsExpo, held November 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA.
Dec. 3, 2016 05:30 PM EST Reads: 4,045
Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more business becomes digital the more stakeholders are interested in this data including how it relates to business. Some of these people have never used a monitoring tool before. They have a question on their mind like “How is my application doing” but no id...
Dec. 3, 2016 05:15 PM EST Reads: 2,138
@GonzalezCarmen has been ranked the Number One Influencer and @ThingsExpo has been named the Number One Brand in the “M2M 2016: Top 100 Influencers and Brands” by Onalytica. Onalytica analyzed tweets over the last 6 months mentioning the keywords M2M OR “Machine to Machine.” They then identified the top 100 most influential brands and individuals leading the discussion on Twitter.
Dec. 3, 2016 05:15 PM EST Reads: 2,001
Information technology is an industry that has always experienced change, and the dramatic change sweeping across the industry today could not be truthfully described as the first time we've seen such widespread change impacting customer investments. However, the rate of the change, and the potential outcomes from today's digital transformation has the distinct potential to separate the industry into two camps: Organizations that see the change coming, embrace it, and successful leverage it; and...
Dec. 3, 2016 03:15 PM EST Reads: 3,225
The Internet of Things (IoT) promises to simplify and streamline our lives by automating routine tasks that distract us from our goals. This promise is based on the ubiquitous deployment of smart, connected devices that link everything from industrial control systems to automobiles to refrigerators. Unfortunately, comparatively few of the devices currently deployed have been developed with an eye toward security, and as the DDoS attacks of late October 2016 have demonstrated, this oversight can ...
Dec. 3, 2016 02:45 PM EST Reads: 715
Extracting business value from Internet of Things (IoT) data doesn’t happen overnight. There are several requirements that must be satisfied, including IoT device enablement, data analysis, real-time detection of complex events and automated orchestration of actions. Unfortunately, too many companies fall short in achieving their business goals by implementing incomplete solutions or not focusing on tangible use cases. In his general session at @ThingsExpo, Dave McCarthy, Director of Products...
Dec. 3, 2016 02:45 PM EST Reads: 529
Machine Learning helps make complex systems more efficient. By applying advanced Machine Learning techniques such as Cognitive Fingerprinting, wind project operators can utilize these tools to learn from collected data, detect regular patterns, and optimize their own operations. In his session at 18th Cloud Expo, Stuart Gillen, Director of Business Development at SparkCognition, discussed how research has demonstrated the value of Machine Learning in delivering next generation analytics to impr...
Dec. 3, 2016 02:15 PM EST Reads: 6,957
More and more brands have jumped on the IoT bandwagon. We have an excess of wearables – activity trackers, smartwatches, smart glasses and sneakers, and more that track seemingly endless datapoints. However, most consumers have no idea what “IoT” means. Creating more wearables that track data shouldn't be the aim of brands; delivering meaningful, tangible relevance to their users should be. We're in a period in which the IoT pendulum is still swinging. Initially, it swung toward "smart for smar...
Dec. 3, 2016 02:00 PM EST Reads: 483
20th Cloud Expo, taking place June 6-8, 2017, at the Javits Center in New York City, NY, will feature technical sessions from a rock star conference faculty and the leading industry players in the world. Cloud computing is now being embraced by a majority of enterprises of all sizes. Yesterday's debate about public vs. private has transformed into the reality of hybrid cloud: a recent survey shows that 74% of enterprises have a hybrid cloud strategy.
Dec. 3, 2016 01:30 PM EST Reads: 2,131
Businesses and business units of all sizes can benefit from cloud computing, but many don't want the cost, performance and security concerns of public cloud nor the complexity of building their own private clouds. Today, some cloud vendors are using artificial intelligence (AI) to simplify cloud deployment and management. In his session at 20th Cloud Expo, Ajay Gulati, Co-founder and CEO of ZeroStack, will discuss how AI can simplify cloud operations. He will cover the following topics: why clou...
Dec. 3, 2016 01:15 PM EST Reads: 634
Internet of @ThingsExpo, taking place June 6-8, 2017 at the Javits Center in New York City, New York, is co-located with the 20th International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world. @ThingsExpo New York Call for Papers is now open.
Dec. 3, 2016 01:00 PM EST Reads: 1,876
"ReadyTalk is an audio and web video conferencing provider. We've really come to embrace WebRTC as the platform for our future of technology," explained Dan Cunningham, CTO of ReadyTalk, in this SYS-CON.tv interview at WebRTC Summit at 19th Cloud Expo, held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA.
Dec. 3, 2016 01:00 PM EST Reads: 331
Successful digital transformation requires new organizational competencies and capabilities. Research tells us that the biggest impediment to successful transformation is human; consequently, the biggest enabler is a properly skilled and empowered workforce. In the digital age, new individual and collective competencies are required. In his session at 19th Cloud Expo, Bob Newhouse, CEO and founder of Agilitiv, drew together recent research and lessons learned from emerging and established compa...
Dec. 3, 2016 12:45 PM EST Reads: 741
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the business value. In his session at Cloud Expo, Ed Featherston, a director and senior enterprise architect at Collaborative Consulting, discussed the key considerations around quality, volume, timeliness, and pedigree that must be dealt with in order to properly fuel that engine.
Dec. 3, 2016 12:45 PM EST Reads: 1,956
Everyone knows that truly innovative companies learn as they go along, pushing boundaries in response to market changes and demands. What's more of a mystery is how to balance innovation on a fresh platform built from scratch with the legacy tech stack, product suite and customers that continue to serve as the business' foundation. In his General Session at 19th Cloud Expo, Michael Chambliss, Head of Engineering at ReadyTalk, discussed why and how ReadyTalk diverted from healthy revenue and mor...
Dec. 3, 2016 12:15 PM EST Reads: 1,512
We are always online. We access our data, our finances, work, and various services on the Internet. But we live in a congested world of information in which the roads were built two decades ago. The quest for better, faster Internet routing has been around for a decade, but nobody solved this problem. We’ve seen band-aid approaches like CDNs that attack a niche's slice of static content part of the Internet, but that’s it. It does not address the dynamic services-based Internet of today. It does...
Dec. 3, 2016 11:30 AM EST Reads: 857