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

ColdFusion: Article

Bearing Fruit with Plum

Review of the Plum IDE from Productivity Enhancement, Inc.

Plum stands for Practical Lightweight Universal Methodology, and consists of a comprehensive development environment that includes a Windows-based IDE; code generator; robust application framework; development methodology; simple integrated Content Management System (CMS); and stored procedure, unit test, and component generators. Plum accomplishes so much for a ColdFusion developer that it can literally be overwhelming trying to grok it all at first glance.

System Requirements and Installation

CFMX 6.1 is required to run Plum applications as the framework makes extensive use of ColdFusion Components (CFCs). The Plum IDE is a Windows .NET desktop application, so have the Microsoft .NET Framework 1.1 installed on your Windows 2000/XP computer prior to installation. Though the IDE is a Windows application, Plum-generated code can be deployed on any CFMX platform.

Plum was designed to work primarily with MS SQL Server 2000 (the stored procedure generator only supports this option), but will also support Oracle 9i and Microsoft Access 2000. If you are using Oracle you will need to download the Oracle .NET data provider to ensure that the IDE can read the database schema. (A future version of Plum is slated to support popular open source databases such as MySQL and PostgresSQL.)

Creating a Project

The New Project Wizard
Plum includes a new project wizard that steps you through the process of creating a fully functional baseline Web application in about two to five minutes.

The first steps collect and verify information about the operating environment, including application name, directory mappings, and server operating system. Once this information is collected the Plum Framework and starter content are installed.

The next several steps of the wizard verify a connection to your database and ensure that the mandatory Plum tables are present. Plum projects require the presence of five tables that support the Content Management and User Access modules of the application. If the tables are not present, they will be inserted, fully respecting the integrity of the objects already in the database. The remaining pages in the wizard collect and verify mappings for server, custom tag, and Verity collections, and allow you to optionally choose for which tables to generate standard maintenance forms.

At the completion of the project wizard, Plum launches your default browser and runs an initialization routine to verify your environment is set up correctly. At this point you can also optionally create Verity collections for your CMS starter content. When initialization is successfully completed, you are redirected to the home page of your new Web site, complete with starter content! Returning to the Plum IDE reveals a new project tree containing all the major components of your project.

The Generated Application
The application generated by the wizard is a fully functional Web site, with both public and private (administrative) areas. It contains many useful public-facing general purpose forms that handle tasks such as logging in, user self-registration, user profile maintenance, password retrieval, feedback, e-mailing a copy of the currently viewed page to a specific address, and a site search form. Starter content is provided for basic pages common to many Web sites, which can be easily edited through the internal CMS. The administrative modules provide built-in forms for maintaining users/roles, content, and layouts.

XML Project File
The resulting Plum project file is a fully compliant XML file with a .plum extension. Over time I expect Plum adopters will think of many creative ways to extend the use of this file using XLST. A note of caution - you should avoid manually editing the project file or you risk having it become unreadable by the IDE. You might even want to consider including it in your source control provider, if you are using one.

Working with the IDE

The main purpose of the Plum IDE is to synchronize your project with the schema of your database and rapidly generate code for your application. There is no WYSIWYG design surface or internal code editor; you will still be using your favorite code editor to manage code. The preferred editor is HomeSite+, and custom graphical tag editors are included to work with the generated code. However, it is relatively easy to re-create these tags in a custom tag library in Dreamweaver MX, if that is your preferred editing tool.

Round-trip editing is not supported; any manual changes made to the generated code are not subsequently reflected in the Plum project file. If you make custom changes to tag attributes in the code and you want to keep your project file up to date, you will have to manually update the attributes in the IDE. In fact, there comes a point in every Plum project when the generated code is "divorced" from the IDE, after which you might add your own handcrafted code. This is a necessary and intended behavior to allow you to extend the application with your own customizations.

The Workspace
The IDE workspace is split into three frames with the project tree in the left frame, form data entry in the top right frame, and help information for the selected node in the bottom right frame (see Figure 1).

The project tree contains four nodes that focus on the major code generation areas: environment, database, modules, and security. Clicking on a node in the tree activates the associated data input form for that node in the top right frame. The database and modules nodes and their children make liberal use of context menus, so it is a good idea to right-click on these nodes as you get started to view the available command options.

The environment node extends much of the required information gathered by the new project wizard, i.e., application name, directory mappings, data source connection, etc., by allowing you to specify variable settings for the SMTP mail server, Webmaster e-mail address, persistence preferences (session and/or cookie), minimum acceptable browser versions, enabling of error handlers, and whether or not to allow visitors to create their own accounts when visiting your site. All of the settings specified in this node are optionally written to the Environment.cfm file in the root of the application directory during code generation.

