• Like
(Web site).doc
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

(Web site).doc

  • 8,742 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
8,742
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
1
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. JAVA 2 PLATFORM ENTERPRISE EDITION J2EE Submitted by: Nimisha Bajwa Greg Boutain Letisha Larson Dragana Lojanica Gretchen Stoltz MIS 375 December 18, 2002
  • 2. Introduction Java is a language that enhances current Internet and World Wide Web capabilities. It makes it possible to program for the Internet by creating applets. Applets are programs that can be embedded into a Web page. But Java technology is far more than a programming language for writing applets. It is also being used for writing standalone applications. With the development of Java 2 SDK and Enterprise Edition, Java technology is becoming more and more pervasive in the enterprise arena. Our research is geared toward the understanding of Java 2 Platform Enterprise Edition, what is it and some of its components. First introduced by Sun Microsystems in late 1999, the Java 2 Platform Enterprise Edition (J2EE) defines architecture for developing complex, distributed enterprise Java applications. J2EE was born in an effort to align Java technologies and Application Programming Interfaces (API’s) together in order to develop specific types of applications. “Java Server technology consists of Java-based frameworks and API’s that together provide a versatile combination, capable of building many kinds of server applications that are portable and scalable” (Introduction to Java Servers). Java’s portability comes from being able to write programs on the server side only once and then these programs can be run anywhere. For example, code could be written on laptop computers and then transferred to mainframes to speed up the development. One of the strengths of the Java Web Server is the provision of three- layer container for applications. “The outermost layer is the Java Server, 2
  • 3. which contains a service, which surrounds the Servlet API, which, in turn, surrounds the code for an application” (Woods, Pekowsky & Snee 4). Java Web Server has a lot of powerful features such as security, extensibility, easy of configuration and managing, ability to integrate with the HTTP protocols, and Java Server Pages. Java Server Pages (JSP) is a scripting capability built on Java Servlets. “JSPs technology allows Web developers and designers to rapidly develop and easily maintain, information-rich, dynamic Web pages that leverage existing business systems” (Dynamically Generated Web Content). So, before going into JSP, servlets need to be explained as well as understood. Servlets One of the most frequently used J2EE components found on the World Wide Web today is servlet. Actually, servlets helped make many Web applications possible. They are platform independent Web components capable of generating dynamic content. “They provide an effective mechanism for interaction between the server-based business logic and the Web-based client” (Ahmed & Umrysh 17 – 18). Servlets are best used to handle simpler tasks such as checking for valid inputs from the entry fields on a Web page. They are designed specifically to process Hypertext Transfer Protocol (HTTP) requests coming from the Web client and pass back a response. Servlets together with JSP technology provide a very attractive alternative to other types of dynamic Web programming by offering enhanced performance, platform independence, separation of logic and content, and the most 3
  • 4. important of all, ease of use (Dynamically Generated Web Content). “A servlet can almost be thought of as an applet that runs on the server side – without a face” (The Power Behind the Server). Java Server Pages JSP’s are another type of J2EE Web component that have been evolved from servlet technology. JSPs provide a simplified and fast way to create Web pages that display dynamically generated content. With JSP it is much easier for members of a Web team to maintain the portions of the system that support Web page presentation without requiring them to be traditional programmers. Using JSP technology the user interface can be separated from the content generation therefore enabling designers to change the page layout without compromising the content. Because of this separation, it is much easier and faster than ever to build Web applications. JSPs permit Java code to be embedded within a structured document such as HTML (Hypertext Markup Language) or XML (eXtensible Markup Language). The current version of JSP has an XML compatible syntax. It uses XML tags to encapsulate the logic that actually generates the content for the Web Page. “The application logic can reside in server-based resources such as Java Beans” (The Power Behind the Server) that can be accessed with XML tags. Here is the example that illustrates how Java Server Pages works. First, if we wanted to write a “Hello World” application that would include the date the page was generated when printed without Java Server Pages this is what we would have to write: 4
  • 5. “import Java.util.Date; import Java.text.*; import Java.io.*; import Javax.servlet.*; import Javax.servlet.http.*; public class HelloWorldDate extends HttpServlet { public void service (HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException { //Set header for output res.setContentType (“text/html”); res.setStatus (res.SC_OK); ServletOutputStream out = res.getOutputStream ( ); DateFormat df = DateFormat.getDateTimeInstance ( ); out.println (“<HTML>”); out.println (“<HEAD><TITLE>Hello World Date</TITLE></HEAD>”); out.println (“<BODY>”); out.println (“<H1>Hello World on” + df.format (new Date ( ) ) + “</H1>”); out.println (“</BODY>”); out.println (“</HTML>”); out.close ( ); } }” (Woods, Pekowsky & Snee 104-105). This code is mostly dedicated to printing out HTML statements after the time and date is added to the application. However, this is a very lengthy and complex code if only a simple change is required in an HTML document. Therefore, changes have to be made by programmers because there is a need to know how to change the program as well as how to compile it. To write the same code that will execute the same thing using Java Server Pages is the following: “%@ import=”Java.util.Date”%> <%@ import=”Java.text.*”%> 5
  • 6. <HTML> <HEAD><TITLE>Hello World Date</TITLE></HEAD> <BODY> <% DateFormat df = DateFormat.getDateTimeInstance ( ); %> <H1>Hello World on <% out.println (df.format (new Date ( ) ) ); %> </H1> </BODY> </HTML>” (Woods, Pekowsky & Snee 105). If we compare the previous two code applications, we can see that the second one is much more like an HTML file than a program. However, it does have program-like elements but is much simpler and easier to write than the first program. “The tedious repetition of out.println statements is avoided at the expense of encapsulating all Java statements inside the <% %> brackets” (Woods, Pekowsky & Snee 106). The next question is how could this JSP file be served to the user because if we would name this file as .html document it would not work properly as the code would never be compiled nor executed. We need a translator that would read the HTML and Java statements and translate them into out.println ( ) statements. This is exactly what the JSPServlet does. The JSPServlet takes the HTML code outside the <% %> brackets which enclose Java code and places it inside out.println ( ) statements. Then, it copies the Java code within the brackets into the file but <% %> brackets are not copied. JSP files have *.JSP extensions. Figure 1.1 explains the steps for executing a JSP. First, after the user requests a JSP, the JSPServlet which acts like a translator looks to see if the page has been compiled. If it is compiled, the JSPServlet has to check and see whether it has been changed or not since it was last compiled. If it has been 6
  • 7. changed since it was last compiled it is recompiled and if it does not have to be compiled, as it didn’t change, it can be executed immediately. Also, if it does not have to be compiled before it is executed, it takes less time to serve the page. Because of this, most of the time, the pages will be compiled before they are requested as to make the response time quite speedy. Figure 1.1 JSP JSPServlet structure (Woods, Pekowsky & Snee 107). Is the Page User Requests Compiled into a JSP a Servlet? No Yes Is the JSP Compile a JSP Page No Page into a Servlet Unchanged Yes Execute the Servlet 7
  • 8. A JSP consists of two basic items: template data and JSP elements. Template data provides the static aspects while on the other side JSP elements are used for the dynamic aspects of a JSP. JSP elements represent the portion of the JSP that gets translated and compiled into a servlet by the JSP compiler. In a sense, JSP elements are very similar to HTML elements. There are three types of JSP elements: directive, action, and scripting elements. Directive elements are very general in nature. It means that they are not related to any specific request; they just provide overall information for the translation phase. Using directives one can tell where the JSP engine is located even before it is assembled. Also, directives can tell whether there is a session in use or not as well as how to handle errors in case they occur while running the JSP. Using directives is very simple; there are only three directives according to the JSP Syntax Reference (Development of the JSP/Servlet Platform). The three previously mentioned directives are page, include directive, and taglib directive. A directive includes <% %> brackets and places @ in front of the directive name. For example, the following <%@page language = “Java”%> is a page directive, with attribute value of Java that is enclosed between the quotation marks and with language as a directive attributes. The include directive lets one insert a file into the servlet at the time the JSP file is translated into a servlet and taglib directive helps one to define its own customized tags. Unlike directives, action elements come into play during the special request-processing phase. Actions provide JSP running time behavior and 8
  • 9. specify the existing components that should be used. An example of the action element is <JSP:forward page = “URL address”/>. Action elements prefixed with JSP are standard actions such as forwarding request to another page as in our example. Finally, scripting elements bring everything together in a JSP. The scripting elements can be declarations that define variables and methods, expressions that are used for evaluation of the request-processing phase, and scriptlets that represent mini codes embedded within JSP. Declarations have the following syntax <%! Code %>. They do not generate any output and therefore are only used in conjunction with expressions or scriptlets. The syntax of expression is <% = Expression %> and is used to insert values directly into the output. “The Java expression is evaluated, converted to a string, and inserted in the page” (Java Server Pages (JSP) 1.0). Finally, if we want to perform a more complex task instead of just simply inserting an expression into a page, we can use scriptlets. They have the following form: <% Java Code %>. Scriplets can contain expressions and declarations of variables. Also, like expression, they are performed at request-processing time (when the page is requested). JSP technology is evolving everyday. There is a new JSP 2 being developed with some features not available in the first version of JSP. Some of the new features are simple tag extensions and the JSP Expression Language (JSP EL), which can be used instead of scriptlet expressions. With simple tag 9
  • 10. extensions, the amount of code needed to write powerful web applications will be reduced. Java Server Faces Technology Java Server Faces technology is used to simplify the process of building the user interface for Java Server applications. “With the well-defined programming model that Java Server Faces provides, developers of varying skill levels can quickly and easily build Web applications by assembling reusable UI, [user interface], components in a page, connecting these components to an application data source, and wiring client generated events to server-side event handlers” (Java Server Faces Technology). Java Server Faces technology is a very powerful way to handle the complexity of user interface. This is a programming model that can be used by any Web page developer, including those that have no programming background, to link the application codes without writing any scripts. Java Server Faces technology is designed to be very flexible with no limits to a particular mark-up language, certain protocol or special client device. “Java Server Faces technology includes: • a set of APIs for representing UI components and managing their state, handling events and input validation, defining page navigation, and supporting internationalization and accessibility, [and] • a Java Server Pages custom tag library for expressing a Java Server Faces interface within a JSP page” (Java Server Faces Technology). 10
  • 11. Java Server Faces technology are a very powerful tool for handling the user interface on the server therefore allowing the application developers to focus only on the application code. Java Server Pages are modeled as being composed of two distinct conceptual elements. These two elements are the client page and the server page. “A JSP is really a hybrid between a Web page for the client side and some logic that executes on the server side” (Ahmed & Umrysh 166). The client side and the server side have a special relationship among themselves that is defined as a build relationship. A “build” relationship means that the server side builds a client page and formulates a result in HTML or XML and sends it to the browser, which originally sent the request from the client side. Furthermore, JSPs provide very effective yet simple vehicle for the interaction with end users. To understand how JSPs are used in applications, let’s start with the example of a simple, dynamic billing form. A billing Web page is an appropriate means for presentation to the user when the user attempts to register for certain activity or service via the Internet and wants to make a payment by using a credit card. We create a servlet to handle the processing of the billing form. The following is the example of the written JSP code as well as the result of the dynamic form once the code is executed. Listing 1: dynamicForm.JSP (JSP: Creating Dynamic Forms) 1: <HTML><HEAD><TITLE>Dynamic Form</TITLE></HEAD> 2: <BODY> 3: <B>Form</B> 4: <FORM ACTION=dynamicForm.JSP METHOD=POST> 5: <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0> 11
  • 12. 6: <% String[] textFields = {"FirstName","LastName","Address","City","Zip"}; 7: for(int j=0; j<textFields.length; j++){ %> 8: <TR> <TD> <%=textFields[j]%>: </TD> 9: <TD> <INPUT TYPE=TEXT NAME=<%=textFields[j]%>> </TD> 10: </TR> 11: <% } %> 12: <TR> <TD> State </TD> 13: <TD> <SELECT NAME=State> 14: <% String[] states = {"AZ", "CA", "NM", "MA", "ME", "MD", "..."}; 15: for(int s=0; s<states.length; s++) { %> 16: <OPTION><%=states[s]%></OPTION> 17: <% } %> 18: </SELECT></TD> 19: </TR> 20: <TR> <TD> Card Number </TD> 21: <TD> <INPUT TYPE=TEXT NAME=cNumber></TD> 22: </TR> 23: <TR> <TD> Card Type </TD> 24: <TD> <SELECT NAME=CardType> 25: <% String[] cTypes = {"Amex", "Visa", "Master Card", "Discovery", "..."}; 26: for(int t=0; t<cTypes.length; t++) { %> 27: <OPTION><%=cTypes[t]%></OPTION> 28: <% } %> 29: </SELECT></TD> 30: </TR> 31: <TR> <TD> Expiration Date (MM/DD/YYYY) </TD> 32: <TD> <INPUT TYPE=TEXT NAME=cMonth SIZE=2><INPUT TYPE=TEXT NAME=cDay SIZE=2> 33: <SELECT NAME=cYear> 34: <% int startYear = 2000; 35: int endYear = 2010; 36: for(int y=startYear; y<endYear; y++) { %> 37: <OPTION><%=y%></OPTION> 38: <% } %> 39: </SELECT></TD> 40: </TR> 41: </TABLE> 42: <INPUT TYPE=SUBMIT VALUE=Submit> 43: </FORM> 44: <HR> 45: <B>Form Content</B><BR> 46: <TABLE> 47: <% Enumeration parameters = request.getParameterNames(); 48: while(parameters.hasMoreElements()){ 49: String parameterName = (String)parameters.nextElement(); 12
  • 13. 50: String parameterValue = request.getParameter(parameterName); %> 51: <TR> 52: <TD><%=parameterName%></TD> 53: <TD><%=parameterValue%></TD> 54: </TR> 55: <% } %> 56: </BODY></HTML> The dynamic form.JSP is the entry point. It builds the login client, which includes a dynamic form to allow the user to enter information. When the 13
  • 14. form is filled in and submitted by the user, the servlet processes it and if there is a problem it will display an error message. JSP technology is designed to be an open, standard method supporting numerous servers, browsers and other programming tools. JSP speeds development of web applications by reusing tags and user interface components, instead of relying heavily on scripting within a page itself. Sharing characteristic of “write once, run anywhere”, JSP is a key component in the Java 2 Platform Enterprise Edition, Sun’s highly scalable architecture for enterprise applications (Java Server Pages: Dynamically Generated Web Content). ColdFusion Another component of J2EE is ColdFusion. ColdFusion is a commercial Web application designed for creating dynamic, interactive Web pages. ColdFusion is very similar to Java Server Pages, as discussed earlier in this document, although ColdFusion is primarily used for developing database applications while JSP is primarily used for Web applications. Organizations can implement ColdFusion or Java Server Pages into their Web site to enhance their Web presence, integrate logic, and build fun, functional Web pages. Which one they choose depends on the individual need. In the online book, The Cold Fusion Web Database Construction Kit, the authors emphasize that users of ColdFusion are able to create ‘dynamic data- driven’ Web sites, avoiding the use of static pages or fixed text images. Users are able to collect, read and write information in other applications, and even 14
  • 15. design and create their own full-blown applications. ColdFusion is enabled to be compatible with the Java J2EE service platform, “add[ing] rapid server scripting capabilities to the J2EE infrastructure, while increasing development productivity and enjoying full access to the powerful J2EE platform” (CFMX for J2EE). ColdFusion is built with the standard HTML, (Hypertext Markup Language), but is able to communicate with XML, (Extensible Markup Language), WML, (Wireless Markup Language), JavaScript, and other Web languages as well. Macromedia, who has recently merged with Allaire, the original creator of ColdFusion, has created its own version of the application, called ColdFusion MX. This product includes the Macromedia Flash Remote component, which is used to build rich Internet applications. In the article, A Striking Balance, Tom Yager explains the compatibility of Macromedia’s Flash Remote components, including ColdFusion MX. He verifies that the new Macromedia MX applications run on both Windows and Macintosh systems and support several Internet applications environments. Yager continues to explain that “the ColdFusion MX scripting server runs stand-alone, linked to a J2EE application server such as IBM, WebSphere, or paired with Microsoft.Net.” ColdFusion MX and the original ColdFusion support the same fundamental functions, assuming this, we will focus on the purposes, the operations and how the software is implemented, encompassing both ColdFusion and the MX version created by Macromedia. 15
  • 16. Macromedia describes their product as providing an additional platform for existing ColdFusion developers to apply their skills and establish their ColdFusion applications. “ColdFusion MX can be configured to use your J2EE application server’s session management, enabling the user to share any session data with other JSPs or servlets” (JDJStore.com). In a recent article, IBM, Sun court Macromedia, Patrick Dorsey, the Group Marketing manager for application and Web server products states that this creation, ColdFusion MX, will combine ColdFusion and Java together, making it easier for ColdFusion developers to use Java. ColdFusion software was designed to improve Web pages, eliminating static pages with fixed text. Web pages have the ability to become multifunctional, displaying information as well as communicating with other databases without manual intervention. In the online book, The Cold Fusion Web Database Construction Kit, Crawford has supplied a list of features in which the ColdFusion software can perform. Among the features are, “The ability to query existing database applications for data, the ability to create dynamic queries facilitating more flexible data retrieval,[and] the ability to customize the display of dates, times, and currency values with formatting functions.” ColdFusion also has similar attributes to Java Server Pages, in the ability to run if/then statements as well. Further benefits of ColdFusion are the ability to execute conditional code on-the-fly and to customize responses for specific situations. ColdFusion MX also possesses the capability of ‘Internationalization,’ in which the application is able to translate and support 16
  • 17. various global languages, “non-Latin languages, such as Chinese, Japanese, German, (etc…), with built-in support for Unicode encoding” (CFMX for J2EE). With many more functions for use, the logic within ColdFusion is not at all limited. The tools and capabilities are endless. Traditional Web pages consisted of still, ‘static’ text. Static Web pages differ greatly from dynamic Web pages in the fact that they contain mainly text and images. Dynamic pages only require a small amount of actual text. ColdFusion dynamic pages are concentrated to extract and use data from other applications, and already existing client-server database systems in order to complete specific functions. ColdFusion has the “ability to execute stored procedures in databases that support them” (Crawford et al). Static pages were manually created with traditional programming languages. If information was to change, the Web page had to be manually updated. This process included various steps, such as, “first transferring the page into an editor, making the needed adjustments, reformatting the text if needed, and then saving the file” (Crawford et al.). By the time the static pages are updated, the ‘new’ information may already be ‘out of date.’ ColdFusion Web pages remove this tedious process by eliminating the need of traditional programming practices; “the [ColdFusion MX] pages execute on the Java application server, taking advantage of the high performance and reliability of the enterprise-class platforms” (CFMX for J2EE). Because ColdFusion pages query existing database applications for data, there is no manual updating needed, resulting in real-time information. Consequently, 17
  • 18. time can be managed and used in an appropriate and efficient manner when implementing the ColdFusion application. Mohnike, of HotWired.lycos.com, explains the process of the installation process of the ColdFusion software. The user is required to have ODBC, (Open Database Connectivity Server), accessible database, and driver, which is an application server that can connect to external databases. Upon meeting the previous mentioned requirement, the remaining process is very simple. Basically, installing ColdFusion is considered to be comparable to installing any other commercial based software application. The user follows the prompts received and reboots the computer. Once installed, the user selects the database source name, DSN, via a prompted Web page interface. The templates used in ColdFusion, as mentioned above, are modeled after the HTML pages, which makes the application straightforward, effortless to learn, and easy to apply. Due to the large scalability of ColdFusion, one template may be used for all of the user’s information, instead of having to create a separate page for various items. ColdFusion programming language is designed to extend HTML style tags. The language is called CFML, ColdFusion Markup Language, and is simply modeled after Hypertext Markup Language. ColdFusion integrates special tags that communicate to the application to perform specific functions and operations. ColdFusion tags are easily recognized; they all begin with the letters ‘CF,’ for example, <cfmail> and <cfoutput>. When programming ColdFusion, the user does apply standard SQL and HTML programming 18
  • 19. languages, CFML helps to distinguish between the parameters of these languages. The templates of ColdFusion all use the file extension of .cfm. “Essentially, a template is a standard HTML page with some extra coding inserted before the <HEAD> tag. This code tells ColdFusion which data source the user wants to access, and sets up variables that will be used further down the page in the actual HTML code.” In addition, the ColdFusion variables are always surrounded by pound signs (Crawford et al.). The information requested between the pound (#) signs is the information that is being extracted, in essence, what is being obtained. The user has the advantage to customize these tags in accordance to their needs. All that is needed is the <cfoutput> tag and the name of the defined query and the user is able to retrieve any information he or she requests. From there, within the database, the user may choose to enable or disable the options within the fields given in each Attributes table. The following three examples are courtesy of Charles Mohnike, from the ColdFusion Tutorial. This first example shows the query name as, “pocket,” from the data source of “contents of my pocket.” The name of the template must match the name in the <cfoutput> tag. “Contents of my pocket,” is the primary information requested. “Select” in the example is standard SQL programming language, indicating that the information requested is retrieved from all of the fields within “contents.” 19
  • 20. <CFQUERY NAME= "pocket" DATASOURCE= "contents_of_my_pocket"> SELECT * FROM contents </CFQUERY> If the user were to access the information above, he or she may possibly retrieve the following data: A Bus Transfer 14 December 1998 One Plastic Baggie, Empty 12 December 1998 A Ticket for Having an Unleashed Dog in the Park 12 December 1998 The next template example tells ColdFusion to select all the records from a specified date. ColdFusion is requesting the information from the table ‘Contents,’ where the field acquired exactly matches the text, “12 December 1998.” <CFQUERY NAME= "pocket" DATASOURCE= "contents_of_my_pocket"> SELECT * FROM contents WHERE acquired IS "12 December 1998" </CFQUERY> The feedback resulting from this query would be: One Plastic Baggie, Empty 12 December 1998 20
  • 21. A Ticket for Having an Unleashed Dog in the Park 12 December 1998 To show how functional and specific the user may be, the following is yet another example of the versatility of ColdFusion. In this example, the user is requesting to select “contents of my pocket” that only begin with the letter “b.” <CFQUERY NAME= "pocket" DATASOURCE= "contents_of_my_pocket"> SELECT * FROM contents WHERE item LIKE "%b%" </CFQUERY> ColdFusion can also be programmed to reply to a user by sending an e- mail message based on a specific query or enabled attribute field. The following example is from the online book, The Cold Fusion Web Database Construction Kit. The authors show that with the <cfmail> tag attributes enabled, ColdFusion is able to send or reply automatically to anyone who accesses their Website. The example shows that the responding letter sent from the Website to the frequent user can be personalized to present added comfort to the user as well. <CFMAIL QUERY="MailingList“ FROM="sales@a2zbooks.com" TO="#EMailAddress#" SUBJECT="Monthly Online Newsletter“ > Dear #FirstName#, This e-mail message is to remind you that our new monthly online newsletter is now on our web site. 21
  • 22. You can access it at http://www.a2zbooks.com/newsletter Thanks for you continued interest in our product line. A2Z Books Sales </CFMAIL> In the world today, security is a major factor. There are many companies that are actively involved with e-commerce. There are also many consumers who use the Internet for various practices, such as purchasing and selling items, and do online banking. Both consumers as well as companies doing business trust that the information being passed through the World Wide Web is kept personal, and used specifically for the purposes requested. Security is an unprecedented requirement today. Originally, ColdFusion was based on a script within a CGI (Common Gateway Interface) program. Security was a large threat, hackers were able to manipulate and sabotage the CGI programs. “Hackers have discovered that they can attack these programs and scripts in a variety of ways by inputting invalid data, ultimately, disrupting the program within the Unix Web server to list the contents of password files and retrieve sensitive information” (Turban et al. 559). Improvements were implemented within the ColdFusion application, as a result, security can be managed, and additional controls may be set. The applications within the Java server are controlled by J2EE security settings. Macromedia has created “Server Sandbox Security… secure shared hosting environments with directory-based access control for tags, functions, data sources, and IP addresses” (macromedia.com). ColdFusion also has the advantage of configuring custom ‘probes’ to monitor server activity and react with automatic alerts. 22
  • 23. ColdFusion is very user-friendly, easy and quick to learn. The complication of creating a web page with ColdFusion is decreased dramatically. When using ColdFusion to create a web page, the user no longer needs to have the pre-required knowledge of UNIX and traditional scripting languages. As mentioned above, ColdFusion also integrates with various Web languages such as XML, WML and JavaScript. The software “contains all the processing and formatting functions needed, provides all the tools needed to troubleshoot and debug applications, and can link to almost any database application” (Crawford et al). There are also telephone and online sources that may be contacted for further troubleshooting. Although there are great benefits and competitive advantages among the users of ColdFusion, there may be obstacles as well. For example, the barrier of high cost of the application. According to Macromedia JDJStore.com, pricing for ColdFusion MX can range from $550.00 to more than $7000.00. For large corporations, this investment will be easily recovered within a short time period. For the smaller companies, with the advantages and options the application offers, making the purchase may be a risk worth taking in order to expand and create a genuine Web presence. The opportunity cost involved may or may not outweigh the cost depending on the results obtained from the user. A multitude of companies, such as AFLAC, Bank of America, Pepsi, Macy’s, and the FDA, along with many others, have implemented the advantages of ColdFusion. ColdFusion can be used to improve all types of 23
  • 24. Websites for all types of companies, from advertising products to promoting services. Ben Forta of Forta.com states that, “ColdFusion is used by over ½ million developers on over 60,000 servers, making it the most popular commercial cross-platform application server on the market.” In addition, there are many Web providers that offer the ColdFusion services, (Mohnike). Within an organization, ColdFusion could be installed to perform “Manipulation Functions, such as text parsing, comparison and conversion functions, Mathematical Functions, and various other System Functions” (Macromedia CFMX). Organizations are not limited in their use of ColdFusion with the Internet alone. ColdFusion can also be implemented within an Intranet as well. This is yet another advantageous tool, of which, can be used within the LAN firewalls of an organization to bridge communication, or convey information. The technology operation and consistency of ColdFusion is seemingly boundless. ColdFusion MX pages “ensure high performance and reliability by leveraging the full power of the Java Technology platform, saving the expense of the time and money it would cost to implement a ‘pure Java’ solution- and they can deploy it to their J2EE standard” (Macromedia CFMX). The innovative application allows the user to easily build ‘data-driven’ applications delivered into the browser. ColdFusion MX is capable of “deliver[ing] a more compelling user experience while providing a robust architecture and rich set of built-in capabilities to deliver high performance and scalability” (CFMX for J2EE). 24
  • 25. The numerous functions presented are extremely useful, and produce undeniable advantages to the many organizations that have recognized and implemented ColdFusion. We have all heard the phrase, ‘time is money,’ and with the use of this exceptionally valuable application, organizations are able to use their time more efficiently within their environments, working to improve profits, rather than updating web pages. JAMBA To reiterate what was mentioned earlier in the paper, Java is a powerful object-oriented computer programming language that is often used by experienced programmers to build substantial information systems. The key word here is experienced. Unfortunately, for those of us with little background in Java, it might seem impossible to handle a grasp on it. The compiling of codes and programs might seem extremely overwhelming; this is probably because Java is very difficult material to pick up on. Let’s say that an average Joe wanted to use Java to enhance his small company’s WebPages, however, he lacked any real expertise in that specific programming language. What could he do? Firstly, Joe could attend several Programming (specifically Java) courses and gain expertise on the subject for himself. This would cost a lot of money, time and effort. Secondly, Joe could forget about attending classes and hire a full time computer programmer (Java developer) to do the job for him. However, it would be difficult for a small company to maintain a full time computer programmer on its payroll. Thirdly, 25
  • 26. Joe could get his hands on the Java authoring tool, JAMBA. Java development using JAMBA would be the perfect way to go! According to Interleaf, Inc., “JAMBA is an award-winning Java authoring tool that lets create Java applets and applications in a visual drag-and-drop environment, without programming, scripting or plug-ins.” An applet is a small program that normally is stored on a remote computer that users connect to via a World Wide Web browser. Applets are loaded from a remote computer into the browser, executed in the browser and discarded when execution is completed (Deitel, 2002). Java applets are often time-consuming to configure and run. However, with the assistance of JAMBA, applet forming has been made simpler. Interleaf, Inc. is a company that offers enterprise-wide software solutions for substance management and complex publishing. These solutions enable customers to set up document-based applications that progress their operating efficiency and customer satisfaction, and support revenue and profitability (Business Wire, 1998). Among these solutions is JAMBA. The company has received many awards for this prize development such as PC Magazine Editor’s Choice Award for multimedia design ability in a Java Applet Tool. JAMBA is designed for Web content creators who would like to gain from Java’s ability to add functionality and interactivity to stagnant HTML (Hypertext Markup Language) pages. JAMBA offers a non-programming environment using a point and click interface that allows for feature-rich Java 26
  • 27. applets that run across all major Web browsers. Unlike others that use a plug-in approach, JAMBA applets do not call for the browser to first download and install plug-ins before the applet can be viewed (Business Wire, 1998). JAMBA is a successful animation tool that enables Web Page designers to easily integrate sounds, graphics, text and special effects to make their pages come alive with movement and sound activated by the user. Not only is JAMBA’s ability to play music files impressive, it is also notable how Web users are able to experience extensive interaction with the HTML (Hypertext Markup Language) pages (Business Wire, 1998). Some examples of JAMBA’s exquisite capabilities include creating guest books, ticker tape, push buttons, image strips etc. JAMBA is great for adding multimedia, such as graphics that pop up at the wave of a mouse, page events that are controlled by timers, interactive elements (list boxes etc.), or a mouseover graphic that sends the user to another site when clicked on. JAMBA can also be used to collect information from people on the Internet, and then circulate that information to a data file on a server (Developing Distributed Application, 1998). Contained in the JAMBA development environment are Visual RAD, Wizards and, of course, Drag-Drop. Once you have installed JAMBA, you are ready to create your own applets quickly and easily. JAMBA has been commended on its easy to use, fairly self-explanatory, and uncluttered interface. According to Vicky Dawson’s “JAMBA 2.0” article, a clear workspace is provided (where applet creation takes place) along with a JAMBAPlayer (used 27
  • 28. to run projects as you are working on them to ensure they’re running correctly), a screenshot (to keep track of your project), and a toolbar (that includes all the tools needed to complete the project). Since you don’t need to know how to program to create applets, you can drag and drop whatever operation is needed throughout the whole project. Wizards are excellent for helping create small applets, such as rollover buttons, animations, and ticker tapes. When everything is complete, your work can be instantaneously published to your web server or local drive (all files necessary to run the project are stored here together.) All that is needed to get the application to work is to cut and paste code into the .html file you want the applet to run from (Dawson, 1999). Since there isn’t any plug-ins to run the applets, Web users don’t have to download anything to view your page (Dawson, 1999). JAMBA is a product that is very simplistic, prevailing, widespread, portable, and considered the easiest way to create Java applets. We also know that JAMBA is being used for the purpose of enhanced efficiency and livelihood of HTML (Hypertext Markup Language) pages. However, where does one go about actually creating a JAMBA applet or application? Steps to Using JAMBA It all starts with the JAMBA interface, which is considered JAMBA’s main selling point because it is so simple to follow. Below is a screen shot of the interface that includes the JAMBA Project Window (far left), the Page Layout 28
  • 29. Editor (middle bottom), the Object palette (far right), the Properties and the To Do List (middle top). All of these will be explained in the following pages. Starting a New Project (Lesson: JAMBA Quick Start): Choose “New” from the file menu or click on the “New” button to start a new application project. The “New Project” dialog box will appear, as shown below. This is where you name your application, decide which directory you want the application to reside in, and set up the size of the window the application will run in. If you name a directory that doesn’t exist, JAMBA will create it for you. 29
  • 30. The JAMBA Project Window (Lesson: JAMBA Quick Start): After you have started a new project, the first window that comes up is called the JAMBA Project Window. This is where you view thumbnail sketches (small representations) of the pages that structure your application. The first page is always called the “start page”. As you create more pages, more thumbnail sketches will appear in the Project Window. Most applets/applications created for use on the Internet only need one page to construct. The JAMBA Project Window & Start Page 30
  • 31. The Page Layout Editor (Lesson: JAMBA Quick Start): To open up the Page Layout Editor, double click on the Start Page in the Project Window. The Page Layout Editor (displayed below) is the area where you draw objects on a page and arrange the objects to perform as needed to at runtime. The Page Layout Editor consists of two parts: the Object List and the Layout Area. The Object List is the area to the left that lists the names of the objects used on each page. The Layout Area is the area to the right that serves as a canvas to draw objects on. Setting the Window Size (Lesson: JAMBA Quick Start): This is where you set the window size or adjust the window size to accommodate your application/applet. This can be done by choosing “Settings” from the Project menu and clicking on the “Page” tab. 31
  • 32. Drawing Objects (Lesson: JAMBA Quick Start): To draw an object you must use the Object Palette (displayed below on the left), this is a tool bar that presents particular objects that can be used to create an applet/application. Objects are the building blocks that make up an applet/application. Some examples of objects are: Push Buttons- creates a variety of buttons like “OK” or “Next”. Graphics- creates graphic files that you can incorporate into an application. Audio- creates audio files to play within your application. List Boxes- creates a list of items you can scroll down and choose from. Text Fields- creates the display of editable text within your application. 32
  • 33. Setting Object Properties (Lesson: JAMBA Quick Start): After using the Object Palette to draw objects, you must set properties to these objects. This is done because each object and page has certain properties (characteristics) that must be set in order to control their appearance. For example, with a push button object you must set its’ label property to “OK” or “Next”. To bring up properties (as shown below), you must right click on the object you are setting properties for, choose “properties” from a pop up menu, and then click on the “properties” tab. From there you can adjust the properties to best suit a specific object. The To Do List (Lesson: JAMBA Quick Start): The To Do List is JAMBA’s most powerful feature. It tells objects what they should do when a particular event occurs. For example, if you click on a button labeled “play”, an audio file will play. To manipulate the To Do List (as displayed below), right click on the object you are working on, click on “properties” from the pop up menu, and click on the “To Do List” tab. 33
  • 34. The drop down box lists events that will cause particular actions to occur. In the image above, the event is a click on a push button. The empty space below is where these To Do Items, particular actions that occur from a click of the button, will be listed. To administer the blank area to fill in the To Do Items, just click on the “New To Do Item” button (as shown directly below). Once you have clicked on the “New To Do Item” button, you can fill in the “Object”, “What to do” and “Value” portions of the To Do List (as displayed below). A drop down box of all objects you have created will appear. In this example, an audio object has been chosen. In the “What to do” section, another drop down box will appear that lists certain actions that can occur. In this example, an audio file was chosen to play when the button is clicked on. 34
  • 35. Completion of Application/Applet (Lesson: JAMBA Quick Start): After all objects have been assigned valuable properties and To Do Items, test the application. If everything works properly, you can distribute the application/applet to your end-users or you can incorporate the functionality into your own web page. Jini Technology You have just learned about JAMBA, one of the attributes offered through the Java J2EE platform. Another offering of Java J2EE is Jini, which is one of the underlining technologies of JAMBA. Jini is not an acronym for anything; it was formed from the work of Java, making connectivity and distribution easier. It was implemented to make network devices and network computing into standard components for the end- user computing environment. Jini is a way to build embedded systems and provide an easy and flexible way to distribute these systems. To explain this, an embedded system or client is a car or a washing machine with an embedded microchip. In many cases, an expert system is embedded with rules that make 35
  • 36. the client smarter or more responsive to changes in the environment. For example, if you were to buy some new office equipment such as a desk lamp, or a alarm clock, Jini will not only carry out its traditional function but will join into a network of other computer devices and services. The desk lamp will shut off by itself when you get up from you desk, informed by sensors in you chair; the alarm clock will tell you coffee maker to turn on a couple of minutes before it wakes you up (Venners,1999). Another example given by Venners of how Jini can be useful is: it can allow a digital camera the ability to connect to a network; when an interface appears, it is able to show the picture and can detect your printer to print the picture. These are some of the services that Jini provides from its new technology. “Others are: • A configuration file that is copied and modified on individual machines can be made into a network service from a single machine, reducing maintenance costs for a company. • New capabilities extending existing ones can be added to a running system without disrupting existing services, or without any need to reconfigure clients. • Services can announce changes of state, such as when a printer runs out of paper. Listeners, … , can watch for these changes and flag them for attention” (Overview of Jini, 2000). Some of the reasons why Jini technology is becoming more of a demand are because the people are not using their PCs for word processing as much any 36
  • 37. more. They are using network to gain more services and more resources and to interconnect with one another. In recent years there has been a lot of new technology popping up for the end users to enjoy. Some of these technologies are called wireless devices that don’t have to be plugged in to an outlet or don’t have power cords. “These wireless devices have small embedded devices (anything with a microprocessor embedded in it that has a relatively focused functionality). An example of these embedded devices are cell phones, microwave ovens, VCRs, pagers, clocks, and printers” (Perrone, 1999). As you might have noticed, computers are not on the list. Why? The answer is, computers don’t have a focused functionality. So, what is meant by a focused functionality? Consider the following example: a microprocessor-enhanced typewriter is an embedded device, focused on the job of typing. A computer running a word processor can serve the same purpose as the typewriter, but the computer can also be used to run a spreadsheet, surf the Web, or do many other activities. The computer also has a disk that is used to store information on it and enable it to run the computer. The functionality of the computer is so spread out, and its operating system is so large, because it has to know about everything that the computer is capable of doing. With these new embedded devices other systems are diskless since they have a certain functionality that they will be performing. As Jim Waldo, Sun’s chief Jini architect puts it, “Given the rising importance of diskless, network-connected embedded devices, however, this disk-centric model for computing doesn’t fit anymore.” Waldo also explains, 37
  • 38. “Jini attempts to provide an architecture for the emerging network-centric hardware environment, an architecture based on the idea of a federation rather than central control, new technology for a networked world” (Venners, 2002). Jini is implemented to define a set of rules for the federation that will in return enable clients and services to interact. Several technologic development efforts are underway to answer the problem of being more interconnected and an easier way to build, manage, and use the services of a digital network. This is where Jini comes into play. The Jini technology makes a network more dynamic by allowing the ‘plug-and –play’ of devices. It gives devices the ability to attach and detach from networks without configuring each device each time. You might think that Jini is an operating system, but it isn’t, it just defines a set of rules that enable clients and services to interact with one another. Because Jini systems don’t have a central point of controlling authority, if something goes wrong it won’t bring the whole system to a halt. So, how does Jini work? Before further discussion of that, here is a quick overview of how it works. Once the overview is established, then the components will be explained. When a computer starts up, it looks for a disk. If it doesn’t locate a disk, it can’t function. These implementations of networks are what Jini is all about. When you use an interaction device that is a part of a system that is implementing Jini technology, the services are there to use as though you were on your own computer. These services also include software as well as hardware. This is a trend in the hardware environment, from disk to 38
  • 39. ‘network-centric’. These embedded devices have a processor, some memory, and a network connection and are what Jini is going to implement. Jini is going to become the ‘thinker’ that reconsiders how this computer architecture is going to be constructed. What does architecture of a computer refer to? “The term architecture is used because it is describing the design of Java to allow for future expansion of server and reference types so that RMI can add features in a coherent way” (Javaworld, 1999). From here Jini is developed and built on top of the Java 2 platform, object serialization and RMI (Java Remote Method Invocation). Before proceeding further, let’s explain what exactly is meant by the terms RMI and Java 2 platform. Java Remote Method Invocation allows a user to write distributed objects using Java. “RMI provides a simple and direct model for distributed computation with Java objects. These objects can be new Java objects, or can be simple Java wrappers around an existing API. Java embraces the write once, run anywhere model. RMI extends the Java model to be run everywhere” (Javaworld, 1999). RMI can connect to an existing legacy system using the standard Java native method interface JNI. A user can use RMI to connect between a new Java application and existing servers. “RMI allows the parts of your system written in Java to flow from the existing Java components into the new Java code”(Javaworld, 1999). For example, “Using RMI means that you can get Java benefits throughout your system by using RMI as the transport between client and sever, even if the server remained in non-Java code for some time” (Venners, 2002). RMI is explained even further later on in this paper. 39
  • 40. What is the Java 2 platform? It is made up of RMI, security, networking, and serialization. The Java 2 platform offers new security and distributed communication mechanisms on which Jini relies. RMI objects can move around networks from ‘virtual machine to virtual machine’. Because Jini is being the thinker, device vendors don’t have to agree upon network protocols to which their devices can communicate, rather Jini does all the work by enabling the devices to communicate with one another through interfaces to objects (Hashman, 2001). What is a Java Virtual Machine? Java Virtual Machine is known as the ‘cornerstone’ of Sun’s Java programming language. “It is the component of the Java technology responsible for Java’s cross-platform delivery, the small size of its compiled code, and Java’s ability to protect users from malicious programs” (Hashman, 2001). Jini, or called federation, is the gathering of services and clients that interact by using Jini protocols. “The federation part of Jini is the gathering of networks of devices, software services that are assembled together to from workgroups known as federations of clients and services, without the need for intervention by system administrators” (Venners, 1998). The protocols and applications are written in Java, and talk to one another using RMI. Jini supports a ‘middleware’ layer that enables services and clients to communicate. Jini is made up of APIs (Application Programmer’s Interface) and network protocols so that the user can write services and components that use this middleware, organized as federations of services. “A federation of 40
  • 41. services is a set of services, currently available on the network, that a client (meaning a program, service, or user) can bring together to help it accomplish some goal” (Perrone, 1999). Because there is no one service in charge, the word federation is used to describe the basis of Jini’s view of the network. These services form groups that are composed of ‘equal peers’, which allow clients and services to find each other (a look-up service, which stores a directory of currently available services). Jini has a runtime infrastructure, which allows you to add, remove, locate and access services. Services use a runtime infrastructure to make themselves known when they join the network. A client uses the runtime infrastructure to locate and contact desired services that the end user will be implementing to accomplish a task. According to B. Day of Java World, the desired service could be hooking up a printer, and while Jini is configuring it, the protectors perform look-up, discovery, and join to allow you to receive a service, which in this case would be printing. From this, runtime infrastructure introduces three main players: a service, such as a printer; a client, which would make use of the service; and there is a look-up service that acts like a ‘broker’ between services and clients (Jini™ technology). When a new service become available within the network, it registers itself with the look-up service. The client then uses the look-up service to locate services to assist with a given task. The last component that intertwines the first three is the network, which is generally running TCP/IP (Transmission Control Protocol/ Internet Protocol). 41
  • 42. The runtime infrastructure of Jini also consists of a network protocol, called discovery and two object-level protocols, which are called join and look- up. In the diagram below it shows where these 3 protocols are located. The process of discovery, join and look-up are the last steps before these transactions turn into Jini services. These services could be printing, paging or telephony. First I will describe the discovery process. “Discovery is the process by which a Jini technology-enabled device locates look-up services on the network and obtains reference to them”(Venners, 1999). For example, as soon as you connect the drive to the network, it announces itself by dropping a multicast packet onto a well-known port. Embedded in the presence announcement are two important pieces of information: the IP address and port number where the disk drive can be contacted by a look-up service, and a list of names of groups the device is interested in joining. 42
  • 43. Next comes the joining process. When a device is discovered by a look- up service, it then can register its services on that look-up service. This is called the join process. From here, the join process starts off when a service attaches itself to a look-up service and the object it established from that look- up service during the discovery process. The look-up service then stores the information downloaded from the service and links that service with the requested group. At this point, the service has joined the group on that look- up service. The look-up process works like this. Once a service has joined up with at least one group within a certain look-up service, that service is accessible for the use by other clients who want that particular look-up service. “To build a federation of services that will work together to perform some task, a client must locate and enlist the help of the individual services. To find a service, clients interact with look-up servers. These processes are what make up the look-up services” (Venners, 1998). To better describe this process consider the following example: A client program may look up a printer service in a look-up service. This program starts the look-up process by calling upon a method in the object received from look-up service during the discovery process. The client identifies the type of interface that will be implemented by the printer service. The look-up server finds a printer service that matches the request. It then sends the object that matches this printer service back to the client. Not only does the client have the object that is requested, but also is able to implement the service by the Java based interface. This is an object that acts 43
  • 44. as a representative of the printer service. With this object, the printer now can produce the service of printing to the end user. The other part of Jini is the programming model that consists of leasing, transactions and distributed events. These models are described in the following paragraphs, as well as what each of the three parts do. The programming model is shown in the diagram above, located under the infrastructure of discovery, look-up and join. In most distributed system, the user may encounter server crashes, traffic jams and wires can be cut. “The programming model offers a small set of APIs that can help the end user to create reliability in your distribution system. The programming model helps clients and services to do the work for which the federation was assembled in the first place” (Venners, 1998). To explain the three parts of the programming model, we will first start with leasing. Leasing offers a way to run the ‘lifetimes’ of distributed objects that can’t be managed by the standard rules of the federation. Leasing is the amount of time that an object has to carry out its function. For example, if you were performing a service of printing, this printing service would get to decide the amount of time of the lease, most likely taking the demanded time period into account, and corresponding that time period back to the client. But, if the client does not make use of this lease before the time period is up, the printer can assume the object is no longer needed by the client and can get rid of the object. As long as the client keeps renewing the lease before the 44
  • 45. time period is up, the printing service will not be discarded and the service remains available to the client. Transactions are the second part of the programming model that help the end user to create a reliable distributed system. “It refers to the mechanism used to ensure that service operations are consistent and complete within the federation” (Venners,1998). A transaction can allow a set of operations to be clustered in such a way that they will either all work or will all fail. Within the federation, it allows a pair of operations in the set to appear or occur, at the same time. By implementing transactions, consistency can be enforced over a set of operations on one or more activities. “If all the participants or services are members of a transaction, one response to a remote failure is to stop the transaction, thereby ensuring that no partial results are written” (Venners, 1998). So overall, the transaction creates a more reliable distribution system. The distributed events model is the third part of the distributed system model. “In this model, objects on a device can register their interest in an event occurring in another object residing on a different device in the federation and receive notification when the event occurs” (Hashman, 2001). In other words, “events provide a mechanism for maintaining consistency of the same state of information in the federation of services and clients working together. Using the Jini event model, an object can register itself as a listener interested in events generated by a remote source” (Venners, 1998). When the remote source fires an event, the event will travel across the network to the 45
  • 46. registered listeners. Here is where Jini’s discovery, look-up and join processes come into play. As explained earlier, when these devices form federations, or network communities, through the discovery and join protocols, a device uses discovery and attaches to one or more other devices to form a network. The device then polls that network for the implementation of a Jini look-up service. After the service is looked up, the device then can registers itself with the look-up service. But the device may already host a look-up service, which will then become available to be discovered by other devices within the network. Devices within the network can call on the look-up services they have discovered and determine whether or not there are desired services available. From this, desired services can be downloaded or ignored by the device. “Because this process is automatic, devices or users don’t have to do complicated installations to couple Jini-enabled devices to the network and enable the devices to function easily with other devices on networks” (Venners, 2002). LUTRIS & RMI Another important piece of the Java 2 Enterprise Edition Platform is RMI technology. One of the forerunners of the development and use of this technology was Lutris Technologies, Incorporated. Lutris Technologies is the development company of Enhydra and this is the only RMI application that was found throughout the research of this subject. The Enhydra program was originally developed for cross platform applications. This was an Instant DB 46
  • 47. (Database) program that was considered to be more successful than Oracle, because of this cross platform application. This was known to be a significant improvement as this program was develope once, use anywhere. It was developed for use on UNIX, Linux, MAC or Windows based operating systems (Businesswire). By now you may be asking, so what? So was Java! What makes this program so special? Primarily, the reason this is envisioned as a new and innovative product, is because Java was developed for web-based applications while still using VisualBasic programming, while Enhydra was designed to support wireless application protocols (WAP) and to deliver applications to the broadest range of wireless and wired devices using the Java Language, according to the Business/Technology Editors of Businesswire.com. Lutris was originally touted as the greatest thing to hit computers since the advent of the World Wide Web. As things so often do in this time of rapidly changing technology, they were ahead of their time and are now out of the race. Enhydra was a unique technology using XMLC (Extended Mark-up Language Compiler), to guarantee that developers were not required to write separate code bases for each targeted device. Enhydra XMLC separates business logic from presentation design, enabling a one-to-many approach that improves application manageability (XMLC). In 2000, Lutris Technologies was a leading Open Source enterprise software and services company. Their clients ranged from entrepreneurs and companies launching new Web ventures to Fortune 500 IT companies that were 47
  • 48. growing their business with an online presence. However, development didn’t stop there. In March 2002, Lutris announced the availability of a program designed for the MAC OS X operating system. This was a Java Application Server that featured Java Services Architecture, Web Service capabilities, clustering functionality, and wireless and voice presentation capabilities. This was an upgrade to the 3.5 server that was based on an IBM compatible operating system. Now, Macintosh users could derive some of the same benefits (MacCentral). In the late spring of 2002, Lutris was condemned for betraying the open source community. Up to this point, Enhydra had existed as a commercial product as well as being an open source version. According to instantdb.com, the company suddenly announced that from this point forward, the Enhydra Enterprise was going to be closed source. Arguments from the Lutris’s management that this decision was based on SUN©’s licensing conditions were strongly argued against by other sources as being based upon the business’s bottom-line. Why should they give their code away for free like everyone else when they had already shown that they could convince a great number of people to pay them for the privilege of using their code? According to Itworld.com, in May 2002, Lutris stopped offering EAS and Enhydra to end- users. In addition, the company ceased management of the open source community that developed products based on Enhydra. Enhydra is still available, but only because so many companies based their products on this 48
  • 49. application and so far, there isn’t a bridge between this product and any others currently on the market. Lutris’ Enhydra system relied heavily on RMI (Remote Method Invocation) for its processes, and although Lutris is no longer available, RMI is still a very viable product. SUN has taken over this loss with their Java Remote Method Invocation technology run over Internet Inter-Orb Protocol. This delivers CORBA (Common Object Request Broker Architecture) distributed computing capabilities to the Java 2 platforms. Java RMI over IIOP (Remote Method Invocation over Internet Inter-Orb Protocol) combines the best of RMI and CORBA. It allows developers to work completely in the Java programming language rather than jumping from Java to C++ to VisualBasic to whatever other programming language one might wish to implement. Clients can be written in other languages and can still be integrated into a system that is Java based without causing runtime errors, using switches or writing bridges of code (Java.sun). As shown earlier, using Java Server Pages can shorten the work of programming, but with the XMLC portion of RMI, the designer has greater dynamic control. XMLC features a compiler and a runtime environment for standard Web application presentation deployment. The compilation phase translates a targeted markup page into class. Before compilation, the designer and developer identify areas of dynamic code embedded with id attributes or Taglib. The designer then uses the XMLC to generate a Java class. From there, they would use the code and import it to a template. Each step is labeled with 49
  • 50. XMLC to indicate that the job is done. This method uses only HTML tags; there are no structural files required and no Java code has to be written or implemented, mock data can be used and there is direct access so the designer can make any changes he/she wishes without developer assistance. According to David Young writing for theserverside.com, a lot can go wrong with using JSP for more dynamic HTML pages. If a designer were to use XMLC instead, the greatest thing that would have to be remembered is “Don’t change the ID attribute name”. Inexperienced programmers using JSP can break their code very easily with a misspelled word or by using an uppercase letter where a lower-case letter is needed. With XMLC, it won’t necessarily look very pretty when you make the mistake, but the code won’t break and the page will still load. JSP taglibs were developed to fix this, but all they are is a bandage on the problem, not a cure. XMLC provides an object-oriented method of creating dynamic content from static HTML and XML documents. Much like JSP and CFML, it can be used to convert HTML or XML documents into Java classes or to mimic any Java class so that it can be used within a Java program. In this way, the developer or designer can create dynamic HTML for their web site applications. According to webreference.com XMCL provides five (5) predominant advantages when used for content development. 1. The development of HTML and XML documents stays separate from their programming logic. The content can be developed using standard HTML/XML design tools. 50
  • 51. 2. Sample data doesn’t have to be converted into another form, it can be left in it’s original tables and still appear in a readable form. This gives the designers the ability to work in conjunction with the programmers; one developing the code while the other develops the layout and design. 3. The contents of pages are easier to manipulate because of the access methods that are generated. If the tag isn’t removed from a page even though the code has been deleted, the user won’t get error messages pointing out that someone missed a step. 4. Significant performance benefits can be obtained when parsing of an HTML/XML document is done at compilation rather than at run time. 5. Code flow control remains separate from the page. Content and data are not mixed in a single file that can result in the code being difficult to understand and that would prevent the ability to take full advantage of the object oriented programming paradigm. Enhydra XMLC works on this premise, but fortunately for current programmers, they aren’t patented in to the use of XMLC. Even though Enhydra was developed to use and enhance XMLC, they didn’t get the full inalienable rights of ownership (Enhydra.org). RMI (Remote Method Invocation) allows applications to call object methods located remotely. They share resources and processing loads across systems. This provides the developers with greater access so that they don’t 51
  • 52. have to overload their servers. With the cost of server space, this is a very lucrative feature. Unlike other systems for remote execution, which require that only simple data types or defined structures be passed to and from methods, RMI allows any Java object type to be used. It facilitates object function calls between Java Virtual Machines and it can dynamically load new classes so the RMI will automatically update Java programs (Reilly). Java RMI relies on Java, so it can be used in cross platform applications. But, since RMI relies on Java, the machines that are using it have to have a Java Virtual Machine implementation on that platform. Each Server object defines an interface, which can be used to access the server object outside of the Virtual Machine and on another computer’s Java Virtual Machine. The interface shows what set of methods indicated are to be offered by the server object. For a client to locate a server object for the very first time, RMI requires an RMIRegistry that runs on the server machine. The following diagram shows the architecture of RMI and gives the reader an insight to the lines and blocks of code below (jGuru). 52
  • 53. Java RMI is a very useful mechanism for invoking methods of remote objects. If you have ever written any Java programs, you know that you have to call the methods that you wish to use. However, if you write or implement a Java RMI, you can have the program perform the call all by itself. Writing an RMI is not very easy at first, but it does become more automatic once you’ve gotten used to it. In order to begin, you have to first decide upon an interface. What methods do you want remote clients to be able to invoke? To write a simple interface, you can use the following code: import Java.math.BigInteger; import Java.rmi.*; //PowerService Interface //Interface for a RMI service that calculates powers public interface PowerService extends Java.rmi.Remote { 53
  • 54. //Calculate the square of a number public BigInteger square( int number ) throws RemoteException; //Calculate the power of a number public BigInteger power( int num1, int num2) throws RemoteException; } public PowerServiceServer() throws RemoteException { super(); } public static void main( String args[]) throws Exception { //Assign a security manager, in the event that dynamic classes are loaded. if (System.getSecurityManager()==null) System.getSecurityManager(new RMISecurityManager()); //Create an instance of our power service server.. PowerServiceServersvr =new PowerServiceServer(); //...and bind it with the RMI Registry Naming.bind("PowerService",svr); System.out.println("Service bound...."); (Reilly, 2) Once that is written, you have to write or implement a program that will implement the interface. This is another simple program, but the programs can be as simple or as complex as the programmer wishes them to be. The following code is an example of the server: import Java.math.bi.*; import Java.rmi.*; import Java.rmi.server.*; public class PowerServiceServer extends UnicastRemoteObject implements PowerService { /** Creates a new instance of PowerServiceServer */ public PowerServiceServer()throws RemoteException { super(); } //Calculate the square of a number public BigInteger square ( int number ) 54
  • 55. throws RemoteException { String numrep = String.valueOf(number); BigInteger bi = new BigInteger (numrep); //Square the number bi.multiply(bi); return (bi); } //Calculate the power of a number public BigInteger power( int num1, int num2) throws RemoteException { String numrep = String.valueOf (num1); BigInteger bi= new BigInteger (numrep); bi=bi.pow(num2); return bi; } public static void main (String args[] ) throws Exception { //Assign a Security manager, in the event that dynamic classes are loaded if (System.getSecurityManager() == null) System.getSecurityManager ( new RMISecurityManager() ); //Create an instance of our power service server... PowerServiceServer svr= new PowerServiceServer(); //...and bind it with the RMI Registry Naming.bind ("PowerService",svr); System.out.println ("Service bound...."); (Reilly, 4) When that is completed, you must write a client that will use the program. All this has to do is call the registry to obtain a reference to a remote object, and call its methods. For this example, consider the following code: import Java.rmi.*; import Java.rmi.Naming; import Java.io.*; public class PowerServiceClient { 55
  • 56. public static void main( String args[] ) throws Exception { //Check for hostname argument if (args.length !=1) { System.out.println ("Syntax - PowerServiceClient host"); System.exit(1); } // Assign security manager if( System.getSecurityManager() == null) { System.setSecurityManager ( new RMISecurityManager() ); } //Call registry for PowerService PowerService service = (PowerService) Naming.lookup ("rmi://" + args[0] + "/PowerService"); DataInputStream din = new DataInputStream( System.in); for (;;) { System.out.println ("1 - Calculate square"); System.out.println ("2 - Calculate power"); System.out.println ("3 - Exit"); System.out.println(); System.out.print("Choice : " ); String line = din.readLine(); Integer choice = new Integer(line); int value = choice.intValue(); switch (value) { case 1: System.out.print("Number :"); – line = din.readLine();System.out.println(); choice = new Integer (line); value = choice.intValue(); //Call remote method System.out.println ("Answer : " + service.square(value)); break; case 2: System.out.print( "Number :"); line = din.readLine(); 56
  • 57. choice = new Integer (line); value = choice.intValue(); System.out.print( "Power : " ); line = din.readLine(); choice = new Integer (line); int power = choice.intValue(); //Call remote method System.out.println ("Answer : " + service.power(value, power)); break; case 3: System.exit(0); default: System.out.println ("Invalid option"); break; (Reilly, 5-6) In order to run the client and the server, you can download all the source and class files together into a .Zip file. Unpack the files into a directory, and then perform the following steps: 1. Start the rmiregistry (To start the registry, Windows users should type in the following: Start rmiregistry, into the run window in the Start menu) 2. Compile the server Compile the server and use the rmic tool to create stub files. 3. Start the server From the directory in which the classes are located, type in the following: Java PowerServiceServer 4. Start the client Specify the hostname of the machine where you are running the server: 57
  • 58. Java PowerServiceClient localhost By now, looking at all of this programming, a person could become quite overwhelmed. The thing to remember is that Java is that wonderful technological advantage over other programming languages, write-once and use over and over. For a more detailed discussion of how and why to implement an RMI Interface, Client and Server go to www.Javacoffeebreak.com. Conclusion As you can see from the examples and information presented about JSP, ColdFusion, JAMBA, Jini and RMI, not to mention CORBA, ASP and the myriad other entities within J2EE, this is a very complex subject to digest. With the information imparted here into the sections of J2EE that we have delved, we have only begun to scratch the surface of the immensity of this subject. J2EE is a program with the potential for high performance, scalability, availability and openness that has received a very warm welcome from the e-commerce/e- business community. It does not, however, come without strings attached. The JavaBeans, Java servlets and JavaServer Pages components are all an integral portion of this program and with that in mind, you must also remember, if there is a problem that develops within any one of them it can be potentially crippling to the entire business. The following diagram shows the J2EE architecture. 58
  • 59. Within all of these sections, there are smaller segments that represent the client and the thousands of other programs that the business relies on to keep them running, current and error-free. The monitoring of such a program in and of itself can be a daunting task, add to that the debugging that could be required to investigate any problems that may arise and one can only imagine the lifetime supply of aspirin and ulcer soothing medications that may be necessary just to keep the staff on top of the resolution of any problems. 59
  • 60. Works Cited Ahmed, K. & Umrysh, C. Develping Enterprise Java Applications With J2EE and UML. Indianapolis: Addison-Wesley, 2002. Annunziato, Stephanie. “JSP: Creating Dynamic Forms,” 26 November 2002. <http://www.developer.com/lang/article.php/729421>. ClaBen, Michael. “About Enhydra XMLC.” XMLC Project. 24 November 2002. <http://xmlc.enhydra.org/project/aboutProject/index.html>. Clark, Scott. “Visual Java Development Tools,” Web Developer Magazine, January/February 1997. < http://www.webdeveloper.com/java/java_visual_javatools.html>. Cohen, Peter . “Lutris brings Java application server to OS X.” 11 Mar 2002. MacCentral. 28 Sept 2002. < http://maccentral.macworld.com/news/0203/11.lutris.php>. “ColdFusion MX for J2EE.” Macromedia.com. 2002. <http://www.macromedia.com/desdev/logged_in/thale_cf_j2ee.html>. Crawford, David, et al. The Cold Fusion Web Database Construction Kit. 2002. <http:// docs.rinet.ru:8083/Cold/fm/fm.htm#Heading6>. <http://docs.rinet.ru:8083/Cold/ch01/ ch01.htm>. <http://docs.rinet.ru:8083/Cold/ch02/ch02.htm>. <http://docs.rinet.ru:8083/Cold/ch03/ch03.htm>. <http://docs.rinet.ru:8083/Cold/apa/apa.htm>. Dawson, Vicky. “Jamba 2.0,” June 5, 1999. <http://the-internet-eye.com/reviews/june99/jamba/default.htm>. Day, B. “The state of Jini technology,” 1999. <http://www.javaworld.com/javaone99/j1-99-jini_p.html>. Deitel, Harvey & Paul. “Java; How to Program?” Prentice-Hall, 2002. Pg. 18. (October 3, 2002), “Development of the JSP/Servlet Platform.” Online. Wysiwyg://36/http://www.javaskyline.com/learnjsp.html (September 26, 2002).“Dynamically Generated Web Content.” Online. <http://java.sun.com/products/jsp/ (September 24, 2002)>. “Dynamically generating HTML pages with XMLC.” Webreference.com. 24 November 2002. <http://www.webreference.com/xml/column23/>. 60
  • 61. “Dynamically Generated Web Content,” Java.sun.com. 26 November 2002. <http://java.sun.com/products/jsp>. Forta, Ben. “About ColdFusion.” Forta.com. 2002. <http://www.forta.com/cf/>. Forta, Ben. “Who’s Using ColdFusion?” Forta.com. 2002. <http://www.forta.com/cf/using/list.cfm?highlight=1>. Hawkins, George C. “How Lutris betrayed the Open Source Community”. Sept 2001. Tripod. 28 Sept 2002. < http://instantdb.tripod.com/>. Hashman, Steve and Knudsen, Steven, “The Application of Jini[Tm],” December, 2001. <http://www.psiNaptic.com/jini/technology/overview.html>. “Introduction To Java Servers,” Java Skyline: Java Servlet / Server Headline News, 24 Sept 2002. <http://www.javaskyline.com/learning.html>. “Interleaf Receives Best-In-Class Awards for Jamba Business/Technology Editors,” Business Wire, August 04, 1998. <http://industry.java.sun.com/javanews/stories/print/0,1797,2832,00.html>. “Jamba Multimedia Authoring for Java,” Independent Web Review, 1997. <http://www.webreviews.com/97_04/jamba.html>. “Java Development Using Jamba,” Developing Distributed Application, 1998. <http://hammock.ifas.ufl.edu/techno/ORLANDO98/jamba.htm>. “Java™ 2 Platform, Enterprise Edition (J2EE™).” Java.sun.com. 6 December 2002. <http://java.sun.com/j2ee.overview.html>. “Java Remote Method Invocation (RMI).” SUN.com. Sun Microsystems, Inc. 28 Sept 2002. < http://java.sun.com/products/jdk/rmi/>. “Java™ RMI over IIOP.” Java™2 Platform, Enterprise Edition. 15 November 2002. <http://java.sun.com/products/rmi-iiop/index.html>. “Java Server Faces Technology,” 24 September 2002. <http://java.sun.com/j2ee/javaserverfaces/index.html>. “Java Server Pages: Dynamically Generated Web Content,” 26 November 2002. <http:// www.java.sun.com>. “Java server maker Lutris bows out.” Itworld.com. 8 May 2002. IT World. 6 Oct 2002. <http://www.itworld.com/Comp/1361/020508lutris/pfindex.html>. 61
  • 62. “Java Server Pages (JSP) 1.0.” 26 November 2002. <http://www.apl.jhu.edu/~hall/java/Servlet-tutorial/Servlet-Tutorial-JSP.html>. Javaworld, “Jini: New technology for a networked world,” 1999. <http://www.javaworld.com/javaworld/jw-o6-1999/jw-06jiniology_p.html>. JGuru. “Fundamentals of RMI Short Course.” Java.sun.com. 6 December 2002. <http://developer.java.sun.com/developer/onlineTraining/rmi/RMI.html> “Lesson: Jamba Quick Start,” <http://www.uwasa.fi/~mj/mmp/JAMBADOC/1jach005.htm>. “Lutris Enhydra 3.5, the Most Comprehensive JAVA/XML Application Server for Wired and Wireless Devices, Released to Manufacturing.” Business Wire. 8 Dec 2000. Business/Technology Editors. 28 Sept 2002. < http://www.businesswire.com/webb/w0023532140>. “Macromedia ColdFusion MX for J2EE Application Servers.” Macromedia.com. 2002. <http://www.macromedia.com/software/coldfusion/productinfo/product_overvie w/>. “Macromedia JDJStore.com.” Macromedia.com. 2002. <http://www.macromedia.com/buy/>. McCalmont, Stephen. “The Need for Monitoring and Management of J2EE Application Server Environments.” 17 Jun 2002. e-serv.ebizq.net. 28 Sept 2002. < http://e-serv.ebizq.net/aps/mccalmont_1.html>. Mohnike, Charles. “ColdFusion Tutorial – Lesson 1-3.” Hotwired.Lycos.com. 2002. <http://hotwired.lycos.com/webmonkey/99/03/index2a.html>. Pandonia, “Overview of Jini,” 2000. <http://pandonia.Canberra.edu.au/java/jinni/tutorial/overview.html> Pekowsky, L., Snee, T. & Woods, D. The Developers Guide to the Java Web Server: Building Effective and Scalable Server-Side Applications. Reading: Addison Wesley Longman, Inc., 1999. Perrone, P. “Jini In The Box,” November 1999. Vol.12, num12; pp55-64 Raj, Gopalan Suresh “A Detailed Comparison of CORBA, DCOM and JAVA/RMI”. 28 Sept 2002. execpc. <http://my.execpc.com/~gopalan/misc/compare.html>. Reilly, David. “Introduction to Java RMI.” Javacoffeebreak. 15 November 2002. 62
  • 63. <http://www.javacoffeebreak.com/articles/javarmi/javarmi.html>. Scannell, Ed, Sullivan, Tom. “IBM, Sun court Macromedia.” InfoWorld. Lead with Knowledge. April 29, 2002. <http://staging.infoworld.com/articles/hn/xml/02/04/29/020429hnibmmacro.xml> . “The Easiest Java Creation Tool on the Market,” InterLeaf Jamba, 1998. <http://www.networldwide.com/vends/java/jamba_sentry3o.htm>. “The Power Behind the Server.” <http://java.sun.com/products/servlet/>. (September 28, 2002). TheServerSide. 24 November 2002. <http://www2.theserverside.com/resources/articls.jsp?1=XMLCvsJSP>. Turban, Efraim, et al. Electronic Commerce, A Managerial Perspective, 2002. New Jersey: Prentice Hall, 2002. Venners, B. “The Jini Vision.” 1999. <http://www.artima.com/jinni/jiniology/visionP.html>. Venners, B. “Jinin technology, out of the box.” December 1998. <http://www.javaworld.com/jw-12-1998/jw-jbe-jini_p.html>. Venners, B. “Objects, the Network, and Jini.” 6 September 2002. <http://www.artima.com/jinni/jiniology/introP.html>. “Why you Need to Look at the J2EE Connector Architecture in 2001.” Stolker, Theo. June 18, 2001. E-serv.ebizq.net. 6 Oct 2002. <http://e-serv.ebizq.net/aps/stolker_1.html >. Yager, Tom. “A Striking Balance.” InfoWorld. Lead with Knowledge. (April 29, 2002). <http://staging.infoworld.com/articles/ap/xml/02/04/29/020429apmac ro.xml>. Young, David H. “A Friendly Game of Tug of War: XMLC vs JSP.” April 2002. <http://www.theserverside.com/resources/article.jsp?l=XMLCvsJSP>. 63