Enterprise Java
Introduction
Peter Komisar © Conestoga
College version 2.0 Fall / 2007
Reference:
Draft Document for Review August 22,2007
5:25 pm SG24-7501-00 Rational Application Developer
V7 Programming Guide.
This is a synopsis
of information found in Introduction
and part of the second chapter of the Draft Document
for Review August 22, 2007 5:25 pm SG24-7501-00
Rational Application Developer V7 Programming Guide.
It has been prepared for private academic purposes
and is not an effort to publish the contained material.
General Focus
Early in Java's development, the language split
into different versions. The standard version was
augmented with the Micro version for things small
and the Enterprise edition for things large, namely
enterprises.
The Enterprise edition really caters to programming
that is done on servers that would be of typical use
to organizations both small and large.
IBM early on embraced the open source movement
and Java. They created Eclipse, a Java IDE which
they released into the Open Source world. They also
spent much effort creating the WebSphere line of web
server applications. Soon after they took advantage
of Eclipse as a tool to develop applications on
WebSphere.
More recently a very powerful and highly respected
company, in the world of Object Oriented programming,
Rational, famous for it's founders the 'four amigos' who
authored UML was impacting the world of application
development.
IBM recognized the quality of their assets and bought
Rational. Rational, like IBM had extended Eclipse to
create an Application Development IDE for Enterprise
Java.
Because of many added features that the Rational
tool brought to the table, IBM dropped it's WebSphere
Studio and adopted Rational's Application Developer
Tool which in August of 2007 has been released in
version 7.
Eclipse
or RAD 7
While there are many value added features with
RAD 7, essentially they build on Eclipse. The world
of Eclipse is a power to be reckoned with and just
doesn't sit idly by while improvements are made to
the RAD 7 package. The Eclipse developers have
been supplying tools that may be more spartan but
none the less do the same sorts of things that RAD
7 does.
In the previous version of this course we carried
both Eclipse and RAD 7 forward. The course ended
up being IDE heavy. As well it turns out that licencing
RAD 7 'seats' are very expensive. As well, in the previous
course we ran short on time explaining the underlying
Enterprise technologies as we were also training for
use of the IDE.
In this rendition we will attempt to resculpt the course
with the following objectives.
New Course Objectives
- Use only Eclipse as our IDE
- // might visit Sun's IDE as well
- Create our own sample applications
- Spend more time explaining the technology
- // less trying to show off the IDE
- Attempt to Simplify the Presentation of
J2EE
We leave the blurb on RAD 7 just to understand the
context which we are in. Some students may be interested
in following a parallel trail using RAD 7.
IBM Rational
Application Developer
for WebSphere Software V7.0
Having bought it, the Rational Application now has
the IBM moniker as noted in our title above.
The software is described as follows:
"IBM Rational Application Developer for WebSphere
Software V7.0 is an integrated development environment
and platform for building Java Platform Standard Edition
(Java SE) and Java Platform Enterprise Edition (Java EE)
applications with a focus on applications to be deployed
to IBM WebSphere Application Server and IBM WebSphere
Portal."
//
an IDE for both Standard and Enterprise Editions with
// a focus on applications to be
deployed on WebSphere...
Following
is a list of Rational Components which have
parallels developed or in development in Eclipse.
Rational Component Products
- Rational
Software Modeler
- a UML-based visual modeling and design tool
- Rational
Software Architect
- a design tool that leverages model-driven development
with UML to create well-architected applications, including
those based on service-oriented architecture (SOA).
//
useful for architects and senior developers
- Rational
Application Developer
- a suite of development, analysis, and deployment tools
for rapid Java EE, Enterprise JavaBeans, portlets,
and Web applications.
//
previously Application Developer V6.0 and WebSphere
// Studio Application Developer V5.x
- Rational
Functional Tester
- an automated testing tool that tests Java, HTML,
VB.NET, and Windows® applications.
- Rational
Performance Tester
- a multi-user system performance test product
- designed to test Web applications
- focuses on scalability.
- a manual test authoring and execution tool
- promotes test step reuse
- WebSphere
Business Modeler
- targets the business analyst who models business
processes. can generate Business Process Execution
Language (BPEL) definitions which can be imported
into WebSphere to create applications for the
WebSphere Process Server.
//
not a Rational brand product
Versions
The text used in the course describes version 7 of the
product which is backwards compatible with version
6 and WebSphere Studio Application Developer
Version 5. We will extract the Eclipse trail out of the
pdf which incidently is very highly rated.
Themes
Following are themes that the
IBM Rational software
attempts to capture.
- Open computing
- latest open standards
- Eclipse 3.2
- JDK 5 //
old already
- JavaServer Faces 1.1 etc.
- Consumability
- improve
- trying, buying, downloading
- installing, deploying running
- servicing, migration from trial
- Compliance
- optional enforcement of floating licenses
- SOA
- generalize the approach to SOA
- improved web services tools
- new web service wizard
- new WSDL visual editor
Operating
System Support
Microsoft
- XP Professional with Service Pack 1
or 2
- Various Windows 2000 Professional and
Server editions
- Windows Vista
Linux on Intel®:
- Red Hat Enterprise Linux
Workstation
Version 4.0
- Red Hat Desktop Version 4.0
(running
in 32-bit mode)
- SUSE Linux Enterprise Server
(SLES)
Version 9 (all service packs;
running in 32-bit mode)
Databases
Supported
IBM Cloudscape V5.1
IBM DB2 Universal Database //
many versions
Apache Derby 10.0, 10.1
Generic JDBC 1.0
Informix Dynamic Server V9.2, V9.3, V9.4, V10.0
MySQL 4.0, V4.1
Microsoft SQL Server 2000
Microsoft SQL Server 2005
Oracle8i V8.1.7, Oracle9i, Oracle10g
Sybase Adaptive Server Enterprise V12.x, V15
//
gloss CD package contents, many new features,
// and which Java versions are
supported
The Eclipse Project
The Eclipse Project is an open source project devoted
to creating a development platform along with integrated
tooling.
Components of Eclipse
- Eclipse Platform
- a foundation that tool developers can extend
- Eclipse Java Development Tools (JDT)
- workbench
- concept of projects
- user interface libraries (JFace, SWT)
- built-in help engine
- support for team development
and debug
//
The JDT is specifically Java-based and adds concepts of Java
// projects,
perspectives, views, editors,
wizards, and
refactoring tools.
- Eclipse Plug-in Development Environment (PDE)
- tools for developing Eclipse plug-ins.
IBM Eclipse SDK
V3.2
"The IBM Eclipse SDK V3.2 is an IBM branded and
value added version of the Eclipse SDK V3.2. The
IBM Eclipse SDK V3.2 includes additional plug-ins
and the IBM Java Runtime Environment (JRE) V1.5
and V1.4.2."
The following components are part of IBM Eclipse
SDK V3.2:
Components of IBM Eclipse SDK
V3.2
- Eclipse SDK 3.2 (Platform, JDT, PDE)
- Eclipse Modeling Framework (EMF)
- Eclipse Hyades
- C/C++ Development Tooling (CDT)
- Graphical Editing Framework (GEF)
- XML Schema Infoset Model (XSD)
- UML 2.0 Metamodel Implementation (UML2)
- IBM Java Runtime Environment (JRE) V1.5 and V1.4.2
Connection of IBM Eclipse SDK to Rational Platform
"The IBM Eclipse SDK V3.2, which provides an open,
portable, and universal tooling platform, serves as the
base for the IBM Rational Software Delivery Platform
common to many Rational products including Application
Developer V7.0."
Test Server
environments
Application Developer V7.0 support a number of
server environments for running, testing, and
debugging application code. In Application Developer
6.0 and 7.0 a full version of IBM WebSphere Application
Server is provided.
IBM Servers Environments
Provided
- IBM WebSphere Application Server
- V6.x, V6.1, V6.0, V5.x, V5.1
- IBM WebSphere Application Server Express V5.1
Other Servers Available For Use
- Apache Tomcat
- V3.2, V4.0, V4.1, V5.0, V5.5
- Oracle® OC4J Standalone Server V10.1.3
System
Requirements
The system hardware requirements are as follows:
- Pentium® III 800 MHz or higher
- 1 GB RAM minimum
- 1024x768 video resolution or higher
- 2 GB or free hard disk space to install all components.
- The temporary (/tmp Linux or c:\temp Windows) -> at least 500
MB
//
detailed steps page 1177 of the RAD 7 pdf
//
see pdf for licencing info, migration updates etc.
Tools
Application Developer V7.0
includes a large
number of tools, listed below to assist in simplifying
and eliminating error-prone taskes. Many similar
tools are also made available for Eclipse.
Tool List
- Java development tools (JDT)
- Relational database tools
- XML tools
- Web development tools
- Struts tools
- JSF development tools
- SDO development tools
- Enterprise Generation Language tools
- EJB tools
- Portal tools
- Web services tools
- Team collaboration tools
- Debugging tools
- Performance profiling and analysis tools
- Server configuration tools
- Testing tools
- Deployment tools
- Plug-in development tools
Sample
code
The RAD 7 pdf supplies sample code. We in
an effort to develop a better understanding of
Enterprise Java will develop our own simple
examples as we go.
Programming Technologies //
chapter 2 in RAD 7 pdf
Chapter 2 of the Rational text considers the different
programming technologies that are used to generate
Enterprise Applications. Whether viewing from the
Enterprise edition from IBM's view or Sun's documentation
the same underlying technologies are used.
Below the component technologies are listed
Component Programming
Technologies Used in J2EE
- Desktop applications
- Static Web sites
- Dynamic Web applications
- Enterprise JavaBeans
- J2EE Application Clients
- Web services
- Messaging systems
Desktop
applications
By desktop applications for the most part run
on a single machine which the user interacts
with via a user interface. We say mostly as
a database running on another machine may
be involved, in which case is is viewed as a
service. All the main parts of the application,
the user interface, the business logic and the
control of flow are governed on the desktop.
Example Scenario
As an example, a situation is described where
a bank requires an application "to allow workers
in a bank call center to be able to view and update
customer account information." A starting point for
this "Call Center Desktop" might be a simple
stand-alone application designed to run on
desktop computers.
We need early on to consider our own custom
applications that we create that exercises similar
aspects of the Enterprise Java platform.
Java
2 Standard Edition
The standard edition of Java provides all the resources
needed to build such an application as well as the
runtime environment to allow the application to be
executed.
Application Developer V7.0 supports the new
features found in Java SE V5.0. The book sticks
with code that works in version 1.4 so be consistent
with Java EE level 1.4.
As of this revision of this note, the JDK is at version 6
and the Enterprise Edition is in version 5.
Rational's
Description of Java
Rational see's Java as a general purpose, object-oriented
with basic language syntax similar to C and C++, with
significant differences. Java is seen as a higher-level
language than C or C++ as the developer is provided
with a more abstracted view of the underlying hardware,
with the user relieved of managing memory.
Compilation doesn't create executable binaries, rather
intermediate byte code which is executed by on a Java
Virtual Machine or JVM.
To create the Desktop app Rational describes the following
features they should be in the development tool, which, no
surprise, are present in Application Developer 7.0.
This yard stick can be applied to various IDE, including
Sun's NetBeans, and plain Eclipse.
What Rational Thinks Should be
in a Development Tool
- A specialized code editor, providing syntax highlighting
- Assistance
with completing code and
correcting
syntax errors
- Facilities for visualizing the
relationships between application classes
- Assistance with documenting code
- Automatic
code review functionality ensure use of best practices
- A simple way of testing applications
Database Access
Rational expects the The Call Center Desktop will need to
access data residing in a database such as IBM's own DB2
Universal Database.
The Java Standard Edition supplies the following
connective technologies to meet this end.
Java Standard Edition
Connective Technologies
- JDBC
- RMI // Java Remote Method
Invocation
- JNDI // Java Naming and Directory Interface
- Java IDL // Java's Interface Definition
Language for CORBA
In Chapter 2 of the text the focus is on JDBC. JDBC
remains the primary workhorse in the world of Java to
handle database connectivity.
JDBC
"Java SEV1.4 includes JDBC V3.0. In earlier versions
of Java SE, the classes contained in the jaxa.sql package
were known as the JDBC Core API, whereas those in
the javax.sql package were known as the JDBC Standard
Extension API (or Optional Package), but now the V1.4
JDBC includes both packages as standard.
Although JDBC supports a wide range of data store types,
it is most commonly used for accessing relational databases
using SQL.
Common Classic JDBC Classes and
interfaces
- java.sql.DriverManager and javax.sql.DataSource
- // used to obtain a connection to a database system
- java.sql.Connection
- // represents the connection to a database system
- java.sql.Statement, PreparedStatement, and CallableStatement
- // represent executable statements used in updates &
queries
- java.sql.ResultSet
- // represents the values returned from a
database query
JDBC types such as java.sql.Date and java.sql.Blob are
Java equivalent of SQL data types that there is no Java
primitive type for.
Eclipse and RAD 7 Supplied
Features for Database Development
- access to all the facilities of JDBC V3.0
- A view of the structure of an external database
- A mechanism for viewing sample contents of tables
- a way to import structural information from a database
- wizards & editors to manipulate database relations
- A feature to export mods to an external database server
- A wizard to help create and test SQL statements
Graphical
User Interfaces
Applications are enhanced by by providing graphical user
interfaces (GUIs). Java supplies AWT and Swing to create
GUIs. IBM adds the SWT
Abstract
Window Toolkit (AWT)
The Abstract Window Toolkit (AWT) has been enhanced
however it's basic building blocks have remained the same.
AWT Components
- user interface components
- // [java.awt.] Frame, Button, Label etc.
- An event-handling model
- // events such as button clicks, menuchoices etc.
- graphics and image processing classes
- layout manager classes
- // for positioning components
- drag-and-drop functionality
The AWT is implemented natively and have the
same look-and-feel as the operating system.
Downside
- the range of GUI components is limited
- and thelook-and-feel cannot be changed.
Swing
The new Swing that was added to Java provides
a number of more sophisticated GUI components,
(trees tables, etc. ) Components that overlap with
AWT have a J prefix and reside in a different package.
Example
java.awt.Button vs javax.swingJButton
Upside
- a richer set of controls
- pluggable look-and-feel
Downside
SWT, Standard
Widget Toolkit //
Eclipse Widgets
The Standard Widget Toolkit (SWT) is the GUI
toolkit provided with Eclipse and originally used
to build the Eclipse GUI. The SWT is written entirely
in Java and uses the Java Native Interface (JNI™)
to call through to the operating system where
possible.
//
uses native components when possible
The SWT uses native calls when components are
available and builds component in Java when a native
one isn't available.
SWT may be thought of as the best of both worlds,
AWT and Swing.
SWT Features
- a rich, portable component model //
like Swing
- the same look-and-feel as the native OS //
like AWT
- SWT GUIs perform well //
like AWT
Downside // minor problem
SWT is not a standard part of Java SE V1.4. An
application using SWT has to be installed together
with SWT class libraries. This is not that big a problem
as the libraries are open source and freely distributable.
Standalone
Applications vs Applets
Java applets normally run in a JVM provided by a
Web browser or a Web browser plug-in. Typically
the JVM has a very strict security model, by default.
Because of accessing restrictions, they are not
normally suitable for applications requiring access
to databases.
Eclipse and RAD
7 Features for GUI Building
- a specialized editor that uses a variety of frameworks
- focus on GUI layout, rather than code
- able to add event-handling code & business logic calls.
- dynamic, immediate reflection of changes visually
- testing facilities for the GUI
XML
XML or Extensible Markup Language supplies a common
medium for different system using different data formats, to
communicate. In Rational's Call Center Desktop application
XML is used to able the exchange data with other applications.
XML is a standardized and easy language useful for the
exchange of data. The structure of the data is described in
the XML document itself. Mechanisims exist to validate that
the the conforms to an agreed format (Document Type
Definitions (DTDs)) and XML schemas (XSDs)).
Enterprise Java uses XML for configuration files called
deployment descriptors, and WebSphere Application Server
V6 uses XML files for storing its configuration settings.
Java SE V1.4 includes the Java API for XML Processing (JAXP).
JAXP contains the following parts.
JAXP Components
- A parser interface
- based on the W3C Document Object Model (DOM)
- builds a representation of an XML document within an app
- The Simple API for XML Parsing (SAX),
- allows event-driven dynamic document parsing
- XSL Transformations (XSLT), Extensible Stylesheet Language
- allows transformation of XML documents into different forms
Eclipse and Rational's XML
Development
Features
- an XML editor, that check for 'well-formedness'
- well-formedness ->
- XML structural conformance
- adherence to a DTD or Schema
- wizards for ->
- creating XML documents from DTDs & Schemas
- creating DTDs and XML schemas from XML documents
- converting between DTDs and XML schemas
- generating JavaBeans to represent XML data
- creating XSL
- a test and debug environment for XSL transformations
To do
1) Find Eclipse in the Enterprise Edition at the Eclipse
Web site.Take a copy and have one on your personal
drive at the school, on your USB stick, ( if there is room
and on your home and / or work PC.)
2) Consider an informal description of a business
for which you will create an Enterprise application.
This will take the form of a project for this course.
It should have the following components. You will see
that in the literature we use as reference, many of these
functionalities are exampled.
- An AWT/Swing or SWT standalone GUI
- the function might be employee access related
- an administrative utility
- A static HTML main page
- Sub pages will be dynamic JSP pages
- Accesses will be to back-end resources such as
- a standalone Java application
- through servlets making calls on the Java application
- The Java application will retrieve data from a database
- The Java application may ( optional ) use EJBs
For the database, typically inventory information will need
to be stored and retrieved. The GUI might be a time entry
system, where hours worked might be added. It could also
be an admin tool where accounts are added or removed.
What we might do is emulate the banking application that
the RAD 7 pdf uses as an example but simplify it so our
tour of the Enterprise system is easier to comprehend.
Perhaps a study of the Banking app will allow us to create
a simplified skeleton of the overall application structure.
Assignment
Following we touch base with each of the technologies
mentioned in the last part of the note.
1 ) Create a Java program with methods that gets and sets
an int value, a double and a String value. Show the program
outputing the values to screen using System.out.println
statements.
2) Create a Swing GUI that uses setText( ) methods to set
each of these values in three textfields when a button is
pushed.
3) Create an XML document that describes a house.
The primary element would be called house. Then sub-elements
would be each of the rooms in the house. For example the
living room, dining room etc. This can be as basic as you
like.
IBM's Rational wizards will provide much of our programming
for us. So we needed be concerned from developing the above
from a 'clean sheet'. Feel free to browse the net for simple base
examples of each of the above codes and use them as a base
to provide your solutions.
Assignment Form
Name Assignment Number Topic
Question
Your Answer
etc.