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 name="setAge" access="private" returntype="void">
    <cfargument name="age" type="numeric" required="true" />
    <cfargument name="x" type="boolean" required="true" />
    ... code ...

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 his Opening Keynote at 21st Cloud Expo, John Considine, General Manager of IBM Cloud Infrastructure, led attendees through the exciting evolution of the cloud. He looked 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 m...
DXWorldEXPO LLC announced today that All in Mobile, a mobile app development company from Poland, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. All In Mobile is a mobile app development company from Poland. Since 2014, they maintain passion for developing mobile applications for enterprises and startups worldwide.
DXWorldEXPO LLC announced today that ICC-USA, a computer systems integrator and server manufacturing company focused on developing products and product appliances, will exhibit at the 22nd International CloudEXPO | DXWorldEXPO. DXWordEXPO New York 2018, colocated with CloudEXPO New York 2018 will be held November 11-13, 2018, in New York City. ICC is a computer systems integrator and server manufacturing company focused on developing products and product appliances to meet a wide range of ...
We are seeing a major migration of enterprises applications to the cloud. As cloud and business use of real time applications accelerate, legacy networks are no longer able to architecturally support cloud adoption and deliver the performance and security required by highly distributed enterprises. These outdated solutions have become more costly and complicated to implement, install, manage, and maintain.SD-WAN offers unlimited capabilities for accessing the benefits of the cloud and Internet. ...
Headquartered in Plainsboro, NJ, Synametrics Technologies has provided IT professionals and computer systems developers since 1997. Based on the success of their initial product offerings (WinSQL and DeltaCopy), the company continues to create and hone innovative products that help its customers get more from their computer applications, databases and infrastructure. To date, over one million users around the world have chosen Synametrics solutions to help power their accelerated business or per...
Dion Hinchcliffe is an internationally recognized digital expert, bestselling book author, frequent keynote speaker, analyst, futurist, and transformation expert based in Washington, DC. He is currently Chief Strategy Officer at the industry-leading digital strategy and online community solutions firm, 7Summits.
Founded in 2000, Chetu Inc. is a global provider of customized software development solutions and IT staff augmentation services for software technology providers. By providing clients with unparalleled niche technology expertise and industry experience, Chetu has become the premiere long-term, back-end software development partner for start-ups, SMBs, and Fortune 500 companies. Chetu is headquartered in Plantation, Florida, with thirteen offices throughout the U.S. and abroad.
Bill Schmarzo, author of "Big Data: Understanding How Data Powers Big Business" and "Big Data MBA: Driving Business Strategies with Data Science," is responsible for setting the strategy and defining the Big Data service offerings and capabilities for EMC Global Services Big Data Practice. As the CTO for the Big Data Practice, he is responsible for working with organizations to help them identify where and how to start their big data journeys. He's written several white papers, is an avid blogge...
I think DevOps is now a rambunctious teenager - it's starting to get a mind of its own, wanting to get its own things but it still needs some adult supervision," explained Thomas Hooker, VP of marketing at CollabNet, in this SYS-CON.tv interview at DevOps Summit at 20th Cloud Expo, held June 6-8, 2017, at the Javits Center in New York City, NY.
"MobiDev is a software development company and we do complex, custom software development for everybody from entrepreneurs to large enterprises," explained Alan Winters, U.S. Head of Business Development at MobiDev, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Major trends and emerging technologies – from virtual reality and IoT, to Big Data and algorithms – are helping organizations innovate in the digital era. However, to create real business value, IT must think beyond the ‘what’ of digital transformation to the ‘how’ to harness emerging trends, innovation and disruption. Architecture is the key that underpins and ties all these efforts together. In the digital age, it’s important to invest in architecture, extend the enterprise footprint to the cl...
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.
Two weeks ago (November 3-5), I attended the Cloud Expo Silicon Valley as a speaker, where I presented on the security and privacy due diligence requirements for cloud solutions. Cloud security is a topical issue for every CIO, CISO, and technology buyer. Decision-makers are always looking for insights on how to mitigate the security risks of implementing and using cloud solutions. Based on the presentation topics covered at the conference, as well as the general discussions heard between sessio...
IoT is rapidly becoming mainstream as more and more investments are made into the platforms and technology. As this movement continues to expand and gain momentum it creates a massive wall of noise that can be difficult to sift through. Unfortunately, this inevitably makes IoT less approachable for people to get started with and can hamper efforts to integrate this key technology into your own portfolio. There are so many connected products already in place today with many hundreds more on the h...
No hype cycles or predictions of zillions of things here. IoT is big. You get it. You know your business and have great ideas for a business transformation strategy. What comes next? Time to make it happen. In his session at @ThingsExpo, Jay Mason, Associate Partner at M&S Consulting, presented a step-by-step plan to develop your technology implementation strategy. He discussed the evaluation of communication standards and IoT messaging protocols, data analytics considerations, edge-to-cloud tec...
DXWorldEXPO LLC announced today that the upcoming DXWorldEXPO | CloudEXPO New York event will feature 10 companies from Poland to participate at the "Poland Digital Transformation Pavilion" on November 12-13, 2018.
Digital Transformation is much more than a buzzword. The radical shift to digital mechanisms for almost every process is evident across all industries and verticals. This is often especially true in financial services, where the legacy environment is many times unable to keep up with the rapidly shifting demands of the consumer. The constant pressure to provide complete, omnichannel delivery of customer-facing solutions to meet both regulatory and customer demands is putting enormous pressure on...
CloudEXPO | DXWorldEXPO are the world's most influential, independent events where Cloud Computing was coined and where technology buyers and vendors meet to experience and discuss the big picture of Digital Transformation and all of the strategies, tactics, and tools they need to realize their goals. Sponsors of DXWorldEXPO | CloudEXPO benefit from unmatched branding, profile building and lead generation opportunities.
The best way to leverage your CloudEXPO | DXWorldEXPO presence as a sponsor and exhibitor is to plan your news announcements around our events. The press covering CloudEXPO | DXWorldEXPO will have access to these releases and will amplify your news announcements. More than two dozen Cloud companies either set deals at our shows or have announced their mergers and acquisitions at CloudEXPO. Product announcements during our show provide your company with the most reach through our targeted audienc...
@DevOpsSummit at Cloud Expo, taking place November 12-13 in New York City, NY, is co-located with 22nd international CloudEXPO | first international DXWorldEXPO and will feature technical sessions from a rock star conference faculty and the leading industry players in the world.