Welcome!

You will be redirected in 30 seconds or close now.

ColdFusion Authors: Yakov Fain, Jeremy Geelan, Maureen O'Gara, Nancy Y. Nee, Tad Anderson

Related Topics: ColdFusion, Adobe Flex

ColdFusion: Article

Designing ColdFusion Applications With UML

Developers are no different, yet I see 'improv developing' all the time

Have you ever watched actors improvise? It's quite fun; you never know what's going to happen. But imagine if a movie director decided a script wasn't necessary at all.

After all, the actors know the plot and know the most about their characters, so why not let them improvise. Wouldn't this lead to a more creative and realistic movie? I think we can all see that this would simply lead to a confusing story with no consistency. The actors are expected to impose their own talents on their roles, but they need a script to guide them along.

Developers are no different, yet I see "improv developing" all the time. A project manager will just describe what's needed - the outlines of a plot - and let the developers work it out. The results are often what you'd see with a movie. However, designing an application with UML can act as a script for developers. They're still free to use their own creativity and experience when implementing the design, but the UML documents provide them with a map of what the final product should be.

So it's no surprise that UML is quite popular in many software development communities, and you even see it used occasionally for ColdFusion. Yet how can ColdFusion developers really leverage UML to avoid improv development?

I'd like to show you some ways I've used UML to help me design ColdFusion applications. In this article I'll first explain what UML is, then how to read it, and finally how to create it.

What Is UML?
UML or Unified Modeling Language isn't a markup language like HTML or XML, and it's not a programming language like CFML. It's a unified method for modeling systems. This is usually used for software, but it can model any system. There are a number of benefits to designing an application. Like better team coordination, faster development cycles, and more scalable application designs.

Whether you're a freelance, corporate, or Open Source developer most of us need to work on a team. By designing an application upfront project managers can get a bird's eye view of a system before development starts. This lets them divide the work among multiple developers or groups. It also lets those developers know what to expect from the other part of the system without having to open the code.

Designing a system first also forces the designer to consider how the system will work before coding begins. Instead of putting those decisions off until later, they're made earlier. It's easier and faster to move a few blocks around a diagram then it is to refactor code. UML will help uncover faulty design decisions and reveal potential problem areas.

Lastly, most well-designed applications will pay close attention to the separation of concerns (SoC). MVC (Model-View-Controller) is one common way to achieve SoC. In fact, most ColdFusion frameworks are designed to enforce MVC (they often take the role of the controller). UML also helps enforce better application designs, like MVC. This creates more scalable, stable, and bug-free applications.

Reading UML
Most UML diagrams are fairly intuitive; you can glean most of what you need simply by studying them. But to write good UML you need to have a basic understanding of the notations used and what the different symbols mean. So before I show you how to use UML to create a ColdFusion application I'll explain a few of the elements you'll see in this article and how they relate to ColdFusion.

Class Symbol
At the heart of any OO application are "classes." In ColdFusion these are most directly related to components (CFC). The most basic symbol of a class in UML is just a box with the class's name in it like:

You might notice that there's a colon before the class name. Anything to the right of the colon is the class's name; anything to the left is the name of the specific object like:

This comes in handy when documenting an interaction between specific objects of a class, especially when two objects belong to the same class and you have to distinguish between them. But most of the time when designing an application you only see a class name.

If more details are needed about the class, this symbol can be expanded on. One or two more boxes can be added, the first containing the class's properties and the second its methods like:

There's a special notation used to list properties and methods in these blocks.

Here's the notation for properties:

-propertyname: datatype

The first character is a plus or minus sign, which stand for a private (-), or public (+) property. In a CFC, this means that you'll either scope the properties with "VARIABLES" (private) or "THIS" (public). You'll almost always have private properties, so you'll almost always use the minus sign to prefix your properties. The property name is whatever name you intend to give this variable inside the code. The name is followed by a colon and the data type of the property. For example:

If I were to open the "MyClass.cfc" file, I'd expect to see these lines of code:

<cfpoperty name="name" type="string" />
<cfpoperty name="age" type="numeric" />

And I'd expect to see these variables referred to as VARIABLES.name, and VARIABLES.age.

The notation for methods (known as functions in ColdFusion) isn't all that different:

+methodname(argument: datatype, argument: datatype): datatype

As you can see, the methods start off the same way as properties, with a plus or minus to indicate public or private. Then the name of the method itself is listed. The real difference is what follows the method name: a set of parentheses containing a list of the method's arguments. Each argument follows the same format as the properties - name:type. After the arguments is whatever data type, if any, the method itself returns. Let's expand our previous example:

Now if I open the MyClass.cfc file I'd expect to see this code:

<cffunction name="getString" access="public" returntype="string">
    ... code ...
</cffunction>
<cffunction name="setAge" access="private" returntype="void">
    <cfargument name="age" type="numeric" required="true" />
    <cfargument name="x" type="boolean" required="true" />
    ... code ...
