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.

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).

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.


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


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


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.


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.

Productivity Enhancement, Inc.
5806 Glenn Hollow Lane
Norcross, Georgia 30071
Office: 770-446-8866
Fax: 770-242-0410
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
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
At CloudEXPO Silicon Valley, June 24-26, 2019, Digital Transformation (DX) is a major focus with expanded DevOpsSUMMIT and FinTechEXPO programs within the DXWorldEXPO agenda. Successful transformation requires a laser focus on being data-driven and on using all the tools available that enable transformation if they plan to survive over the long term. A total of 88% of Fortune 500 companies from a generation ago are now out of business. Only 12% still survive. Similar percentages are found throug...
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.
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...
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...
The standardization of container runtimes and images has sparked the creation of an almost overwhelming number of new open source projects that build on and otherwise work with these specifications. Of course, there's Kubernetes, which orchestrates and manages collections of containers. It was one of the first and best-known examples of projects that make containers truly useful for production use. However, more recently, the container ecosystem has truly exploded. A service mesh like Istio addr...
Digital Transformation: Preparing Cloud & IoT Security for the Age of Artificial Intelligence. As automation and artificial intelligence (AI) power solution development and delivery, many businesses need to build backend cloud capabilities. Well-poised organizations, marketing smart devices with AI and BlockChain capabilities prepare to refine compliance and regulatory capabilities in 2018. Volumes of health, financial, technical and privacy data, along with tightening compliance requirements by...
Charles Araujo is an industry analyst, internationally recognized authority on the Digital Enterprise and author of The Quantum Age of IT: Why Everything You Know About IT is About to Change. As Principal Analyst with Intellyx, he writes, speaks and advises organizations on how to navigate through this time of disruption. He is also the founder of The Institute for Digital Transformation and a sought after keynote speaker. He has been a regular contributor to both InformationWeek and CIO Insight...
Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life settlement products to hedge funds and investment banks. After, he co-founded a revenue cycle management company where he learned about Bitcoin and eventually Ethereal. Andrew's role at ConsenSys Enterprise is a mul...