Comments
yourfanat wrote: I am using another tool for Oracle developers - dbForge Studio for Oracle. This IDE has lots of usefull features, among them: oracle designer, code competion and formatter, query builder, debugger, profiler, erxport/import, reports and many others. The latest version supports Oracle 12C. More information here.
Your Feedback
ColdFusion Developer's Journal News Desk wrote: Although earlier versions of ColdFusion supported Java objects and servlets to some degree, ColdFusion MX does so in a big way. This support opens up commercially available libraries to ColdFusion developers that were previously only available to J2EE shops. Moreover, you can now draw from an immense library of free code from within the Java open-source community. This availability greatly enhances the features of your own applications and speeds your ColdFusion-based solutions to market. Use these objects to provide back-end processing or user-interface functionality, or simplify coding CFM pages by supplementing ColdFusion functions and tags with Java TagLibraries.

The increasing integration of Adobe and former Mac...


ADS BY GOOGLE
Blog-N-Play.com
Anytime a feature of a framework gives me something for free that I don't need to manually implement I'm a happy camper. One such feature of ASP.NET MVC 2 is jQuery client-side validation. The
Flex Top Links You Must Click On !


Streamlining Application Development Using Struts in ColdFusion
ColdFusion MX supports Java objects and servlets in a big way

Although earlier versions of ColdFusion supported Java objects and servlets to some degree, ColdFusion MX does so in a big way. This support opens up commercially available libraries to ColdFusion developers that were previously only available to J2EE shops. Moreover, you can now draw from an immense library of free code from within the Java open-source community. This availability greatly enhances the features of your own applications and speeds your ColdFusion-based solutions to market. Use these objects to provide back-end processing or user-interface functionality, or simplify coding CFM pages by supplementing ColdFusion functions and tags with Java TagLibraries.

Of particular note is how ColdFusion MX hosts and runs the Apache Jakarta Project's Struts Action servlet. By implementing Struts, ColdFusion MX offers a Model-2 Model-View-Controller (or MVC) environment for ColdFusion applications. This article is based on an implementation that uses ColdFusion MX Enterprise Edition on a Windows server. ColdFusion MX Enterprise Edition includes an embedded J2EE server based on Macromedia JRun. In addition to hosting ColdFusion pages, Enterprise Edition can host JSPs and servlets. This article is also applicable to users running ColdFusion on third-party application servers, although directory and filenames will vary somewhat.

First I give a brief description of my recent project, which shows how Struts and other Java objects provided a timesaving solution to a ColdFusion project. Next I explain MVC architectures so that you can define the role that Struts plays in your application's architecture. Then you learn how to transition your own development into a Struts framework. Finally I give you a sample application to help you get started using Struts in your own environment. (Code for this article can be downloaded from http://macromedia.com/devnet/coldfusion/articles/struts.html.)

Background: Saving Time with Struts
My Company: I work for a firm that creates websites and web applications for a wide range of businesses. We support many technologies, including Java and ColdFusion. On Java projects, we capitalize on open-source projects to speed solutions to market. Over the years, we have accumulated a large library of Java applications, objects, and services.

In the Java arena, we have adopted the Struts framework for our web services. By using Struts to implement a true Model-2 MVC architecture, we can split work among our various groups. Our layout group is fluent in designing dazzling layouts using Macromedia Flash. Our business managers design conceptual business objects and workflow. Our developers use Struts to create in code the objects and flow described by the business managers. While the members of each group have great talents in their assigned areas, they require a cursory understanding of the others' ingredients to a web-based application.

Our Client: One recent client was an internal ColdFusion development shop for a large association of plastic surgeons. Their task was to create web-based services for their membership. The members use these services to promote their private practices to the public. The success of these developers is measured by the number of referrals that are driven by the website to the doctors' private practices. To do this, the association strives to be a clearinghouse from which potential patients can find the best doctor for their needs.

They run their website on Windows servers running ColdFusion MX Enterprise Edition. (They also happen to run CommonSpot, a content management package from PaperThin. They often import ColdFusion pages into CommonSpot for consistency with the rest of the site. However, CommonSpot integration is beyond the scope of this article.)

The Project: We had to create private photo galleries that users could access from a doctor's personal page. Doctors publish their most successful procedures using before-and-after photographs along with a description of the procedure. The reason for this is so that the public will view these images and be encouraged to contact the doctor's office for a consultation.

