|By Hal Helms, Ben Edwards, Matthew Woodward||
|January 31, 2006 05:45 PM EST||
It's all Simon's fault.
We say this to all framework writers who, even now, are trying to recover from the task assigned them by CFDJ's editor-in-chief: provide an article and an implementation of the Macromedia Pet Market application in their chosen framework.
Realizing that our first sentence might not serve as sufficient explanation for those weary framework authors, allow us to provide further clarification...
It began with an innocent-seeming dinner for speakers at the recent "Fusebox and Frameworks" conference. When we found ourselves seated next to Simon Horwith, we had a great deal to talk about. During our conversation, Simon suggested that it would be very helpful to ColdFusion programmers if a reference application existed that was implemented in several different frameworks. "We could have a cfpetmarket.com," he said, "and have different framework authors write a reference application and provide an article to go along with it. For the next issue of CFDJ."
This was the point where we went wrong - badly wrong - and the reason for which an apology is due: we agreed with Simon. Given the short time frame, our indiscretion meant that we were guaranteeing that our fellow framework authors (and ourselves) were in for some late nights. For our hasty improvidence, we offer a corporate mea culpa.
Coming Up with a Plan
The three of us put our heads together. It seemed the first thing to do was to review the existing application. This presented us with a problem: frankly, we didn't like what we saw. Installation of this simple application was anything but simple. The application almost seemed to be illustrating "worst practices" including such miscues as:
- Having CFCs reference variables set in the request scope, thereby breaking encapsulation
- Poor organization of files (e.g., including detailview.cfm in a subdirectory of extensions/components/petmarket)
- Poor separation of concerns in CFCs (e.g., including login and placeOrder methods within the User.cfc.)
- Rampant use of the this scope in CFCs, disregarding information hiding
- Queries used in display pages (e.g., shoppingcart.cfm)
- Jumble of mixed scopes used in display pages
- Even the database schema was - unusual
Our decisions also led us not to integrate any of the helper frameworks such as ColdSpring or Tartan, something we surely would have done had we written the code from the ground up. In short, the code in the Mach-II version of the Pet Market should not be viewed as exemplary, but rather as the result of retrofitting an existing application - warts and all - to make use of Mach-II.
Specifically, we wanted to show how nicely Mach-II can fit into applications in its role in the Model-View-Controller (MVC) architecture. MVC is a well-accepted architectural design pattern in which the components of an application are separated by functionality.
Model components represent the business logic of the application as well as a software simulation of the inventory of the business domain (and are often called domain model components). Model components might include representations of orders, customers, products, etc.
View components form the user interface, allowing users to receive information from the application and make requests of the application. HTML pages, Flash movies, and Java applets are all examples of view components.
Mediating between model and view are controller components, receiving requests and calling on model and/or view components as needed to fulfill a request. For example, a user request to edit application preferences would entail a call to the model to determine the existing preferences and a call to the view to display a form for changing these preferences.
Many applications use some form of controller, even if nothing more than a switch statement. Frameworks such as Mach-II, Fusebox, and Model-Glue provide a more extensive controller and often include prebuilt functionality as well as "hooks" for developers who want to extend the capabilities of the framework.
Within the Mach-II world, various controller functions are assigned to different Mach-II elements. The central element in a Mach-II application is an event. An event is an all-purpose mechanism for encapsulating a request and the results (if any) of fulfilling that request. In our "edit preferences" example, Mach-II creates an event object (an instance of Mach-II's Event class) that comes with prebuilt functionality.
Among other things, events can store information related to a request. In the "edit preferences" example, Mach-II stores the results of asking the model for the user's current preferences (possibly a query) in the event. (Event objects have arguments that can be accessed with prebuilt get/setArg methods.)
When the view page - in this case a user preference form - is called, it gets any information it needs from the event (shown in the illustration as a cube). In a Mach-II application, as in any well-designed MVC application, the model and the view components exist completely separate and independent of each other. Such loose coupling, as it is called, aids in both code reuse and maintainability.
The rest of Mach-II's machinery exists to support the Event. A Listener element is a CFC that extends Mach-II's Listener class and "listens" for events, taking appropriate action for the individual event. Using our example of a user editing their preferences again, we might have a UserListener that is notified of an "editPreferences" event. It is the UserListener that actually calls the model for the user's existing preferences.
Listeners do not, though, call view pages. Doing so would decrease the listener's ability to be reused and make application maintenance more difficult. Instead, Mach-II uses a declarative programming mechanism in which the instructions for responding to a particular event are written not in code (programatically) but in some sort of simple configuration file (declaratively).
For this configuration file, Mach-II uses the file, mach-ii.xml. Different sections of the configuration file allow the developer to customize how Mach-II works for any particular application. (Rather than forcing the developer to adapt to Mach-II, Mach-II adapts to the developer.)
Mach-II's Configuration File
If you haven't done so, download the M2PetMarket application from www.mach-II.com. A subdirectory, controller, holds the mach-ii.xml file. The file has six sections:
- properties: Used to set general application settings including such properties as applicationRoot (the directory the application files are to be found in) and defaultEvent (the event to be used when none is specified).
- listeners: Used to register any listeners used in the application. Mach-II allows you to use a single, general purpose listener or to specify separate listeners dedicated to specific areas of interest (e.g., UserListener, ShoppingCartListener, etc.).
- event-filters: Used to preprocess events before any listeners respond to them. Typical functionality found in event-filters would include granular security ("Can this user call this event?") and server-side form validation.
- plugins: Used to register components that are called at various "plugin points" throughout the life cycle of an event. The Mach-II Pet Market application uses a plug-in to ensure, among other things, that a user is logged into the application.
- event-handlers: Used to indicate how this Mach-II application should respond to a specific event. In our "edit preferences" example, the code for the editPreferences event-handler would look like this:
<notify listener="UserListener" method="getCurrentPreferences"
<view-page name="userPreferenceForm" />
- page-views: Used to register the view pages used within this application. Pages that are registered here (providing their physical location) can then be referenced within an event-handler by (as shown in our example).
SYS-CON Events announced today that Technologic Systems Inc., an embedded systems solutions company, will exhibit at SYS-CON's @ThingsExpo, which will take place on June 6-8, 2017, at the Javits Center in New York City, NY. Technologic Systems is an embedded systems company with headquarters in Fountain Hills, Arizona. They have been in business for 32 years, helping more than 8,000 OEM customers and building over a hundred COTS products that have never been discontinued. Technologic Systems’ pr...
Mar. 29, 2017 02:30 PM EDT Reads: 3,798
SYS-CON Events announced today that Auditwerx will exhibit at 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. Auditwerx specializes in SOC 1, SOC 2, and SOC 3 attestation services throughout the U.S. and Canada. As a division of Carr, Riggs & Ingram (CRI), one of the top 20 largest CPA firms nationally, you can expect the resources, skills, and experience of a much larger firm combined with the accessibility and attent...
Mar. 29, 2017 02:30 PM EDT Reads: 651
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 ...
Mar. 29, 2017 02:30 PM EDT Reads: 2,264
SYS-CON Events announced today that HTBase will exhibit at 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. HTBase (Gartner 2016 Cool Vendor) delivers a Composable IT infrastructure solution architected for agility and increased efficiency. It turns compute, storage, and fabric into fluid pools of resources that are easily composed and re-composed to meet each application’s needs. With HTBase, companies can quickly prov...
Mar. 29, 2017 02:15 PM EDT Reads: 3,240
SYS-CON Events announced today that Loom Systems will exhibit at 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. Founded in 2015, Loom Systems delivers an advanced AI solution to predict and prevent problems in the digital business. Loom stands alone in the industry as an AI analysis platform requiring no prior math knowledge from operators, leveraging the existing staff to succeed in the digital era. With offices in S...
Mar. 29, 2017 01:30 PM EDT Reads: 1,734
Buzzword alert: Microservices and IoT at a DevOps conference? What could possibly go wrong? In this Power Panel at DevOps Summit, moderated by Jason Bloomberg, the leading expert on architecting agility for the enterprise and president of Intellyx, panelists peeled away the buzz and discuss the important architectural principles behind implementing IoT solutions for the enterprise. As remote IoT devices and sensors become increasingly intelligent, they become part of our distributed cloud enviro...
Mar. 29, 2017 12:15 PM EDT Reads: 7,891
SYS-CON Events announced today that T-Mobile will exhibit at 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. As America's Un-carrier, T-Mobile US, Inc., is redefining the way consumers and businesses buy wireless services through leading product and service innovation. The Company's advanced nationwide 4G LTE network delivers outstanding wireless experiences to 67.4 million customers who are unwilling to compromise on ...
Mar. 29, 2017 11:45 AM EDT Reads: 2,571
SYS-CON Events announced today that Infranics will exhibit at 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. Since 2000, Infranics has developed SysMaster Suite, which is required for the stable and efficient management of ICT infrastructure. The ICT management solution developed and provided by Infranics continues to add intelligence to the ICT infrastructure through the IMC (Infra Management Cycle) based on mathemat...
Mar. 29, 2017 11:00 AM EDT Reads: 3,430
SYS-CON Events announced today that Interoute, owner-operator of one of Europe's largest networks and a global cloud services platform, has been named “Bronze Sponsor” of SYS-CON's 20th Cloud Expo, which will take place on June 6-8, 2017 at the Javits Center in New York, New York. Interoute is the owner-operator of one of Europe's largest networks and a global cloud services platform which encompasses 12 data centers, 14 virtual data centers and 31 colocation centers, with connections to 195 add...
Mar. 29, 2017 10:15 AM EDT Reads: 1,716
SYS-CON Events announced today that Cloudistics, an on-premises cloud computing company, has been named “Bronze 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. Cloudistics delivers a complete public cloud experience with composable on-premises infrastructures to medium and large enterprises. Its software-defined technology natively converges network, storage, compute, virtualization, and management into a ...
Mar. 29, 2017 10:00 AM EDT Reads: 2,339
In his session at @ThingsExpo, Eric Lachapelle, CEO of the Professional Evaluation and Certification Board (PECB), will provide an overview of various initiatives to certifiy the security of connected devices and future trends in ensuring public trust of IoT. Eric Lachapelle is the Chief Executive Officer of the Professional Evaluation and Certification Board (PECB), an international certification body. His role is to help companies and individuals to achieve professional, accredited and worldw...
Mar. 29, 2017 08:45 AM EDT Reads: 940
In his General Session at 16th Cloud Expo, David Shacochis, host of The Hybrid IT Files podcast and Vice President at CenturyLink, investigated three key trends of the “gigabit economy" though the story of a Fortune 500 communications company in transformation. Narrating how multi-modal hybrid IT, service automation, and agile delivery all intersect, he will cover the role of storytelling and empathy in achieving strategic alignment between the enterprise and its information technology.
Mar. 29, 2017 08:00 AM EDT Reads: 7,541
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" ...
Mar. 29, 2017 06:00 AM EDT Reads: 9,075
The Internet of Things is clearly many things: data collection and analytics, wearables, Smart Grids and Smart Cities, the Industrial Internet, and more. Cool platforms like Arduino, Raspberry Pi, Intel's Galileo and Edison, and a diverse world of sensors are making the IoT a great toy box for developers in all these areas. In this Power Panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists discussed what things are the most important, which will have the most profound e...
Mar. 29, 2017 04:00 AM EDT Reads: 15,125
Keeping pace with advancements in software delivery processes and tooling is taxing even for the most proficient organizations. Point tools, platforms, open source and the increasing adoption of private and public cloud services requires strong engineering rigor - all in the face of developer demands to use the tools of choice. As Agile has settled in as a mainstream practice, now DevOps has emerged as the next wave to improve software delivery speed and output. To make DevOps work, organization...
Mar. 29, 2017 03:45 AM EDT Reads: 2,175
My team embarked on building a data lake for our sales and marketing data to better understand customer journeys. This required building a hybrid data pipeline to connect our cloud CRM with the new Hadoop Data Lake. One challenge is that IT was not in a position to provide support until we proved value and marketing did not have the experience, so we embarked on the journey ourselves within the product marketing team for our line of business within Progress. In his session at @BigDataExpo, Sum...
Mar. 29, 2017 03:30 AM EDT Reads: 3,261
Web Real-Time Communication APIs have quickly revolutionized what browsers are capable of. In addition to video and audio streams, we can now bi-directionally send arbitrary data over WebRTC's PeerConnection Data Channels. With the advent of Progressive Web Apps and new hardware APIs such as WebBluetooh and WebUSB, we can finally enable users to stitch together the Internet of Things directly from their browsers while communicating privately and securely in a decentralized way.
Mar. 29, 2017 03:00 AM EDT Reads: 6,104
DevOps is often described as a combination of technology and culture. Without both, DevOps isn't complete. However, applying the culture to outdated technology is a recipe for disaster; as response times grow and connections between teams are delayed by technology, the culture will die. A Nutanix Enterprise Cloud has many benefits that provide the needed base for a true DevOps paradigm.
Mar. 29, 2017 01:15 AM EDT Reads: 2,535
What sort of WebRTC based applications can we expect to see over the next year and beyond? One way to predict development trends is to see what sorts of applications startups are building. In his session at @ThingsExpo, Arin Sime, founder of WebRTC.ventures, will discuss the current and likely future trends in WebRTC application development based on real requests for custom applications from real customers, as well as other public sources of information,
Mar. 29, 2017 01:00 AM EDT Reads: 1,141
In his General Session at 17th Cloud Expo, Bruce Swann, Senior Product Marketing Manager for Adobe Campaign, explored the key ingredients of cross-channel marketing in a digital world. Learn how the Adobe Marketing Cloud can help marketers embrace opportunities for personalized, relevant and real-time customer engagement across offline (direct mail, point of sale, call center) and digital (email, website, SMS, mobile apps, social networks, connected objects).
Mar. 28, 2017 11:15 PM EDT Reads: 3,537