advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement


Tutorials : Taking Java to new levels with the Macromedia MX initiative :

Taking Java to new levels with the Macromedia MX initiative

By: Jeremy Petersen

Earlier this year, Macromedia unveiled its MX initiative. The MX initiative is billed as an "integrated family of client, tool, and server technologies" that is built on a Java foundation. Chances are most Java developers are not aware of what this means for them. In other words, as a Java developer, what can MX do for you? The answer in short is a great deal! In fact, not only can MX technology improve the speed in which you develop your Java based web applications, but it can also help you create a truly rich user experience. To better illustrate how MX technologies can compliment Java, this article will explore 2 key areas: Server-side MX technology, and client-side MX technology.

Server-side MX technology

Server-side MX technology is based on Macromedia’s ColdFusion application server. For those not aware of what ColdFusion is, ColdFusion is a rapid scripting environment- an early predecessor to JSP. ColdFusion has been around since 1995, and has developed a large and loyal following. In the past, ColdFusion would be considered a direct competitor for JSP technology, but with the introduction of ColdFusion MX, that is no longer the case. In the past, ColdFusion was a proprietary technology, but those days are gone as ColdFusion MX now sits on top of the powerful Java 2 Enterprise Edition (J2EE) platform. To date, versions of ColdFusion MX have been announced that will run on Macromedia JRun, IBM WebSphere Application Server, and the Sun ONE Application Server (formerly iPlanet). To make a long story short, ColdFusion is now part of the Java fold. More specifically, ColdFusion Markup Language (CFML) code now compiles to a Java Servlet just like a JSP. Among many other benefits, this means that now ColdFusion MX can share persistent variables with Java, use Java custom tag libraries, objects, EJB’s, etc.

So far this sounds like a great deal for ColdFusion developers, and it is. But what about Java developers? What does ColdFusion MX do for you? ColdFusion has many features that are well worth documenting, but without turning this article into a full-blown ColdFusion marketing piece, we will focus on 1 single reason why you may want to use ColdFusion to compliment your next Java based application. This single reason we will focus on is the fact that ColdFusion is a Rapid Application Development (RAD) technology. Simply put, ColdFusion is very easy to learn, and very easy to code, and in most all cases empowers you to code using fewer lines of code then any other technology available. These are bold words, but they are easy to prove with some code samples. Lets take three common tasks and see what they look like in CFML code. The three tasks we will use are: Reading a text file and displaying the results, querying a database and displaying the results, and both exposing and consuming a web service.

Reading a text File and displaying the results

<CFFILE
    ACTION="read"
    FILE="MyText.txt"
    VARIABLE="myFile">
   
<CFOUTPUT>#myFile#</CFOUTPUT>

Querying a database and displaying the results.

<CFQUERY NAME="Company" 
           DATASOURCE="yourDB" 
           USERNAME="username" 
           PASSWORD="password">
    SELECT VendorID, VendorName 
    FROM tblVendor
    ORDER BY VendorName
</CFQUERY>

<CFOUTPUT QUERY="Company">
        #VendorName#:  #VendorID# <BR>
</CFOUTPUT>

Exposing a web service using CFML*

<CFCOMPONENT>
  <CFFUNCTION NAME="echoString" 
                       RETURNTYPE="string" 
                       OUTPUT="no" 
                       ACCESS="remote">
    <CFARGUMENT NAME="input" type="string">
    <CFRETURN arguments.input>
  </CFFUNCTION>
</CFCOMPONENT>

* The WSDL is automatically generated by ColdFusion, so this is really all there is to it!

Consuming the above sample web service using CFML

<CFINVOKE 
  WEBSERVICE = "URLtoWSDL" 
  METHOD = "echoString"
  INPUT = "Hello World!"
  RETURNVARIABLE = "results">
These quick samples show how easy it is (and how few lines of code it takes) to use CFML. So how might you capitalize on the RAD capabilities of ColdFusion MX in your next Java project? Some ideas that come to mind include:
  1. Coding proof of concepts, or smaller projects that don’t have a large design or development time budget.
  2. If you are using a tiered approach for larger applications, ColdFusion MX is the perfect technology to use for displaying logic and encapsulation layers.
  3. Working in less experienced developers who may face a sharp learning curve with Java.
  4. Bypassing JSP’s completely.
 

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 BlackBerry Application Development Resources
 Microsoft Visual Studio 2010 Showcase
 MSDN Spotlight
 PHP for Windows Showcase
XML error: undefined entity at line 39
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

ActiveState Debuts Open Source Business Suite
Salesforce Offers Visual App Builder
Codesion Steps Out From CVS's Shadow
Facebook Makes Major PHP Push With HipHop
Free Ride Over for Microsoft Azure Users
Drupal Opens the Garden to Boost CMS
Oracle Talks Plans for Linux, Solaris
Azure Makes Cloud Computing Innovation Safe
Red Hat's JBoss Looks Ahead
Microsoft Readies Two Windows Phone Systems?

Apple Surveying iPhone Developers? Happiness With The App Store
HTML 5 Leaves Client Storage Open to Web Attacks
Basic Market Forecasting with Encog Neural Networks
Location-Aware App Review
The Future of Web Content -- HTML5, Flash, and Mobile Apps
Moonlight 3.0 Preview Offered For Rich Internet Apps on Linux and Unix
Why a Moderator is Key in the Engineering Review Process, Part II
Windows 7 Features Your Clients Will Need on Day One
What Your Clients Will Ask About Windows 7
Melissa Data Helps Developers Improve the Quality of Business Data

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers