|By Hal Helms, Ben Edwards||
|August 12, 2003 12:00 AM EDT||
With the release of the MX version, ColdFusion has moved from its strict procedural programming background toward object-oriented design and programming. This move has evoked both hope and fear in developers, some welcoming the decidedly new concepts of object orientation (OO) and some dreading that they will lose the language they love.
Within the Fusebox community, the introduction of ColdFusion components (CFCs) has stirred a great deal of interest: Would Fusebox leverage these new capabilities and, if so, how? Almost a year ago, we - along with John Quarto-vonTivadar - began work on a new version of Fusebox that would leverage the new capabilities of MX. At once there was a good deal of speculation on what "Fusebox MX" would look like. Would Fusebox become an OO framework? Would developers have to understand polymorphism and inheritance to use it? This article answers these questions and will, we hope, inspire people to look at a new, unashamedly object-oriented framework called Mach-II. In next month's issue of ColdFusion Developer's Journal, we'll explore Fusebox 4 - the worthy successor to Fusebox 3.
ColdFusion's initial appeal was to "Webmasters" who wanted to make their sites more dynamic - and it succeeded admirably. But just as the term "Webmaster" is an anachronism, the call for more dynamic Web sites was succeeded by the need for true Web applications.
As these applications became more involved and more ambitious in scope, ColdFusion developers discovered that even a thorough knowledge of tags and functions was just not enough. Realizing that the same problems presented themselves again and again, a group of developers wondered if these problems couldn't be solved - or at least ameliorated - by building some sort of framework on which Web-based applications could be developed. These visionaries traded ideas and code over e-mail. Ideas evolved and Fusebox was thus born, and it too succeeded admirably.
The Rise of OO
When ColdFusion MX was released, it generated a great deal of interest. For many developers, the most interesting aspect of the new release was the inclusion of a new encapsulation mechanism, the ColdFusion component (CFC). CFCs promised ColdFusion developers the ability to move from writing purely procedural code to object-oriented code. Macromedia began touting CFCs as "objects without all the fussiness."
For some developers, this represented a profound "this changes everything" shift - not without reason. Object orientation represents a shift in thinking. The procedural approach views each problem as a series of actions that must be taken in the correct order to achieve a desired result. Data is separate from functions. The object-oriented approach identifies separate, encapsulated components ("objects") in which data and functions are combined.
Fusebox represents a procedural approach to building applications. The object-oriented approach is very different from the procedural approach. Solutions result from first building classes that provide abstracted and simplified models of real-world counterparts. For example, a billing system might have classes for Invoice, Receipt, Customer, etc. When the application is run, instances of these classes (objects) are created. The running application then resembles an extended conversation between objects, with different objects sending messages to other objects to request information or ask that a service of some type be performed.
Shortly after the release of CFCs, we wrote "Discovering CFCs" (Techspedition Press, 2002), in which we explored in what ways CFCs were - and were not - truly object oriented. And since we were both involved in the Fusebox world, we decided to write a new version of Fusebox that would make use of the new capabilities of CFCs. We labeled the initiative, seemingly sensibly enough, Fusebox MX.
When we began talking about it openly, we heard from people who asked whether, with CFCs, the need for Fusebox was gone altogether? "Why do we need Fusebox when we have objects?" they asked. As we saw it, there were three ways to answer this question.
First, as we showed in our book, there were aspects of CFCs that simply could not be squared with an object-oriented approach. Second, if objects obviated the need for frameworks, why would Java, a language with first-class objects, have strong communities for over a dozen framework projects? Finally, however helpful individual components might be, they didn't address the issue of an underlying architecture. In short, we felt that Fusebox remained a valuable framework for the ColdFusion community.
OO and You
But a funny thing happened on the way to Fusebox MX. We began to ask questions about the appropriate software architecture on which to build the framework. Would Fusebox MX essentially be Fusebox - doing little more than adding components into a still procedural toolkit? That would be the easiest change for existing Fuseboxers to get used to, but would be little more than adding "super custom tags" to procedural code.
We felt strongly that the continued reliance on procedural code would put ColdFusion programmers at risk. Over the past 10 years, essentially the current lifespan of ColdFusion, a revolution has taken place. This revolution was not political, but technological, and it represented the ascension of object orientation as the dominant software construction paradigm. While languages such as Java, C#, Delphi, Visual Basic .NET, and Ruby (to name only a few) represented the new guard in this revolution, ColdFusion - and Fusebox - remained solidly procedural. Developers using ColdFusion simply didn't need to come to terms with object orientation.
Being involved in the Fusebox community, we felt a duty to ensure that Fuseboxers would not be using a proprietary framework cut off from the bigger IT world. We decided to rethink everything about Fusebox - including its architecture.
A Focus on Architecture
For many developers, the idea of "software architecture" simply means "how I put my application together." While obviously inexact, that definition of architecture was reflected by the great architect, Ludwig Mies van der Rohe, who wrote: "Whenever someone puts two bricks together, there architecture begins."
In practice, software architectures are commonly treated as a collection of components and connectors. Components are the system's functional elements, such as a shopping cart, a contact manager, or a database. Connectors define the protocols for communication between components. Examples of connectors include method calls, SQL queries, and HTTP requests. The architecture chosen for a system determines the vocabulary of components and connectors that can be used as well as the set of constraints defining how they are combined.
The choice of a particular software architecture is made on the basis of the goals of the designers, which is to say that there is no single-fit, perfect architecture. Over time, several different software architectural styles have risen to the fore, each with its own strengths and weaknesses. Our choice of a software architecture for a new Fusebox would then depend on what we wanted to accomplish. To determine this, we examined what others had come to rely on with Fusebox.
Fundamental Fusebox Goals
We began to speak with other Fuseboxers: What was it they most valued about Fusebox? From many voices, a few themes emerged. What Fuseboxers wanted from Fusebox was:
Our own concerns centered on software maintenance. It is an often overlooked fact that between 70-90% of the life-cycle cost of an application is spent on maintenance. A framework that misses this point, by treating maintenance as an afterthought, gives away the enormous leverage that cost and time savings in maintenance can offer adopters of the framework. And if saving money is not a worthy enough goal, surely saving the sanity of coders who must work on poorly maintained code is. Thus, software maintainability became one of our chief goals.
Maintainability, we knew, was intimately tied to code reusability, since the same problem that causes an application to be difficult to maintain causes the components to be difficult to reuse - namely, the tight coupling between components.
Excessive dependencies between code components adversely affects all. Therefore, we felt that by tackling software maintainability, we would increase the chances for significant code reuse.
Cohesion and Coupling
Two metrics important for consideration in defining the publicly exposed interfaces of an architecture's components and connectors are a system's cohesion and coupling. Cohesion is the measure of the degree to which a component has a singular purpose. The greater cohesion a component exhibits, the more focused the component and the fewer the assumptions about contexts for reuse.
Coupling is the degree of interdependence between components. The less a component relies on other components (the looser its coupling), the more independent and reusable it is. Maximized cohesion (simple components) and minimized coupling (fewer connectors) are hallmarks of a flexible, maintainable architecture.
One of the more broadly accepted architectural styles in software engineering is known as implicit invocation. Implicit invocation architectures intrigued us. Event-based, implicit invocation is an example of a well-crafted architectural style with high cohesion and loose coupling. As such, it is one of the more broadly accepted architectural styles in software engineering. Examples of implicit invocation systems abound, including virtually all modern operating systems, integrated development environments, and database management systems.
Events and Listeners
Implicit invocation systems rely on the idea of events and listeners. Events are triggered whenever the system needs to do something, such as respond to an incoming request. Events can take many forms across different types of implementations; often for object-based systems, an event is an object whose properties contain any contextual information needed to process the event (similar to how an HTTP request carries with it all its form and query-string variables).
Listeners are business logic components that are registered with the system. When an event is announced, the system finds the listeners registered for that event and announces the new event to those listeners. Listeners fit the same criteria for components that we've already discussed - they are functional modules of the system. Components that wish to act as listeners are registered to listen for certain events at configuration time (by specification in an XML file, for instance). When an event is triggered, all registered listeners of that event are passed the event by means of a dynamically determined method call. In this way, functions are implicitly invoked. This process of notifying listeners of an event is called event announcement.
Events and listeners can themselves trigger other events. Let's consider how a common login/authentication scenario can be represented in terms of events and listeners. In this example, a login form is filled out by a user and then submitted. The incoming HTTP request triggers the creation of a LoginEvent, and the system populates the event with information in the request.
Next, the system determines the listeners for LoginEvent; in this case there is only one - the AuthenticationListener. Determined by a configuration file, the system invokes the AuthenticationListener's tryLogin() method, passing to it the event. Based on information in the event, the tryLogin() method will seek to authenticate the user. If the authentication succeeds, a new LoginAcceptedEvent is triggered. If authentication fails, a new LoginFailedEvent is triggered. The cycle then continues, with any listeners of the new event being notified (see Figure 1).
Loosely coupled components work together, but do not rely on each other to do their own jobs. The interaction policy is separate from the interacting components, providing flexibility. Components can be introduced into a system simply by registering them for events of the system, aiding greatly in reusability and maintainability. Introduction of new components does not require change in other component interfaces, providing scalability as new features are added. Overall, implicit invocation eases system evolution.
Rather than starting with the idea of making a Fusebox for ColdFusion MX, we began with the idea of making a true, object-oriented framework that would meet the goals we adopted. Work on the framework proceeded without regard to a specific language. Instead, we wanted to ensure that this new framework would be adaptable to any language that implemented object-oriented principles. Only after all architectural decisions were made did we set about the task of implementing it in ColdFusion, where we found CFCs provided us the encapsulation we needed.
The end results have surprised and gratified us. We find that the system offers enormous flexibility. New functionality (a.k.a., "You know what would be nice...") is often as easy as adding a new listener to the system. Loose coupling ensures that other components do not need to be altered. We found that the implementation of the Model-View-Controller design pattern was a natural fit with an event-based invocation architecture. Finally, we found that the system could easily work with Web services, Flash remoting, Enterprise JavaBeans, and more.
Only one problem remained: What should we call this new framework? We began this journey with the idea that we were creating a "Fusebox MX". What emerged was something different and better than what we had hoped for. But was it Fusebox MX? In the end, we decided that a different name would better serve all involved. Certainly, the underlying architecture had little in common with Fusebox. Better, we felt, to give it a separate name. Fusebox 4 would be the successor to Fusebox 3, and would continue to offer enormous benefits to procedural programmers.
After too many late-night discussions (for some reason, naming something takes on enormous importance!), we decided that we wanted the framework name to reflect the fact that it was meant to help developers break the procedural barrier. Mach-II was thus born. Next month, we'll explore the inner workings of Mach-II. In the meantime, we invite developers who want to use a powerful, flexible, object-oriented framework to build robust and maintainable applications to explore Mach-II at www.mach-ii.com.
|Jonathan Clough 10/13/03 08:31:18 AM EDT|
I've really benefitted from Fusebox3 and liked the idea of Mach-ii. However the mach-ii site has almost no documentation! Come on guys, if you want the programming community to take up Mach-ii then at least tell us how it works !!
|Sean Corfield 10/01/03 04:53:11 PM EDT|
Mach II does a very good job of abstracting the subtleties of the Implicit Invocation Architecture and the Model View Controller design pattern on which it is based.
The end result is a well-defined framework that lets you build applications that are easy to maintain and enhance.
|CF Guy 09/15/03 04:14:40 PM EDT|
Whatever you want to. You are not forced to take advantage of the improvements in ColdFusion. While not the optimum usage, CF still has the same ability to be procedural if you like.
|Thomas Hamlin 08/24/03 07:56:10 PM EDT|
The reason I was attracted to Coldfusion, Macromedia and Fusebox was that some of the complexity had been abstracted from what I thought I would need to do. It seems to be going the opposite direction. If I wanted to be a C++ OO programer I would have done that years ago. I want to run a business and be in touch with technology not be a slave to it.
Microservices are a very exciting architectural approach that many organizations are looking to as a way to accelerate innovation. Microservices promise to allow teams to move away from monolithic "ball of mud" systems, but the reality is that, in the vast majority of organizations, different projects and technologies will continue to be developed at different speeds. How to handle the dependencies between these disparate systems with different iteration cycles? Consider the "canoncial problem" ...
Feb. 27, 2017 06:00 AM EST Reads: 6,143
SYS-CON Events announced today that delaPlex will exhibit at SYS-CON's @CloudExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. delaPlex pioneered Software Development as a Service (SDaaS), which provides scalable resources to build, test, and deploy software. It’s a fast and more reliable way to develop a new product or expand your in-house team.
Feb. 27, 2017 04:30 AM EST Reads: 2,225
Data is the fuel that drives the machine learning algorithmic engines and ultimately provides the business value. In his session at 20th Cloud Expo, Ed Featherston, director/senior enterprise architect at Collaborative Consulting, will discuss the key considerations around quality, volume, timeliness, and pedigree that must be dealt with in order to properly fuel that engine.
Feb. 27, 2017 04:30 AM EST Reads: 4,289
910Telecom exhibited at the 19th International Cloud Expo, which took place at the Santa Clara Convention Center in Santa Clara, CA, in November 2016. Housed in the classic Denver Gas & Electric Building, 910 15th St., 910Telecom is a carrier-neutral telecom hotel located in the heart of Denver. Adjacent to CenturyLink, AT&T, and Denver Main, 910Telecom offers connectivity to all major carriers, Internet service providers, Internet backbones and exchanges.
Feb. 27, 2017 03:30 AM EST Reads: 2,192
Why do your mobile transformations need to happen today? Mobile is the strategy that enterprise transformation centers on to drive customer engagement. In his general session at @ThingsExpo, Roger Woods, Director, Mobile Product & Strategy – Adobe Marketing Cloud, covered key IoT and mobile trends that are forcing mobile transformation, key components of a solid mobile strategy and explored how brands are effectively driving mobile change throughout the enterprise.
Feb. 27, 2017 02:00 AM EST Reads: 7,547
As businesses adopt functionalities in cloud computing, it’s imperative that IT operations consistently ensure cloud systems work correctly – all of the time, and to their best capabilities. In his session at @BigDataExpo, Bernd Harzog, CEO and founder of OpsDataStore, will present an industry answer to the common question, “Are you running IT operations as efficiently and as cost effectively as you need to?” He will expound on the industry issues he frequently came up against as an analyst, and...
Feb. 27, 2017 01:00 AM EST Reads: 2,145
Who are you? How do you introduce yourself? Do you use a name, or do you greet a friend by the last four digits of his social security number? Assuming you don’t, why are we content to associate our identity with 10 random digits assigned by our phone company? Identity is an issue that affects everyone, but as individuals we don’t spend a lot of time thinking about it. In his session at @ThingsExpo, Ben Klang, Founder & President of Mojo Lingo, discussed the impact of technology on identity. Sho...
Feb. 26, 2017 11:45 PM EST Reads: 6,266
The explosion of new web/cloud/IoT-based applications and the data they generate are transforming our world right before our eyes. In this rush to adopt these new technologies, organizations are often ignoring fundamental questions concerning who owns the data and failing to ask for permission to conduct invasive surveillance of their customers. Organizations that are not transparent about how their systems gather data telemetry without offering shared data ownership risk product rejection, regu...
Feb. 26, 2017 11:45 PM EST Reads: 2,179
SYS-CON Media announced today that @WebRTCSummit Blog, the largest WebRTC resource in the world, has been launched. @WebRTCSummit Blog offers top articles, news stories, and blog posts from the world's well-known experts and guarantees better exposure for its authors than any other publication. @WebRTCSummit Blog can be bookmarked ▸ Here @WebRTCSummit conference site can be bookmarked ▸ Here
Feb. 26, 2017 10:00 PM EST Reads: 13,770
SYS-CON Events announced today that CA Technologies has been named "Platinum Sponsor" of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, New York, and 21st International Cloud Expo, which will take place in November in Silicon Valley, California.
Feb. 26, 2017 09:15 PM EST Reads: 2,549
You think you know what’s in your data. But do you? Most organizations are now aware of the business intelligence represented by their data. Data science stands to take this to a level you never thought of – literally. The techniques of data science, when used with the capabilities of Big Data technologies, can make connections you had not yet imagined, helping you discover new insights and ask new questions of your data. In his session at @ThingsExpo, Sarbjit Sarkaria, data science team lead ...
Feb. 26, 2017 09:00 PM EST Reads: 9,052
In his keynote at @ThingsExpo, Chris Matthieu, Director of IoT Engineering at Citrix and co-founder and CTO of Octoblu, focused on building an IoT platform and company. He provided a behind-the-scenes look at Octoblu’s platform, business, and pivots along the way (including the Citrix acquisition of Octoblu).
Feb. 26, 2017 08:45 PM EST Reads: 2,089
Bert Loomis was a visionary. This general session will highlight how Bert Loomis and people like him inspire us to build great things with small inventions. In their general session at 19th Cloud Expo, Harold Hannon, Architect at IBM Bluemix, and Michael O'Neill, Strategic Business Development at Nvidia, discussed the accelerating pace of AI development and how IBM Cloud and NVIDIA are partnering to bring AI capabilities to "every day," on-demand. They also reviewed two "free infrastructure" pr...
Feb. 26, 2017 08:45 PM EST Reads: 5,248
WebRTC is about the data channel as much as about video and audio conferencing. However, basically all commercial WebRTC applications have been built with a focus on audio and video. The handling of “data” has been limited to text chat and file download – all other data sharing seems to end with screensharing. What is holding back a more intensive use of peer-to-peer data? In her session at @ThingsExpo, Dr Silvia Pfeiffer, WebRTC Applications Team Lead at National ICT Australia, looked at differ...
Feb. 26, 2017 08:30 PM EST Reads: 7,264
SYS-CON Events announced today that Hitrons Solutions will exhibit at the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. Hitrons Solutions Inc. is distributor in the North American market for unique products and services of small and medium-size businesses, including cloud services and solutions, SEO marketing platforms, and mobile applications.
Feb. 26, 2017 08:30 PM EST Reads: 900
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place June 6-8, 2017, at the Javits Center in New York City, New York, is co-located with 20th Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry p...
Feb. 26, 2017 07:45 PM EST Reads: 2,162
The Internet of Things can drive efficiency for airlines and airports. In their session at @ThingsExpo, Shyam Varan Nath, Principal Architect with GE, and Sudip Majumder, senior director of development at Oracle, discussed the technical details of the connected airline baggage and related social media solutions. These IoT applications will enhance travelers' journey experience and drive efficiency for the airlines and the airports.
Feb. 26, 2017 06:45 PM EST Reads: 2,496
In 2014, Amazon announced a new form of compute called Lambda. We didn't know it at the time, but this represented a fundamental shift in what we expect from cloud computing. Now, all of the major cloud computing vendors want to take part in this disruptive technology. In his session at 20th Cloud Expo, John Jelinek IV, a web developer at Linux Academy, will discuss why major players like AWS, Microsoft Azure, IBM Bluemix, and Google Cloud Platform are all trying to sidestep VMs and containers...
Feb. 26, 2017 05:30 PM EST Reads: 2,343
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, whic...
Feb. 26, 2017 05:15 PM EST Reads: 2,013
SYS-CON Events announced today that CA Technologies has been named “Platinum Sponsor” of SYS-CON's 20th International Cloud Expo®, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY, and the 21st International Cloud Expo®, which will take place October 31-November 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. CA Technologies helps customers succeed in a future where every business – from apparel to energy – is being rewritten by software. From ...
Feb. 26, 2017 03:45 PM EST Reads: 2,773