The database node expands downward two additional levels to include nodes for each of the tables in the database, and for the column and relationship attributes in each of the tables. Each table node allows you to specify the primary and alternate keys for each table as well as default singular and plural labels for framework references to the table in the application. Column nodes provide a form for specifying column labels, data type, default values, enumerated values, formatting functions, whether nulls are allowed, and finally, whether the value is issued by the database server or supplied by business logic. In the two latter instances, the column values can be displayed on forms, but input controls are not generated to prevent user input. Relations can also be created, but the database synchronization process handles this for you automatically. Relationships are already handled for you in most instances when Plum reads the database schema, but you can add or change relationships manually from the database node context menu. The settings in the database node are referenced by the IDE when building data pages.

The modules node is where you will spend most of your time in the IDE, building the forms for your application. Modules consist of pages (form containers) that are related by functionality, or similar security access restrictions. A page can contain multiple form types if desired. For instance, you can create a list form that also has an embedded search form on it, or an edit form which has a child list form on it (called a master-detail form), complete with built-in paging controls. Certain combinations are not allowed; you obviously can't have a child list on an add form, for instance. Pages can either be created individually, or you can have Plum generate standard or master/detail form sets for optionally selected tables at one time. It is quite a sight to see Plum generate all of the data maintenance forms for a module in just a few seconds! When you select a form on a page, a builder is presented in the top right frame that lets you choose the columns to be included in the form, as well as the control type and sort order for each column.

Building forms is an iterative process. Once you have a form built the way you think you want it, you generate the code for it and view it in your browser, come back into the IDE and tweak it some more, etc. At some point you may want to start placing your own handcrafted code into the page, or use one of Plum's custom tags that is not available in the IDE. This is the point at which you need to "divorce" the page from the IDE. Individual pages or entire modules can be locked down to avoid accidentally overwriting customizations.

The security node is where you create application roles and then assign users and modules to the role. Plum then generates the authentication code for each module. Roles are table driven, but not handled for you automatically. You will have to go into the User module on the admin side of your application and add each role code manually to the database.

Working Outside of the IDE
Plum's IDE generates code pages that leverage the extensive custom tag library included with the Plum Framework. Using the provided custom tag editors, it is very easy to create Plum pages and modules manually. The trick is to learn the proper nesting hierarchy of the custom tag calls. Once you master this, you can create pages very rapidly just using your code editor.

This comes in very handy when rapidly prototyping Plum applications that don't yet have a data model defined. The Plum Framework includes a component that creates sample data either programmatically or by retrieving data from text files. You can use this component to generate sample data in two ways: by using a QueryStub, which returns a query object based on passed data type parameters, or by using the sampleData attribute of the form and list-related tags. Prototyping in this fashion is like wireframing on steroids because all of the prototype code can be leveraged by simply changing the query calls.

Utilities
You can resynchronize your project with the database at any time by selecting an option from the Utilities menu, and the database tree nodes will be refreshed to reflect the changes to the data structure. One, many, or all of the tables can be imported into the project at one time. If an existing table structure has changed, you are notified with a dialog and given the option to accept or decline the changes to your project. Tables, columns, relationships, and their associated attributes can all be manually added to the tree as well.

If you are using MS SQL Server 2000 as your database server, you are in for a treat because you can have the Plum IDE create a complete set of insert, update, delete, list, and get stored procedures for you, one script for each designated table. These scripts are placed in the project's test directory, and can either be used as or as a starting point for further customization. While the stored procedures generated currently support single table operations only, and therefore won't work as is with some of the more complex Plum form types, this is still a very useful tool and an impressive feature for a 1.0 release.

You can further utilize the generated stored procedure scripts by having them converted to CFCs (ColdFusion Components) using the component generator. This tool encapsulates all of the stored procedures as methods calls in a component of the same name as the script, with a .cfc extension.

Unit testing is a popular practice in the OOP world, and involves designing and writing test cases which validate that class methods function properly and return valid outputs. The same principles can be applied to CFCs, although it can be a time-consuming and tedious process to write them yourself. The Plum IDE contains an internal facility that enables you to easily create and execute unit tests against your CFC methods. A series of dialogs allows you to visually build the tests, and the results are graphically displayed in your browser, along with the ability to drill down into the details of the result. This tool is useful if you plan on integrating additional components into the application.

The Framework

The Plum Framework comes with a core set of components, custom tags, and other supporting files that handle most of the heavy lifting required by all ColdFusion applications, including role-based security, data access and validation, structured exception handling, client/session management, browser detection, and layout management. An extensive, unencrypted custom tag library is provided to access the component methods. In fact, all of the code generated by the IDE consists of nothing more than custom tag calls (see Listing 1). There are so many custom tags and associated attributes available that using the provided tag editors is a must until you have spent some serious time using them (see Figure 2).

