Publishers of technology books, eBooks, and videos for creative people

Home > Articles

This chapter is from the book

Basic Fusebox Concepts

Fusebox borrows many of its essential concepts from other systems. First, Fusebox is a way to organize program code. Second, Fusebox is a way to manage growing applications by organizing the application directories in a hierarchy. Third, and perhaps most fundamentally, Fusebox is a way to think about applications and the art of building them. Comparisons have been drawn between the Fusebox controller file and computer networks. Now let's discuss each of these essential concepts in more detail.

A Way to Arrange Code

A great deal of thought has gone into the idea of organizing applications into some kind of logical framework. Code organization schemes are as old as computers. Back when computers used punch cards, programmers kept routines in tidy order. If you got a card out of sequence, your program did not function properly. And heaven forbid you drop a box of cards on the way to the computer! More discussions of code organization choices appear in Chapter 14, "Construction and Coding," such as the popular Model-View-Controller (MVC) framework.

The easiest concept to observe about Fusebox is the impact it has on your application's code—where you store files and how you arrange your directories. The Fusebox specification defines how to arrange your program's code into easy-to-manage chunks. What is the big deal with organized code?

Although many people quickly recognize the value of using a standard approach to arrange code, some of the benefits are often overlooked.

ColdFusion has been an incredibly successful language primarily due to its low entry threshold. That is, ColdFusion does not require a great deal of study and knowledge of programming to get started.

Because so many people who have had no formal background in programming or application development get involved in developing ColdFusion applications, a great deal of ColdFusion code is disorganized or poorly written. Sure, it does the job, but unfortunately, ColdFusion's reputation has unfairly suffered as a result. Instead of recognizing that ColdFusion accommodated an amazingly wide spectrum of experience from complete novice to application guru, rumormongers proclaimed that ColdFusion could not scale well.

Scaling means that a completed application will be able to successfully handle workloads larger than those for which it was originally designed. In the case of web applications, it usually translates to a large increase in the number of page requests or simultaneous users that the system handles.

Database issues aside, when an application is poorly designed and constructed, it is generally not able to scale very well. Program logic that works well for one or two users might overstress the server when several hundred users all try to use it at once. Many ColdFusion applications are poorly designed and constructed, simply because their creators never considered the issues involved in effective application design.

However, ColdFusion's reputation as a small-scale application server is not deserved, and indeed has been greatly reduced in recent years. Projects such as RoomsToGo.com (the largest retailer of furniture online) and Autobytel.com (one of the largest car sales sites) have proven that ColdFusion can scale effectively when the application is properly conceived and executed. Both of these high-volume sites are not only ColdFusion efforts, but they also both use Fusebox as their architecture.

Note

Still quite Fusebox, you may notice that AutoByTel.com uses ?action= rather than the familiar ?fuseaction= in the URL.

A Way to Manage Growing Applications

The responsibilities of a manager can be defined by a constant struggle to determine when a project will be completed and how much it will cost. If, as a manager, you do not have a good idea of how the application's code is organized, then the uncertainty factor rises rapidly. Fusebox project managers can use this framework again and again, regardless of the size of the project, which aids in code reuse. For example, you might have written a report for accounting last week. This week, you can literally copy and paste it into the whole intranet without changing a thing.

Using Fusebox is good for project managers, but Fusebox also mimics the way managers work. If you have ever managed a project, you know that most of your time is spent coordinating the efforts of others. Managers do not tend to produce much, but they encourage and allow those underneath them to produce more, better, faster. They are skilled at assigning tasks, which helps manage a project's size. A comparison of Fusebox and corporate managers reveals that they share some of the same methods for getting work done. Fusebox encourages code to be highly specialized and focused. The structure helps to control all the smaller pieces. The controller files excel at delegating tasks.

If you are a reader of the Dilbert comic strip, you are quite familiar with the Pointy-Haired Boss (PHB), the epitome of a manager without a clue. Dilbert is funny because we can relate to the title character; most of us have worked for a PHB at one time or another. Consequently, it might be hard to imagine corporate managers as a model for solving a problem, but there is a reason that management hierarchy rules the structure of companies today.

People can only process so much information in any given day. Using a flat organization (where managers are nonexistent and everyone is an equal), every member of the group must communicate his ideas and information to every other member of the group on a regular basis. Obviously, this is inefficient and can easily grow to the point where everyone spends all his time involved in communication, with no time left to actually get work done.

ColdFusion applications that lack a real structure act similarly. Every page can link to every other page. In fact, every page must link to every other page to get something done. If you add a page, all the other pages must be updated. Every page must be aware of every other page in the system.

This is where the manager comes in. Sacrifice one person's ability to directly produce but give that person the role of facilitating communication, and everyone else gets more done. By filtering out all the other stuff that goes around other parts of the organization, team members can focus on the skills for which they were hired in the first place.

