Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
Project X
Project X

Last month, we started this column by looking at the development tool, Visual Café Pro. Visual Café Pro makes the perfect companion for the developer, giving instant access to the editor, on-line help and runtime environments. The main goal of this column will be to teach the reader the power behind Java by using Visual Café Pro, one of the most popular integrated development environments in use today.

There are many ways to teach Java. Some are good, some bad. I have always felt the best way to learn about anything is through example. Show somebody how it works and suddenly a lot of confusion is eliminated. For this reason, this column will develop a complete client/server application that can be deployed to both Internet and Intranet scenarios. Each installment will take the application a stage further, adding more and more functionality to it. Eventually, you will have successfully developed a full working application that may be deployed to a user base of thousands.

First, I will outline the application in question! I spent quite some time thinking about how I could demonstrate the workings of Java, but still come out with a piece of software that would actually be useful. As time went on, I rejected all of my ideas on the grounds that some were too big, some too complicated, too small, too easy. It looked bleak for a while. Then a colleague asked for an address for one of our clients, and I said, "It's in the company card file in the cupboard." A bolt of inspiration struck me. How many other people are in the same situation in an office environment; needing vital contact information held by only a handful of personnel? What is needed is a global contact database application.

OK, some of you may argue that this isn't exactly a revolutionary idea and, on the face of it, you would be right. But in reality, how many companies actually deploy such a facility to their staff? Excluding external contact information, internal contact information is invaluable and very often overlooked. Applications such as Lotus Notes, Microsoft's Outlook and Pegasus Mail offer such functionality, but are very rarely used. Reasons for their non-deployment range from bulky client side front-ends to speed of use. What is required is something that is lightweight, easy to use, straightforward to install and operates on a global database.

Other benefits could include the ability to run on any platform and to be able to access it from outside of the office. Bit of a tall order, some might say, but look at what our requirement is. We want to have something that people can have instant access to, no matter what machine they are using, and it has to be small so that it doesn't irritate the user base: Java.

Project X' Specification
This series of columns will take you through the complete development of this contact database, which we will name Informer. But before we open up Visual Café and start coding, let's outline the main features our new Informer will possess. First, it will be a Java applet. Since we will be using an applet, we are not restricted to the platform we are running from, as long as a Java-enabled browser exists in some shape or form. Informer will allow anybody to view the current list of contacts, add new entries or edit existing contacts. For our first version, we will give everyone the ability to add and change entries, which in reality isn't very practical.

Each applet will connect to the main database of contacts back at one central server, from which the applet will be downloaded, as shown in Figure 1.

From a database point of view, information stored about a particular person can be seen in Table 1. The database that this information will actually be held in will not matter too much. Since we will be using the dbAnywhere tool from Visual Café, the actual database is irrelevant. But, to show how easy it is to use, we will use an MS-Excel spreadsheet for the user records. In reality, this would be very inefficient for a large number of users. In future extensions, we will upgrade to an Oracle or Ingres database. The very fact that we can design the application like this shows the power Java holds: no restriction on platform and no restriction on the final database. By using dbAnywhere, or even the JDBC (Java Database Connectivity) API, upgrading the database does not require any code rewrites or modifications.

Storing this information in an Excel spreadsheet can be achieved by having each row represent a new contact name, with the first row describing the field names. Let's leave the database design for a moment and concentrate on what the user front end is going to look like.

Anyone who has designed any type of GUI (graphical user interface) using Java and the standard AWT package will know only too well the pitfalls that layout managers can be. "The devil's own creation!" some have been reported to say. Fortunately, Visual Café Pro has taken over the responsibility of that particular nightmare and has made creating front ends a much easier task. For the remainder of this article, we will look at how Visual CafŽ Pro can really help us design a front end applet for our Informer without writing a single line of code.

Informer Interface
As the name suggests, Visual Café Pro really is a visual experience. When you open up a new project, you are instantly presented with a Form designer window which is begging to have things dropped into it. Next to that window we have the Properties window that allows various parameters to be modified. For this application, we need to design an applet that will display a user's details and allow us to select from a list of other contacts.

With implementation being in an applet, we have two options to choose from; it can run within an HTML page, fixed inside a browser, or it can be in a floating window of its own. For this application, the floating window will be employed so the user does not have to keep their browser window open to use the applet once it has loaded. But, in order to keep presentation of the applet simple for the user, the applet that will be placed in the HTML page will consist only of a button that will open up the main Informer window.

Setting this applet up is very easy. Insert a new applet component by selecting it from the menu option Insert'. This will bring up a small dialog box consisting of at least two icons. Choose the Applet icon. Clicking on the new applet component will bring the Form designer window for that applet. Here, we simply drag a new button to the center of the window and change the name of it by selecting the Label' properties field in the Properties window.

