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.

 Microsoft Visual Studio 2010 Showcase
 Avaya Developer 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%.

Windows 7: From Beta to Final Code in One Year
Google Shows Off Chrome OS, Releases Source
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?
Fedora 12 Takes Aim at Linux Networking
Top Supercomputer Nearly Doubles in Speed
Fedora 12 Linux Tackles Virtualization
Apple Gives iPhone Developers App Status Tracker
Novell Sets OpenSUSE 11.2 Free

Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Exploring HTML 5's Audio/Video Multimedia Support
Overriding Virtual Functions? Use C++0x Attributes to Avoid Bugs.
Understanding the Cloud Computing Security Vulnerabilities
Cisco and IBM Target a Greener World
Upgrade to Visual Studio 2010 with the Ultimate Offer

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

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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