Forms
Plum's intelligent forms are feature rich and provide you with many options from which to choose. You can build forms that handle single table maintenance, parent-child, and/or many-to-many relationships, all on the same page if you prefer. You can create a stand-alone search form or a combination search/list form on one page. All of the common HTML form control types are supported and some of them have enhanced functionality. One of my favorites is the Filtered Select menu, which can either fully populate a Select menu from a parent lookup, or filter it (if the query results exceed a certain threshold) by collecting criteria from the user in a small text field to the left of the menu and then pressing Tab. This is very useful when dealing with parent lookups with very large tables. Both client-side and server-side form validation are automatically handled for you; the former uses an extended version of the popular qForms JavaScript library.

Content Management System
Plum integrates a rudimentary, but effective CMS into your projects. Most of the starter content generated for a new project is contained within the CMS to provide examples of how it works. As of this writing you could choose between HTMLArea and ActivEdit as the WYSIWYG editor, although efforts are already underway to adopt other commonly used editors that support other popular browsers like Firefox. Multipage content can be easily created with paging controls added to each page. Simple workflow management features are also provided.

Automated Verity Management
Forms are provided for you to automate the entire Verity collection creation, maintenance, and indexing operations. You can create multiple content collections and offer them independently for users to search through.

Clean Separation of Data, Logic, and Presentation
While not strictly adhering to the Model-View-Controller (MVC) design pattern popular in some other ColdFusion frameworks, Plum provides a nice and easily understood separation of the data, logic, and presentation tiers of your application. Plum's straightforward directory layout and file naming conventions make it easy to find and debug code.

Structured Exception Handling
Plum provides very robust structured exception handling with predefined enumerated exceptions that can be turned on or off by checking one box in the IDE (or by changing the associated variable in the Environment.cfm file). When turned on, Plum dumps the exception specifics into an e-mail notification to the Webmaster. You will want to turn the exception handler off when you are debugging pages so that you can view the raw error and avoid having your mailbox overrun with exception reports.

Security Model
You can easily require authentication to the module, page, or page section levels of your application with a single call to the cf_Authorize custom tag. The following tag call placed in the Application.cfm file for a module would authenticate a user against the ADMIN or PUBLISHER roles.


<cf_Authorize 
  roles="ADMIN,PUBLISHER" 
userMustBeAMemberOf="AnyOfTheseRoles">

Page sections can be restricted by using the cf_Authorize paired tag:


<cf_Authorize 
  roles="ADMIN,PUBLISHER"
userMustBeAMemberOf="AnyOfTheseRoles">

You will see me only if you're an ADMIN or a PUBLISHER.

</cf_Authorize>

The Plum Methodology

The Plum methodology takes a slightly different slant on system development that espouses quickness and simplicity. The Plum methodology is tightly coupled with the framework and is meant to help streamline Plum development with what is basically a 10-step process:
  1. Chart the business processes your application will support
  2. Derive the navigational interface from the business process charts
  3. Design the site content search structure
  4. Develop the graphical layouts
  5. Create the database
  6. Generate and tweak the administrative application
  7. Create the prototype pages
  8. Write the business logic
  9. Convert prototypes to the finished application
  10. Test and deploy
One of the interesting central themes of the Plum methodology is that documentation should be lightweight and code commenting should be kept to a minimum, arguing that it is more preferable to make the code as self-explanatory as possible and relegate extensive comments to the source control provider. This philosophy is totally counter to methodologies like FLiP, which promote documenting the functionality of the code before it is written. It's obviously up to you whether you adopt the Plum Methodology or not. While it is not imperative that the Plum Methodology be used with Plum, it is worth reading about it before making your decision.

Deployment

In dedicated host situations, the difference between a Plum application in a staging environment versus a production environment is the settings in the Environment.cfm file. So you should be able to upload your directory structure from the staging site to the production site, replacing the staging Environment.cfm file with one that has the correct values for the production server.

However, if you deploy the application to a shared host, there is a potential issue to contend with that involves custom tag mappings. CFMX cannot formally bind an instance of a custom tag to a particular application, so having multiple copies of the same tag name referenced in multiple custom tag paths results in CFMX not knowing which instance belongs with which application. To address this issue, Productivity Enhancement has provided a free utility called CF_2CFModule, which will convert all custom tag calls to CFMODULE="template" syntax, allowing the variable path reference to remain. To use CF_2CFMODULE, you simply drag and drop the root Plum project directory onto the CF_2CFMODULE.EXE icon, (after making a backup of course). You then deploy the converted directory.