The manager can see the "big picture" of the organization—what projects are currently underway, what areas of uncertainty lie ahead, and what teams need resources to complete their job. A good manager is a master delegator. If a manager goes "into the trenches" to produce and directly contribute, communication suffers and projects slow down.

PHBs notwithstanding, by organizing and regulating the flow of information between teams, managers streamline business. Fusebox's controller file duplicates the purpose of a manager by passing requests off to focused portions of the application. If an employee needs to arrange a meeting with another department to complete a project, the manager knows whom to contact and facilitates the communication. Similarly, if a web site user wants to see a list of all products on sale, the Fusebox controller knows which files accomplish that task.

A Way to Think About Applications

When you sit down to work with an application, do you have a mental concept of it in your head? What does it look like in your mind's eye? Can you fit it all into your head at once? Do you think of the application's code as being organized in a particular way, or does it all just sort of run together in a big jumble?

Part of the problem of working with unorganized code is just trying to envision the application. Without a defined model, the picture that forms tends to be abstract. It is hard to imagine what happens when a particular template runs, how information is passed from one template to another, and what a change in one template does to another template. You might tend to think in terms of web servers and page requests or maybe streams of ones and zeros flying around if you understand that kind of thing. Although there is nothing wrong with this view, there is nothing tangible about it either. You cannot visualize the application. Or, as Beethoven said:

"[The work] rises, it grows, I hear and see the image in front of me from every angle... and only the labor of writing it down remains..."

Beethoven was a musical genius who was fully capable of composing a complete symphony in his head. Most folks are not as good at programming as Beethoven was at composing; we need a structure to our applications. Thankfully, we use things every day that can give us some valuable models for our applications. One example that closely resembles Fusebox is a computer network router.

Fusebox Mimics Networks

Over time, routers have helped organize network traffic immensely. Two of the most successful early network topologies were ring and bus architectures, shown in Figure 1.1.

These two architectures had one thing in common: They were based, as are all networks, on the idea of broadcasting packets of data from one machine to another.

Figure 1.1Figure 1.1 Ring and bus networks.

As you can see in Figure 1.1, the bus architecture (at top) worked by machines sending packets addressed to other machines onto the bus, the central line in the figure. Each machine would check the address on every packet that went by. If the packet belonged to the machine, it would make a copy of the packet and read it. Otherwise, the packet would be ignored.

Acting somewhat like a bus network in a loop, IBM's Token Ring worked by each packet attaching a token that carried the address of the recipient. When the token passed the recipient machine, the machine stripped off the packet. If the token passed a non-recipient machine, nothing happened and it continued around the ring.

As you can imagine, both of these approaches meant that a lot of packets were flying around on the wires. Then came a new topology, and the problem got worse.

The newer topology, called a star, used a central hub to send packets from one machine to another. A hub was a simple concept; it took whatever came in one port and sent copies of it out on all the other ports. This made great sense when you had a single hub at the center of several computers. Shown in Figure 1.2 is the classic star network.

Figure 1.2Figure 1.2 Star network.

Networks based on hubs eventually reached a practical limit on the number of ports, so network engineers expanded the capacity of the hub by linking hubs together. However, that technique was not scalable. If you linked too many hubs, the multiplied traffic would cause collision problems, with traffic moving slowly.

The answer to this problem was the router. A router is the hub's smarter cousin. Whereas a hub simply copies what is received in one port to all the other ports, a router sends a packet only to the destination. Using strategically placed routers, network planners were able to create huge networks. In fact, the Internet is a series of interconnected routers.

By organizing and regulating the flow of traffic between workgroups, network routers streamlined the networking industry. Routers act as a big switch. If one computer wants to talk to another computer, the router essentially connects those two machines to each other. Similarly, Fusebox uses a master controller file to directly pipe a page request to the correct set of files. The controller file handles every action that the system can perform.

Traditional ColdFusion applications have no hub. Page requests are all point-to-point. As the system grows in size, developers can't remember which pages link where. It becomes extremely difficult to keep a clear picture of the application in your head. Imagine trying to memorize exactly what a pile of spaghetti looks like and where each noodle winds. Tough, huh? Now imagine a map of the interstate freeway system. That is a lot simpler, isn't it? It is pretty simple to find your way from Atlanta, Georgia to Atlanta, Idaho even if you have never been to either of those places. Freeways have structure, like Fusebox. Spaghetti has no structure, like traditional ColdFusion applications.

Back to Thinking About Applications

We started this discussion with the idea that applications are difficult to think about in tangible terms, and that Fusebox provides an easier concept to grasp. Each of the real-world examples (network routers and managers) is tangible if you are familiar with it. When someone mentions one of these examples, you instantly have an idea of what it is about and how it works.

Fusebox does something similar with applications. As you gain experience with Fusebox, you will become more comfortable with the associated terminology, and your applications will be easier to visualize. Now we just have to tell you what Fusebox really is.

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email ask@peachpit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.peachpit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020