In addition, the association wanted to offer a general-purpose gallery to the public. By drawing customers to the site, the association would lead patients to a doctor's private page and hopefully generate a referral. This general gallery would be a subset of the best examples found among the members' private galleries.

This project offered us many challenges. First of all, the images were categorized by procedure, each of which had a unique HTML form to describe the patient, treatment, and results of the surgery. This form needed to be converted into a descriptive paragraph suitable for public viewing. Some form of template-technology would be required for that conversion.

Second, the images submitted by the members were typically simple downloads from a digital camera. These images came in various dimensions and resolutions and needed to be resized to standard dimensions before being stored on the servers. Additionally, photos needed to be watermarked with some sort of copyright text so discourage web surfers from appropriating them for their own uses.

Third, we needed to build in all the sorts of features you expect to find in a good online photo-gallery service: grouping, indexing, filtering, and so on.

The ColdFusion and Struts Solution: As with any business, competitive concerns and published timelines required our client to roll out these new services quickly and reliably. The services also needed to match the look and feel of the rest of the website. In addition, the workflow was still being "worked out" as development began.

By using Struts, we enjoyed all the benefits of MVC architecture: Our layout team started designing the pages that reflected the look and feel of the existing ColdFusion MX site while our developers created the Beans that maintained the photo gallery pages. They also started building the generic structures for the procedure forms. We created and modified the process flow through simple modifications to the Struts configuration file, and each team created independent timelines and contributed pieces to the project as they became available.