Next, we need to create the shell window for which all of the user information will be displayed. The class on which the popup window is based is the java.awt.Frame from the AWT package. Creating a new frame class is as simple as creating the first applet window. Select the Insert menu option and this time select the Component..' item. This will bring up a small dialog window that contains a list of all of the different types of GUI objects that can be inserted. Move down the list until you get to the Forms section and select the Frame option. This will create a new frame object and display the Form designer window for it. Using the Form designer, objects can be dropped into the window and placed to your heart's content.

Interaction
When the user clicks the button in the applet, we want the main frame window to be displayed. We can achieve this in one of two ways: First, look through the documentation and work out how we can create and display a frame window when a user presses the button. Or, you can use something a lot nicer: the Interaction Wizard. This allows simple interactions to be set up just by dragging a line between two component objects. Let's create an interaction between the button and the blank frame window so that when clicked, our new window will be created and displayed.

First, open up the form with the button on it which will be used to open up the window. Next, click on the icon with the two electrical plugs; this will change the mouse cursor. When you move the cursor over various objects, they will highlight. You need to select the origin object from which the activity or event will take place. In this case, click on the button in the main applet window. This will anchor a line from this object.

You have to select which object the interaction will work with. We want the frame to be displayed so we drag the line from our cursor to the frame object in the Project window. Having successfully chosen both objects, the dialog window shown in Figure 3 is displayed. From here, the nature of the interaction is described. As you can see, many different events can happen for a button, but in this instance we only wish to assign an interaction to the on click event. Having selected the event from which the event will be caught, we need to determine what will happen. This is selected from the bottom half of the window.

In this instance we want to display the window, which we can choose from the list. Now, close the dialog box. The interaction has been created. We can test this by hitting the play button on the toolbar or by selecting the Run command from the menu. This will run the applet with the button and, by clicking the button, if all is well, the blank frame window will be displayed. All this occurs without your looking at a single line of code.

Looking at the code Visual Café Pro produced won't do any harm at this point. This can be done by selecting the object, pressing the right hand mouse button and choosing the edit source menu option. This will open up the editor window, from which you can see how the Java code is working to produce the effect. You will notice how the code is also documented. How much better can it get? Not only does it write the code, but it documents the file as well!

Conclusion
This column demonstrated the ease with which Visual Café Pro can be put to use doing the real coding and how, along with various wizards, it can make an excellent training companion. My next column will look at setting up the dbAnywhere database connectivity along with displaying the fields from the name. Future columns will add even more interactivity and functionality to the Informer project.

About Alan Williamson
Alan Williamson is widely recognized as an early expert on Cloud Computing, he is Co-Founder of aw2.0 Ltd, a software company specializing in deploying software solutions within Cloud networks. Alan is a Sun Java Champion and creator of OpenBlueDragon (an open source Java CFML runtime engine). With many books, articles and speaking engagements under his belt, Alan likes to talk passionately about what can be done TODAY and not get caught up in the marketing hype of TOMORROW. Follow his blog, http://alan.blog-city.com/ or e-mail him at cloud(at)alanwilliamson.org.

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

Register | Sign-in

Reader Feedback: Page 1 of 1

Latest Cloud Developer Stories
Swisscom, the Swiss telecom, is going into the cloud business. Its subsidiary Swisscom IT Services AG has signed up with Red Hat as a Certified Cloud Provider and launched a public cloud Infrastructure-as-a-Service (IaaS) cloud targeting enterprise-class customers primarily in ...
Apache Deltacloud, the Red Hat-contributed ReSTful API that abstracts differences between clouds so services on any cloud can be managed – provided of course there’s a driver – has graduated from the Apache Foundation’s incubator and is now a full-fledged Top-Level Project (TLP)....
In a surprise move on Tuesday, January 10, Oracle wheeled out its Big Data Appliance. That’s the one it said in October would be ready sometime in the first half. Only nobody believed it meant early in the first half. Heck, it’s not even clear anybody thought Oracle could make ...
Rackspace Hosting, the service leader in cloud computing, on Thursday announced its acquisition of SharePoint911, an industry leader in SharePoint consulting, training, and "JumpStart" services within SharePoint. The unification of both companies provides capabilities to deliver ...
Wyse Technology, the global leader in cloud client computing, on Thursday announced it's working with Microsoft to market school IT labs and one-to-one computing solutions that allow a cost effective delivery of innovative IT enabled education. These solutions are available throu...
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE

Breaking Cloud Computing News