</cffunction>


More Stories By Robert Blackburn

Robert Blackburn is a developer and team leader of the Internet Application Development team at American Power Conversion Corporation (http://www.apcc.com). He has been using ColdFusion since 1999, and has revived and manages the CFUnit open source project (http://cfunit.sourceforge.net). He currently has a blog at http://www.rbdev.net/devblog for his occasional ramblings.

Comments (1) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


Most Recent Comments
CFDJ News Desk 06/07/06 03:48:36 PM EDT

Developers are no different, yet I see 'improv developing' all the time. A project manager will just describe what's needed - the outlines of a plot - and let the developers work it out. The results are often what you'd see with a movie. However, designing an application with UML can act as a script for developers. They're still free to use their own creativity and experience when implementing the design, but the UML documents provide them with a map of what the final product should be.

@ThingsExpo Stories
In a recent survey, Sumo Logic surveyed 1,500 customers who employ cloud services such as Amazon Web Services (AWS), Microsoft Azure, and Google Cloud Platform (GCP). According to the survey, a quarter of the respondents have already deployed Docker containers and nearly as many (23 percent) are employing the AWS Lambda serverless computing framework. It’s clear: serverless is here to stay. The adoption does come with some needed changes, within both application development and operations. Tha...
In his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, will lead you through the exciting evolution of the cloud. He'll look at this major disruption from the perspective of technology, business models, and what this means for enterprises of all sizes. John Considine is General Manager of Cloud Infrastructure Services at IBM. In that role he is responsible for leading IBM’s public cloud infrastructure including strategy, development, and offering ...
As hybrid cloud becomes the de-facto standard mode of operation for most enterprises, new challenges arise on how to efficiently and economically share data across environments. In his session at 21st Cloud Expo, Dr. Allon Cohen, VP of Product at Elastifile, will explore new techniques and best practices that help enterprise IT benefit from the advantages of hybrid cloud environments by enabling data availability for both legacy enterprise and cloud-native mission critical applications. By rev...
SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
Amazon is pursuing new markets and disrupting industries at an incredible pace. Almost every industry seems to be in its crosshairs. Companies and industries that once thought they were safe are now worried about being “Amazoned.”. The new watch word should be “Be afraid. Be very afraid.” In his session 21st Cloud Expo, Chris Kocher, a co-founder of Grey Heron, will address questions such as: What new areas is Amazon disrupting? How are they doing this? Where are they likely to go? What are th...
High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...
SYS-CON Events announced today that Daiya Industry will exhibit at the Japanese Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ruby Development Inc. builds new services in short period of time and provides a continuous support of those services based on Ruby on Rails. For more information, please visit https://github.com/RubyDevInc.
As businesses evolve, they need technology that is simple to help them succeed today and flexible enough to help them build for tomorrow. Chrome is fit for the workplace of the future — providing a secure, consistent user experience across a range of devices that can be used anywhere. In her session at 21st Cloud Expo, Vidya Nagarajan, a Senior Product Manager at Google, will take a look at various options as to how ChromeOS can be leveraged to interact with people on the devices, and formats th...
SYS-CON Events announced today that Yuasa System will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Yuasa System is introducing a multi-purpose endurance testing system for flexible displays, OLED devices, flexible substrates, flat cables, and films in smartphones, wearables, automobiles, and healthcare.
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
Organizations do not need a Big Data strategy; they need a business strategy that incorporates Big Data. Most organizations lack a road map for using Big Data to optimize key business processes, deliver a differentiated customer experience, or uncover new business opportunities. They do not understand what’s possible with respect to integrating Big Data into the business model.
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, will discuss how they b...
Enterprises have taken advantage of IoT to achieve important revenue and cost advantages. What is less apparent is how incumbent enterprises operating at scale have, following success with IoT, built analytic, operations management and software development capabilities – ranging from autonomous vehicles to manageable robotics installations. They have embraced these capabilities as if they were Silicon Valley startups. As a result, many firms employ new business models that place enormous impor...
SYS-CON Events announced today that Dasher Technologies will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Dasher Technologies, Inc. ® is a premier IT solution provider that delivers expert technical resources along with trusted account executives to architect and deliver complete IT solutions and services to help our clients execute their goals, plans and objectives. Since 1999, we'v...
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that TidalScale, a leading provider of systems and services, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale has been involved in shaping the computing landscape. They've designed, developed and deployed some of the most important and successful systems and services in the history of the computing industry - internet, Ethernet, operating s...
SYS-CON Events announced today that TidalScale will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. TidalScale is the leading provider of Software-Defined Servers that bring flexibility to modern data centers by right-sizing servers on the fly to fit any data set or workload. TidalScale’s award-winning inverse hypervisor technology combines multiple commodity servers (including their ass...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.