Java object support proved to be a great timesaver. In our private libraries, we already had a Java object that used the Graphics2D class to quickly complete the image-modification features. We implemented Apache Velocity (http://jakarta.apache.org/velocity/)to create the paragraph templates in record time. From an earlier contract, we already had a skeleton Struts service for creating a website photo gallery. In all, ColdFusion's support for Java and Struts allowed us to reuse code and work in parallel, effectively halving the time to complete the job.

(In all fairness, Macromedia technologies alone could have solved most of our requirements. ColdFusion pages, ColdFusion components, and Macromedia Flash components offer all the functionality we required. However, the ability to reuse open-source code, not to mention mine our private libraries, motivated many of our choices.)

Examining the Struts Framework's Usefulness
To understand what Struts is, it helps first to review the terms defining the Model-View-Controller (MVC) approach to application development (see Figure 1). When creating an application, the Model represents the information‹the logic‹that connects the information. To a Java developer, these roles are implemented by the storage media (such as database tables or data files) and the Beans that maintain them. To a ColdFusion developer, the model is supported by ColdFusion components and data sources.

The View is the interface used to present the model to users, or obtain input to maintain that model. To a web developer, this View is passed between web browsers and web servers as HTML pages and HTTP requests. Java developers create this interface using JavaServer Pages (JSPs), HTML, and JavaScript. ColdFusion shops use ColdFusion Pages (CFMs), HTML, and perhaps some JavaScript.

The Controller is responsible for directing traffic between and among the Model and View objects. As the View submits information, that information is passed to the Controller, which implements the proper Model object for manipulating or storing the data. The Controller might invoke a new View to provide user feedback on the Model's success or failure to process that information. Likewise, when the View requests information, the request is submitted to the Controller. The Controller calls the necessary Model(s) to get the information and then passes that information to an appropriate View object for display. How‹or perhaps I should say where‹this Controller function is implemented is what differentiates Model-1 and Model-2 implementations of the MVC design.

A full description of Model-1 and Model-2 MVC implementations can be found in Designing Enterprise Applications with the J2EE Platform, Second Edition by Inderjeet Singh, Beth Stearns, Mark Johnson, and the Sun Microsystems Enterprise Team. This book explains that in a Model-1 architecture, application flow is determined by the links embedded in the JSP or CFM pages; whereas in a Model-2 architecture, a servlet (Controller) is placed between the web pages (the View) and the business objects (the Model) to determine program flow.

So now with all that behind us, we can define Struts as follows: Struts is an implementation of the Controller functionality in a Model-2 MVC architecture.

The next logical question to ask is how do you apply these various roles of MVC architecture to the ColdFusion MX environment? And which ­ if any ­ of these architectures is appropriate for your project?

Applications created using JSP or CFM pages have a tendency to embed some of the business logic within the current page. Although it's possible to separate logic from Views, which are later combined using includes, it's not uncommon for developers‹especially during the final hours of development‹to embed small pieces of logic in the View layer. What's more to the point is that the command richness of both JavaServer Pages and ColdFusion MX allows developers to break rules. Because these types of applications are considered non-MVC conforming designs, they do not perform well over heavy loads. Non-MVC applications are perhaps most appropriate for prototypes and small-scale applications.

About Steve Belt
Steve Belt is a senior software developer for BrowserMedia, LLC, where he develops innovative software solutions for associations and finds new ways to use the Internet to make their lives easier. Before joining BrowserMedia, Steve led the development of several web-enabled tools and services used in the bioinformatics industry. Steve also participates heavily in several Java open-source projects.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Although earlier versions of ColdFusion supported Java objects and servlets to some degree, ColdFusion MX does so in a big way. This support opens up commercially available libraries to ColdFusion developers that were previously only available to J2EE shops. Moreover, you can now draw from an immense library of free code from within the Java open-source community. This availability greatly enhances the features of your own applications and speeds your ColdFusion-based solutions to market. Use these objects to provide back-end processing or user-interface functionality, or simplify coding CFM pages by supplementing ColdFusion functions and tags with Java TagLibraries.


  Subscribe to our RSS feeds now and receive the next article instantly!
In It? Reprint It! Contact advertising(at)sys-con.com to order your reprints!
Featured White Papers
Latest Flex Stories & Posts
'Scene7 has done a great job developing a sophisticated system that underpins the online delivery of high-fidelity imagery and dynamic assets,' said John Loiacono, senior vice president of Creative Solutions at Adobe.
Apple polished its reputation as a contrarian Tuesday when the news broke because of an SEC filing that it had hired Adobe’s CTO Kevin Lynch to be VP of technology and reportedly coordinate its hardware and software teams. Adobe confirmed his departure effective Friday, March 22. He ...
Companies that need to improve application performance, for example, in server virtualization or VDI environments, frequently come to the conclusion that flash is the best strategy. SSD technology is becoming the "go to" solution for enhancing the performance of these kinds of critical...
If you’ll ask me what would be a job that you always wanted but never got, I’d answered a Technical Evangelist for a large corporation. I know how to do it, I like travel, I like meeting new people, and I can convince that the software I believe in is good for you. But. I [...
Tоday I was participating in a discussion on one Java forum – the question was if Java is easy or difficult programming language to learn. IMO, Java is not difficult to lear, to teach, and to use. It’s a strongly-typed compiled language with tools that help you out to identify most of ...
Online learning company Lynda.com has gotten $103 million in funding from Accel Partners and equity investor Spectrum Equity. Meritech Capital Partners also participated. It’s the first money Lynda has taken from the outside and is meant to push the 17-year-old company into the inter...
Subscribe to the World's Most Powerful Newsletters

Developer Links You Must Click On !
'Scene7 has done a great job developing a sophisti...
Apple polished its reputation as a contrarian Tues...
Companies that need to improve application perform...
If you’ll ask me what would be a job that yo...
Tоday I was participating in a discussion on one J...
Online learning company Lynda.com has gotten $103 ...
Anyone who ever monitored or analyzed an applicati...
Wikibon produced an interesting material (looks li...
I hear people talking about how Solid State Device...
The International Trade Commission decided Wednesd...
Violin Memory, the high-speed flash memory array m...
In the past I have had Photoshop loaded on my comp...
Adobe Systems Incorporated has reported financial ...
We’re starting to writing a book for O’Reilly that...
Yesterday I had to record a 2-hour long webinar. T...
I’m a partner in two companies – an IT consu...
People are accustomed to buying goods online. If a...
Oh, the ignominy of it. A UK judge has told Apple ...
World IPv6 Launch: June 6: The Internet Society, a...
I’ve been using Firefox on my Mac as my defa...
ADS BY GOOGLE

Product Reviews
In the past I have had Photoshop loaded on my computer, but I rarely used it unless it was to use the autocorrection features. Each year I have a ton of vacation pic...
If you still can not adopt reading books from your computer screen, or do not like to waste your laptop battery charge for just reading a book, then I think Amazon K...
This article is the first of two that will look at some of the challenges faced by developers and non-developers who work with PDF technologies and who are curious a...
The goal of this article is to give you a brief overview of some of the objects from clear.swc, which is a part of the open source Clear Toolkit Flex framework avail...
Live Cycle Data Services is an excellent solution for building scalable RIA, but it’s not cheap. For those who don’t have a budget for LCDS, Adobe has released open...