Cut to the Chase

Plum could be the Swiss Army Knife of the ColdFusion world. It does just about everything you need, and does it well?for free. That's right! Plum can be used for free if you don't mind looking at one small Productivity Enhancement advertisement in the bottom left corner of the IDE. If you adopt it, you will want to do yourself a favor and pay the $79.95 for a licensed version so you can sleep better at night.

While there are some areas that need improvement, it's an awesome product for a first release. Unfortunately for some, Plum performs most of its magic on Windows. If you develop on Windows, you owe it to yourself to check it out. If you are developing on another platform, you will have to pray for Mono.

For a complete list of Plum offerings, visit www.productivityenhancement.com/plum/WhatPlumCanDo.cfm.

Vitals
Productivity Enhancement, Inc.
5806 Glenn Hollow Lane
Norcross, Georgia 30071
Office: 770-446-8866
Fax: 770-242-0410
www.productivityenhancement.com
Price: Free with banner ads displayed, $79.95 for licensed copy.

More Stories By Jeff Fleitz

Jeff Fleitz has been developing Web applications for over eight years and using ColdFusion since version 2. He is currently the director of Information Solutions for KR Systems, Inc., where he continues to develop applications for the federal government and maritime shipping industries. He has been involved with Plum since the first private beta.

Comments (0)

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.


IoT & Smart Cities Stories
In his general session at 19th Cloud Expo, Manish Dixit, VP of Product and Engineering at Dice, discussed how Dice leverages data insights and tools to help both tech professionals and recruiters better understand how skills relate to each other and which skills are in high demand using interactive visualizations and salary indicator tools to maximize earning potential. Manish Dixit is VP of Product and Engineering at Dice. As the leader of the Product, Engineering and Data Sciences team at D...
Bill Schmarzo, Tech Chair of "Big Data | Analytics" of upcoming CloudEXPO | DXWorldEXPO New York (November 12-13, 2018, New York City) today announced the outline and schedule of the track. "The track has been designed in experience/degree order," said Schmarzo. "So, that folks who attend the entire track can leave the conference with some of the skills necessary to get their work done when they get back to their offices. It actually ties back to some work that I'm doing at the University of San...
When talking IoT we often focus on the devices, the sensors, the hardware itself. The new smart appliances, the new smart or self-driving cars (which are amalgamations of many ‘things'). When we are looking at the world of IoT, we should take a step back, look at the big picture. What value are these devices providing. IoT is not about the devices, its about the data consumed and generated. The devices are tools, mechanisms, conduits. This paper discusses the considerations when dealing with the...
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...
Dynatrace is an application performance management software company with products for the information technology departments and digital business owners of medium and large businesses. Building the Future of Monitoring with Artificial Intelligence. Today we can collect lots and lots of performance data. We build beautiful dashboards and even have fancy query languages to access and transform the data. Still performance data is a secret language only a couple of people understand. The more busine...
If a machine can invent, does this mean the end of the patent system as we know it? The patent system, both in the US and Europe, allows companies to protect their inventions and helps foster innovation. However, Artificial Intelligence (AI) could be set to disrupt the patent system as we know it. This talk will examine how AI may change the patent landscape in the years to come. Furthermore, ways in which companies can best protect their AI related inventions will be examined from both a US and...
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.
Chris Matthieu is the President & CEO of Computes, inc. He brings 30 years of experience in development and launches of disruptive technologies to create new market opportunities as well as enhance enterprise product portfolios with emerging technologies. His most recent venture was Octoblu, a cross-protocol Internet of Things (IoT) mesh network platform, acquired by Citrix. Prior to co-founding Octoblu, Chris was founder of Nodester, an open-source Node.JS PaaS which was acquired by AppFog and ...
The deluge of IoT sensor data collected from connected devices and the powerful AI required to make that data actionable are giving rise to a hybrid ecosystem in which cloud, on-prem and edge processes become interweaved. Attendees will learn how emerging composable infrastructure solutions deliver the adaptive architecture needed to manage this new data reality. Machine learning algorithms can better anticipate data storms and automate resources to support surges, including fully scalable GPU-c...
Cloud-enabled transformation has evolved from cost saving measure to business innovation strategy -- one that combines the cloud with cognitive capabilities to drive market disruption. Learn how you can achieve the insight and agility you need to gain a competitive advantage. Industry-acclaimed CTO and cloud expert, Shankar Kalyana presents. Only the most exceptional IBMers are appointed with the rare distinction of IBM Fellow, the highest technical honor in the company. Shankar has also receive...