Full HTML for

Basic foilset JavaBeans CORBA ComponentWare

Given by Geoffrey C. Fox, Wojtek Furmanski at UC Web applications Certificate on Aug 11,14 97. Foils prepared Aug 14 1997
Outside Index Summary of Material


General Issues -- why Java Beans are important and what do they look like!
Background: ComponentWare, Corba, Opendoc, DCOM, ActiveX
An Example JavaBean (see separate JavaBeanStroll and tutorials)
Object Web Development including IIOP for interoperability among Corba2 systems
Detailed Technologies of JavaBeans (see next foil for summary)
  • These include some generic JDK1.1 topics and some which are JavaBean specific
These foils do not cover DCOM or ActiveX in detail
  • There is a separate ActiveX presentation

Table of Contents for full HTML of JavaBeans CORBA ComponentWare

Denote Foils where Image Critical
Denote Foils where Image has important information
Denote Foils where HTML is sufficient

1 JavaBeans CORBA ComponentWare Professional Certificate Version August 97
2 Abstract of Certificate JavaBean/CORBA/ComponentWare Presentation
3 Detailed Technology Summary for JavaBeans
4 Some Suggested JavaBean References
5 CORBA Resources
6 What are JavaBeans I
7 What are JavaBeans II
8 Parts of the JavaBean Brew I
9 Parts of the JavaBean Brew II
10 JavaBean Communication and Event Model
11 JavaBean Communication Model II
12 JavaBean Mechanisms for Interoperating with Remote Objects
13 What is a JAR file ?
14 COM/DCOM/ActiveX in a Nutshell - I
15 COM/DCOM/ActiveX in a Nutshell - II
16 ComponentWare Technologies in Detail
17 3(Multi)-Tier Computing Architecture
18 Microsoft's 3-Tier Programming Model
19 A Web-based 3-Tier Computing System
20 Enterprise JavaBeans
21 JavaBean 3 Tier Architecture
22 What is ComponentWare?
23 From Objects to Components
24 From Objects to Components
25 Components, Frameworks and Ensembles on an Object Bus
26 Components, Frameworks and Ensembles on the Object Bus
27 Example: WebFlow at NPAC
28 Example: WebFlow and HPCC
29 WebFlow: HPCC Simulation
30 WebFlow: Image Processing
31 WebFlow:Collaboration
32 CORBA in Detail
33 What is CORBA?
34 ORB Architecture Overview
35 ORB Architecture Overview
36 CORBA: ORB, Services, Facilities
37 CORBA: ORB, Services, Facilities
38 CORBA Object Development
39 CORBA Object Development
40 Example: Counter/Timer in Java
41 Example: IDL Specification
42 Example: IDL Specification
43 Example: Java Interface
44 Example: Java Interface
45 Example:Client-side Stub
46 Example:Client-side Stub
47 Example: Server-side Skeletom
48 Example: Server-side Skeleton
49 Example:Implementation Template
50 Example:Implementation Template
51 Example:Object Implementation
52 Example:Object Implementation
53 Example: Main Server Program Comments
54 Example: Main Server Program
55 Example: Main Client Program
56 Example: Main Client Program Comments
57 Example: Summary
58 Example vs. ORB Architecture
59 Example vs. CORBA Object Development Process
60 IIOP: New Universal Web Standard
61 Emergent Object Web Architecture
62 Emergent Object Web Architecture
63 Crossware from Netscape Corp.
64 Crossware from Netscape Corp.
65 HTTP/IIOP Integration in Netscape
66 Netscape ONE (Open Network Environment)
67 Netscape ONE (Open Net Environment)
68 Linking CORBA with JavaBeans
69 Towards Enterprise JavaBeans
70 Towards Enterprise Java Beans
71 CORBA Core, Services & Facilities
72 CORBA Services - I
73 CORBA Services - II
74 CORBA Facilities
75 CORBA Facilities
76 CORBA Facilities
77 Commercial CORBA Products: CORE ORB Support
78 Commercial CORBA Products: Common CORBA Services (COS)
79 Towards High Performance CORBA
80 Towards High Performance CORBA
81 Some Aspects of JavaBeans in More Detail
82 Picture of JavaBean and JDK1.1 AWT Event Model
83 ComponentWare Linkage Model
84 JavaBean and JDK1.1 AWT Event Model
85 Registration and Callback
86 Discussion of Event Linkage Model for Message Passing between Modules
87 DataFlow in JavaBeans
88 Persistence and Serialization
89 Serializing Object Graphs
90 Serialization - I
91 Serialization Externalization II
92 RMI: Remote Method Invocation
93 RMI versus RPC Summary
94 RMI Architecture Overview
95 RMI Stubs and Skeletons
96 Other RMI Components
97 Reflection and Introspection
98 The Reflection API
99 BeanInfo and JavaBean Customization
100 JavaBean Design Patterns - I
101 JavaBean Design Patterns - II

Outside Index Summary of Material



HTML version of Basic Foils prepared Aug 14 1997

Foil 1 JavaBeans CORBA ComponentWare Professional Certificate Version August 97

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Geoffrey Fox, Wojtek Furmanski
Syracuse University NPAC
111 College Place Syracuse NY 13244 4100
3154432163

HTML version of Basic Foils prepared Aug 14 1997

Foil 2 Abstract of Certificate JavaBean/CORBA/ComponentWare Presentation

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
General Issues -- why Java Beans are important and what do they look like!
Background: ComponentWare, Corba, Opendoc, DCOM, ActiveX
An Example JavaBean (see separate JavaBeanStroll and tutorials)
Object Web Development including IIOP for interoperability among Corba2 systems
Detailed Technologies of JavaBeans (see next foil for summary)
  • These include some generic JDK1.1 topics and some which are JavaBean specific
These foils do not cover DCOM or ActiveX in detail
  • There is a separate ActiveX presentation

HTML version of Basic Foils prepared Aug 14 1997

Foil 3 Detailed Technology Summary for JavaBeans

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Properties -- setting and inspecting parameters
Object Serialization (JDK1.1) -- jar files, saving JavaBeans
Persistence -- Saved JavaBeans become object oriented database
Reflection (JDK1.1) -- find out class structure
BeanInfo -- general Bean Information
Custom Editors -- Bean Specific Editors
Event Model (JDK1.1) is same as for AWT
Linkage of Beans using event model
Java Remote Method Invocation (RMI) Java's answer to Corba
Distributed JavaBeans for web computing and information systems

HTML version of Basic Foils prepared Aug 14 1997

Foil 4 Some Suggested JavaBean References

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
O'Reilly: Java in a Nutshell by David Flanagan describes JavaBeans as part of extensive JDK1.1 description
Sybex: Java 1.1 Developer's Handbook by Philip Heller, Simon Roberts, Peter Seymour and Tom McGinn is a very detailed description of JDK1.1 including JavaBeans
O'Reilly: Developing JAVA Beans by Robert Englander is a focussed description of JavaBeans from a Java Programmers point of view
Coriolis Group Books: Web developer's guide to javabeans by Jalal Feghhi is an interesting discussion from ComponentWare perspective. Also has CORBA DCOM ActiveX OpenDoc
See resources listed at http://www.npac.syr.edu/education/web

HTML version of Basic Foils prepared Aug 14 1997

Foil 5 CORBA Resources

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
OBM site: http://www.omg.org
NPAC Links to CORBA, DIS & HLA (Distributed Simulation): http://king.syr.edu:2006/src/hasan/DIS
NPAC page withJava and CORBAbooks: http:// king.syr.edu:2006/src/webflow/0.1/notes/books
Netscape CORBA and Crossware white papers: http://developer.netscape.com/library/wpapers/ {crossware,corba}/index.html

HTML version of Basic Foils prepared Aug 14 1997

Foil 6 What are JavaBeans I

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
They are Java's implementation of "component-based" visual programming
This modern software engineering technique produces a new approach to libraries which become a "software component infrastructure(SCI)"
There is a visual interface to discovery of and setting of values of and information about parameters used in a particular software component
JavaBeans uses the event model of JDK1.1 to communicate between components
  • This is exactly same as new AWT event model and shows power of this new model

HTML version of Basic Foils prepared Aug 14 1997

Foil 7 What are JavaBeans II

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The visual interface allows inspection of and implementation of both individual beans and their linkage . This visual construction of linkage allows one to form nontrivial programs with multiple communicating components
Apart from the event mechanism which is a communication/linkage mechanism, ComponentWare (and JavaBeans in particular) "just" give a set of universal rules (needed for interoperability) for rather uncontroversial (albeit good) object-oriented and visual programming practices
  • Hiding of properties which can only be accessed by methods (which must have special names)
  • Display of these properties (as given by methods)

HTML version of Basic Foils prepared Aug 14 1997

Foil 8 Parts of the JavaBean Brew I

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
A JavaBean is "just" a Java Object which is part of some application for the end-user.
JavaBeans implement the JDK1.1 event linkage mechanism for exchanging changes in values of properties and hence invoking responses to these changes.
JavaBeans implement JDK1.1 Object Serialization to represent JavaBeans in "databases" (disk files) and hence define JavaBeans as persistent objects
JavaBeans do not need to implement any particular class or interface.
  • Rather there are a set of naming conventions called the "JavaBean Framework" or "Design Patterns"
These patterns are "discovered" automatically by the "introspection" capability of the reflection API in Java which is invoked by the BeanBox

HTML version of Basic Foils prepared Aug 14 1997

Foil 9 Parts of the JavaBean Brew II

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
A BeanBox is a visual interface that displays (and allows changes to be made to) the properties of a JavaBean and further allows one to see and change the linkage between JavaBeans.
A JavaBean consists of Java Code and possible associated files such as one or more icons, an image or two, a help file etc. This collection of entities is stored in a jar file which is based on the well-known UNIX tar file concept
JavaBeans are naturally used as distributed objects in CORBA and can be linked to both JDBC (and hence databases) and COM from Microsoft.
There is a Java native distributed communication model RMI (Remote Method Invocation) which provides CORBA like capabilities for a pure Java world
  • Basic CORBA capability is invoking a method(aka service) in a remote object

HTML version of Basic Foils prepared Aug 14 1997

Foil 10 JavaBean Communication and Event Model

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
JavaBeans use the same event model as the AWT to communicate between Beans. This involves an indirect structure with Listeners acting as a bridge or broker between Sources (of information) and Sinks or what is synonymous observers.
Source Bean
Listener
Sink Bean
2) Notification of need to communicate
1)
Source Bean
Sink Bean
3) Communicate

HTML version of Basic Foils prepared Aug 14 1997

Foil 11 JavaBean Communication Model II

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
In the simplest case when one combines sink with listener, then one typically finds cycle (with any number of sinks)
  • sink instantiates listener object and passes it to source
  • source calls back listener object which creates some actions in sink module

HTML version of Basic Foils prepared Aug 14 1997

Foil 12 JavaBean Mechanisms for Interoperating with Remote Objects

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Bean
Bean
Bean
Bean
JDB
JDBC
Java Beans Framework
Java Server
CORBA Server
Database Server
RMI
IIOP
Particular
Database Protocol
IIOP is Internet InterORB Protocol

HTML version of Basic Foils prepared Aug 14 1997

Foil 13 What is a JAR file ?

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
This is Java's version of a UNIX tar file and contains a variety of files including .class, image, sound, HTML pages
The JAR file is stored in compressed (zip) fashion and can also be signed using standard digital signature techniques.
  • Perhaps they download faster due to compression!
There is a "control" file called a manifest which inter alia is used to identify any JavaBean present. It also specifies message digest algorithm
JavaBeans must be stored in JAR files and must be identified in manifest
JAR files can be accessed from HTML using &#060APPLET&#062 tag
  • &#060APPLET ARCHIVES="first.jar,second.jar" CODE="yourclass.class" WIDTH=100 HEIGHT=200 &#062&#060/APPLET&#062
Java looks first in .jar files for requested class

HTML version of Basic Foils prepared Aug 14 1997

Foil 14 COM/DCOM/ActiveX in a Nutshell - I

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
First note that the terms component and control are synonymous
DCOM is the distributed version of COM but COM has essentially all the critical object ideas
OLE Controls and ActiveX Controls are variants of COM objects with different additional rules as what services (methods) the object must support
A COM object offers services (methods) through one or more interfaces
All COM objects must offer IUnknown interface which contains methods which are equivalent to JavaBean reflection API (find out about allowed methods) and garbage collection (find out when component no longer needed)
One can use MIDL -- Microsoft Interface Definition Language -- to specify interfaces that can be accessed in a COM object

HTML version of Basic Foils prepared Aug 14 1997

Foil 15 COM/DCOM/ActiveX in a Nutshell - II

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
ActiveX controls have, like JavaBeans, properties that can be queried and modified, a user interface, a set of methods that can be invoked and finally it can generate and send events
JavaBeans can be wrapped into ActiveX components that can be used in an ActiveX container
  • Similarly JavaBeans can be bridged to OpenDoc and CORBA
DCOM provides the following services:
  • Remote Object Creation
  • Remote Object Access
  • Transfer of data between machines using a machine neutral format called NDR (Network Data Representation)
  • Security (not necessary in COM which assumes single user PC) including authentication, authorization, data integrity and data privacy

HTML version of Basic Foils prepared Aug 14 1997

Foil 16 ComponentWare Technologies in Detail

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
ComponentWare in General -- follows
  • starting with a description of "follow-on" architecture to client-server computing which has a 3 tier structure
  • ComponentWare approach is used for tiers 1 and 2
CORBA
JavaBeans
ActiveX/DCOM Not covered in this talk except for brief summary in last 2 foils!

HTML version of Basic Foils prepared Aug 14 1997

Foil 17 3(Multi)-Tier Computing Architecture

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Client runs custom software produced with components such as Visual Basic
Application Server
runs custom software currently
produced in ad-hoc fashion but will adopt
component
approach
Critical
Generic Services such as databases

HTML version of Basic Foils prepared Aug 14 1997

Foil 18 Microsoft's 3-Tier Programming Model

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
In the Microsoft world, one can use Visual Basic and Active-X for a component based approach to both client and middle (application server) levels
On the middle tier, one uses IIS (Microsoft Internet Information Server i.e. their HTTP server) and MTS (Microsoft Transaction Server)
  • COM (formerly DCOM) is Microsoft's distributed shared object model and gives a component based approach to both sequential and distributed computing
  • MTS provides management of sharing, processes, network connections, database connections and pools of threads
Microsoft supports multiple languages (C, C++, Java, Visual Basic) but essentially only the Windows operating system

HTML version of Basic Foils prepared Aug 14 1997

Foil 19 A Web-based 3-Tier Computing System

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Middle Tier
Web Server
Application Server
TP Server
Resource Management
Perl CGI Java Servlets ActiveX
DCOM RMI IIOP HTTP

HTML version of Basic Foils prepared Aug 14 1997

Foil 20 Enterprise JavaBeans

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
These are essentially JavaBeans implemented in the middle tier (as opposed to "normal" client side application)
They naturally involve use of a Java Server (such as Jeeves from JavaSoft) and servlets which are server-side equivalent of applets
They have resource management and security features and are aimed at multi-user server -- not typically single user client applications
They access
  • JDBC Java Database Connectivity API
  • JNDI Java Naming and Directory Interface API
  • JTS Java Transaction Service API
  • JIDL Java IDL (CORBA) Interface Definition Language API
  • JMS Java Management API
  • JMAPI Java Message Services API

HTML version of Basic Foils prepared Aug 14 1997

Foil 21 JavaBean 3 Tier Architecture

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Java Capable Web Browser with JavaBean Client Software
RMI or IIOP
HTTP

HTML version of Basic Foils prepared Aug 14 1997

Foil 22 What is ComponentWare?

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Components are modular reusable atomic software units that enable cross-language cross-platform application development
This is opposed to objects in traditional OO programming models which are usually platform and/or language specific
Java is the first true cross-platform OO language but - it can't be a cross-language model...
ComponentWare models integrate objects in Java, C++, Smalltalk etc. , running on any node in heterogeneous distributed environment

HTML version of Basic Foils prepared Aug 14 1997

Foil 23 From Objects to Components

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
New revolution on the Internet is driven by converging and/or competing ComponentWare technologies such as CORBA, DCOM/ActiveX, RMI, JavaBeans.
We illustrate this rather complex process in the following chart which decomposes the evolution of distributed ComponentWare into vertical (system /complexity) axis and horizontal (user/simplicity) axis
The chart includes also our approach at NPAC towards Web based HPCC in which we build high performance visual ComponentWare on top of Web technologies

HTML version of Basic Foils prepared Aug 14 1997

Foil 24 From Objects to Components

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 25 Components, Frameworks and Ensembles on an Object Bus

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Components interact via Object Bus which offers porable platform for remote method invocation
Applications are conveniently assembled from templates or common frameworks by developing and adding ensembles of application-specific components
Examples of frameworks include:
  • Visual C++/VisualBasic for ActiveX
  • InfoBus (Lotus) / BeanBox (JavaSoft) for JavaBeans
  • OpenDoc (compound document) for CORBA
  • Visual dataflow editor for WebFlow

HTML version of Basic Foils prepared Aug 14 1997

Foil 26 Components, Frameworks and Ensembles on the Object Bus

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 27 Example: WebFlow at NPAC

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
We illustrate here a simple but fully operational Web based ComponentWare model - WebFlow at NPAC
Components are given by Java modules, connected by dataflow channels using visual programming tools
Object Bus is given by a mesh of Java Web Servers, hosting WebFlow modules via specialized servlets
Framework is provided by the visual graph editor applet plus domain specific module libraries (HPCC, imaging, collaboratory are examples shown in next 3 foils)
Ensembles are given by user-developed modules, following the WebFlow API

HTML version of Basic Foils prepared Aug 14 1997

Foil 28 Example: WebFlow and HPCC

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Client Tier
Middle Tier
Third Tier
is Parallel
Computers
for
HPCC

HTML version of Basic Foils prepared Aug 14 1997

Foil 29 WebFlow: HPCC Simulation

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Simulation
Basic Display
Image Filter
Output Display after Filter

HTML version of Basic Foils prepared Aug 14 1997

Foil 30 WebFlow: Image Processing

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Bunch of Filters and Displays
defined in
Java Graph editor
Original Image

HTML version of Basic Foils prepared Aug 14 1997

Foil 31 WebFlow:Collaboration

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Collaboration Server
Collaborating Modules

HTML version of Basic Foils prepared Aug 14 1997

Foil 32 CORBA in Detail

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
ComponentWare in General
CORBA -- follows
JavaBeans
ActiveX/DCOM Not covered in this talk!

HTML version of Basic Foils prepared Aug 14 1997

Foil 33 What is CORBA?

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
CORBA (Common Object Request Broker Architecture) is an Object Bus based distributed computing environment
CORBA standards are developed since by OMG (Object Management Group) of some 700 companies (including IBM, Oracle, Sun, HP, Netscape)
Cross-language support is provided by architecture-neutral IDL (Interface Description Language)
Cross-platform support is provided by IDL-&#062Native Language pre-compilers that generate platform-specific ORB servers, exporting IDL interfaces

HTML version of Basic Foils prepared Aug 14 1997

Foil 34 ORB Architecture Overview

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The following diagram illustrates the overall structure of an ORB, including its client and server components
In fact, distinction between CORBA clients and servers is transient and dynamic, i.e. each ORB on the CORBA bus can act as client and as server
CORBA supports both static ("precompiled") and dynamic ("scripted") remote method invocation models
Here we illustrate in more detail steps involved in building (using Java) a simple static CORBA object and the associated client and server software

HTML version of Basic Foils prepared Aug 14 1997

Foil 35 ORB Architecture Overview

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Clients and Servers both have ORB capability
In some sense
CORBA is
a server-server
not
client-server
model
Note it supports
server object
call-back to
client object

HTML version of Basic Foils prepared Aug 14 1997

Foil 36 CORBA: ORB, Services, Facilities

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Previous diagram illustrated software components involved in enabling remote method invocation for a single object
The next diagram categorizes various objects plugged in and playing on the CORBA bus
The system itself (i.e. ORB vendors) provides a set of base object services and high level facilities
Application objects built by users can refer to CORBA services/facilities as distributed OO libraries

HTML version of Basic Foils prepared Aug 14 1997

Foil 37 CORBA: ORB, Services, Facilities

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 38 CORBA Object Development

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The process, illustrated in the following diagram, starts from specifying the object interface in IDL (which is a static subset of C++)
Next, IDL-&#062Native Language pre-compiler generates appropriate client stubs and server skeletons
Next, the developer completes the pre-compiler work by implementing individual methods of the object under construction
Finally, the modified stubs and skeletons are compiled to build suitable client and server executables
In the following, we will illustrate all software pieces created in this process

HTML version of Basic Foils prepared Aug 14 1997

Foil 39 CORBA Object Development

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 40 Example: Counter/Timer in Java

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
We will build CORBA object for the Count class, to be used for timing the client/server communication overhead in CORBA
The following code elements are displayed:
  • IDL specification of the Count class (provided by developer)
  • Java interface, Server-side Skeleton and Implementation Template, generated by IDL-&#062Java pre-compiler
  • Object implementation (CountImpl), constructed by developer by completing the Implementation Template
  • Main Server program and Main Client Program, constructed by developer and using the Count object to time the performance of its method invocation

HTML version of Basic Foils prepared Aug 14 1997

Foil 41 Example: IDL Specification

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The first step in the CORBA object development process is to specify object in IDL
IDL looks like a static subset of C++
Atomic IDL unit is called a module and it contains a set of class interfaces
Class interfaces contain attributes and methods (similar to Java interfaces)
Method arguments can be scalars, vectors or lists of scalars, vectors or lists (but not general objects, at least in CORBA 2.0)

HTML version of Basic Foils prepared Aug 14 1997

Foil 42 Example: IDL Specification

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Module Counter {
interface Count { // our object
attribute long sum; // current count value
long increment(); // does sum++
};
}
Note: this code is provided by developer and
passed to IDL-&#062XXX language pre-compiler

HTML version of Basic Foils prepared Aug 14 1997

Foil 43 Example: Java Interface

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
IDL-&#062Native Language pre-compiler takes IDL specification as input and generates a suite of auxiliary and/or temporary files
These intermediate files are ORB and Native Language dependent
For example, if Native language is Java, pre-compiler generates Java interface for each IDL interface (next foil) by following IDL-&#062Java mapping rules
Both client and server codes are using this Java interface to refer to the object implementation
The JavaIDL is one way of doing this

HTML version of Basic Foils prepared Aug 14 1997

Foil 44 Example: Java Interface

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
package Counter;
public interface Count extends CORBA.Object {
public int sum() throws CORBA.Exception;
public void sum(int val) throws CORBA.Exception;
public int increment() throws CORBA.Exception;
}
}
Note: This code is created automatically by
IDL-&#062Java pre-compiler from the IDL spec

HTML version of Basic Foils prepared Aug 14 1997

Foil 45 Example:Client-side Stub

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Another auxiliary file generated by IDL-&#062Java pre-compiler is client-side stub (here called _st_Count)
It implements Count interface and extends CORBA.Stub superclass
Count methods and attribute accessors are implemented by opening CORBA.IOStream, submitting the invocation request to the server, retrieving the results from the stream, and returning to the client

HTML version of Basic Foils prepared Aug 14 1997

Foil 46 Example:Client-side Stub

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
package Counter;
public class _st_Count extends CORBA.Stub
implements Count {
public int increment() {
CORBA.IOStream _stream = this._create_request("increment",true);
_invoke(_stream,true);
int _result = _stream.read_int();
return _result;
}
public int sum() { ... }
Note: This code is created automatically by
IDL-&#062Java pre-compiler from the IDL spec

HTML version of Basic Foils prepared Aug 14 1997

Foil 47 Example: Server-side Skeletom

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
A server-side skeleton, here called _sk_Count, plays similar role to the client stub but at the server side, i.e. handles remote method invocation
Skeleton implements Count in terms of the generic exec method of the CORBA.Object
exec is called with the methodId value that uniquely identifies a given method
exec is implemented as a switch which jumps to the appropriate method implementation
the actual method execution is performed by CountImpl instance, here passed as _self argument

HTML version of Basic Foils prepared Aug 14 1997

Foil 48 Example: Server-side Skeleton

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
package Counter;
abstract public class _sk_Count implements CORBA.Object, Count {
public static void exec(Count _self, IOStream _stream, int _methodId) {
switch(methodId) {
case 0: // call increment
int result = _self.increment();
_stream.write_int(_result); return;
case 1: // set sum value
int value = _stream.read_int();
_self.sum(value); return;
case 2: // get sum value
int value = _self.sum();
_stream.write_int(value);
}
}
Note: This code is created automatically by
IDL-&#062Java pre-compiler from the IDL spec

HTML version of Basic Foils prepared Aug 14 1997

Foil 49 Example:Implementation Template

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
IDL-&#062Java preprocessor also generates server-side implementation template for the object under construction
The user needs only to:
  • change the name of this class (here called _example_Count)
  • provide the implementation code for all methods listed in the template code
Note that the pre-compiler generates two accessor methods (for set and get operations) for each object attribute specified by IDL

HTML version of Basic Foils prepared Aug 14 1997

Foil 50 Example:Implementation Template

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
package Counter;
public class example_Count extends Skeleton implements Count {
private int sum;
example_CountImpl(String name) { // Count object constructor
super(name); sum = 0;
System.out.println("Count Object Created!");
}
public int sum() throws CORBA.Exception { // accessor method: getSum
}
public void sum(int val) throws CORBA.Exception { // accessor method: setSum
}
public int increment() throws CORBA.Exception { // increment method
}
}
Note: This code is generated by IDL-&#062Java pre-compiler and needs to be
completed by the developer (by implementing the indicated methods)
Note: This code is created automatically by
IDL-&#062Java pre-compiler from the IDL spec

HTML version of Basic Foils prepared Aug 14 1997

Foil 51 Example:Object Implementation

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Finally, we provide the server-side implementation of the object under construction, here given by the CountImpl class
It is constructed by completing the implementation template as discussed in the previous two foils
Note that our Count is in fact a very simple object: it maintains a counter value called sum and it increments it whenever its increment() method is invoked

HTML version of Basic Foils prepared Aug 14 1997

Foil 52 Example:Object Implementation

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
package Counter;
public class CountImpl extends _sk_Count implements Count {
private int sum;
CountImpl(String name) { // Count object constructor
super(name); sum = 0;
System.out.println("Count Object Created!");
}
public int sum() throws CORBA.Exception { // accessor method: getSum
return sum;
}
public void sum(int val) throws CORBA.Exception { // accessor method: setSum
sum = val;
}
public int increment() throws CORBA.Exception { // increment method
sum++; return sum:
}
}
Note: This code is created automatically by
IDL-&#062Java pre-compiler from the IDL spec

HTML version of Basic Foils prepared Aug 14 1997

Foil 53 Example: Main Server Program Comments

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The main server program performs the following operations:
  • initializes ORB (i.e. connection to the Object Bus)
  • initializes Basic Object Adapter (to be used to register new object instances with the ORB)
  • creates new instance of the Count object
  • registers this instance with the Object Adapter
  • notifies `ready for service' i.e. passes control to the ORB server which loops for method invocation requests

HTML version of Basic Foils prepared Aug 14 1997

Foil 54 Example: Main Server Program

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
package Counter;
class CountServer {
static public void main(String[] args) {
try {
CORBA.ORB orb = CORBA.ORB.init(); // Initialize the ORB
CORBA.BOA boa = orb.BOA_init(); // Initialize the Basic Object Adapter
CountImpl count = new CountImpl("My Count"); // create Count object
boa.obj_is_ready(count); // export new object to the ORB
boa.impl_is_ready(); // ready to service requests
} catch(CORBA.Exception e) { System.err.println(e); }
}
}
Note: This code is created by the developer

HTML version of Basic Foils prepared Aug 14 1997

Foil 55 Example: Main Client Program

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
package Counter;
class CountClient {
static public void main(String[] args) {
try {
CORBA.ORB orb = CORBA.ORB.init(); // Initialize the ORB
// binding by name to the Counter instance on the server
Counter.Count counter = Counter.Count_var.bind("My Count");
counter.sum(0); // initialize counter to zero
long startTime = System.currentTimeMillis();
for(int j=0; j򒮨 j++) { // now increment 1000 times by
counter.increment(); // calling increment() method on server object
}
long stopTime = System.currentTimeMillis();
System.out.println((stopTime-startTime)/1000f);
} catch(CORBA.Exception e) { System.err.println(e); }
}}
Note: This code is created by the developer
This becomes general hierarchical address for arbitrary server

HTML version of Basic Foils prepared Aug 14 1997

Foil 56 Example: Main Client Program Comments

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The main client program performs the following functions:
  • initializes ORB (i.e. opens connection to the Object Bus)
  • binds to the (remote) Count object
  • initializes the counter value to zero
  • initializes the timer
  • loops 1000 times invoking the increment() method each time
  • prints the timed value

HTML version of Basic Foils prepared Aug 14 1997

Foil 57 Example: Summary

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The following two diagrams superimpose all files generated in the Count example on the following charts presented previously:
  • ORB Architecture
  • CORBA Development Process
Note: the whole process looks complicated and messy but only for (multi-language) CORBA object developer/installer - the user program is very simple! (see Main Client code)

HTML version of Basic Foils prepared Aug 14 1997

Foil 58 Example vs. ORB Architecture

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 59 Example vs. CORBA Object Development Process

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 60 IIOP: New Universal Web Standard

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
IIOP (Internet Inter-ORB Protocol) introduced and enforced by CORBA 2 in 1995 offers a standard communication protocol between ORB servers coming from various vendors
In consequence, CORBA 2 compliant ORBs enable true World-Wide distributed computing
Netscape, Oracle, IBM and other major Web and OBM companies recognized recently the strategic role of IIOP for enabling Web based Enterprise Computing

HTML version of Basic Foils prepared Aug 14 1997

Foil 61 Emergent Object Web Architecture

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
IIOP is stateful object-oriented binary communication protocol, suitable for general purpose distributed computing
HTTP is stateless ASCII communication protocol, suitable for hypertext information delivery
Java appears to be a perfect language for Web based ORB engineering
Combination of IIOP & HTTP servers, based on Java platform and referred to as Object Web, will drive soon a new phase transition on the Internet.
Object Web is turning the Internet into a universal global computing system.

HTML version of Basic Foils prepared Aug 14 1997

Foil 62 Emergent Object Web Architecture

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 63 Crossware from Netscape Corp.

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Netscape is the major promoter of the Object Web
Netscape believes IIOP will integrate anti-Microsoft coalition to successfully compete with DCOM/ActiveX
All Netscape browser and server products are coming with built-in IIOP support
Other browsers can acquire ORB capabilities by downloading suitable ORBlets as applets
  • Note in CORBA, one has server capability on all clients and so you invoke the ORB on your client and them get to remote objects around the web
Integration of the 3-tier Object Web with JavaBeans via JavaScript based Bean-Connect technology towards Crossware (see next slide) is under way
Crossware is more of a CORBA enabled object web "philosophy" than a product

HTML version of Basic Foils prepared Aug 14 1997

Foil 64 Crossware from Netscape Corp.

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 65 HTTP/IIOP Integration in Netscape

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 66 Netscape ONE (Open Network Environment)

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
IIOP joins the family of open network protocols maintained and supported within Netscape ONE (Open Network Environment)
JFC (Java Foundation Classes), under joint development by JavaSoft, Netscape, IBM and others, form the portable core for Netscape ONE
  • JFC is essentially a robust commercial strength JDK
In particular, Netscape intends to use JavaBeans as the universal encapsulation model for terminal endpoints between various protocols

HTML version of Basic Foils prepared Aug 14 1997

Foil 67 Netscape ONE (Open Net Environment)

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
ONE is a library of tools to build Web Technology applications -- an unbundling of current servers and browsers

HTML version of Basic Foils prepared Aug 14 1997

Foil 68 Linking CORBA with JavaBeans

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 69 Towards Enterprise JavaBeans

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
At the moment, the main focus in JavaBeans development is at the client side for GUI/widgets engineering
However, the technology is applicable also at the server or middle tier (where JavaSoft calls it Enterprise JavaBeans and develops the specification)
We are currently building new version of WebFlow that uses JavaBeans both for visual editing and for server-side ComponentWare

HTML version of Basic Foils prepared Aug 14 1997

Foil 70 Towards Enterprise Java Beans

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 71 CORBA Core, Services & Facilities

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The strength of CORBA stems from a solid core, augmented by a broad family of standardized interfaces, developed over the last 7 years by OMG
The core layer is given by the ORB model and the associated support to enable remote object invocation
On top of the ORB layer, CORBA offers the Common Object Services (COS) layer
On top of the COS layer, CORBA offers Common (Horizontal) and Vertical Market Facilities
The whole collection is functionally equivalent to an object-oriented distributed operating system

HTML version of Basic Foils prepared Aug 14 1997

Foil 72 CORBA Services - I

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
At present, the following Services are fully specified and published:
  • Naming - locates objects on ORBs
  • Life Cycle - create, copy, move, destroy objects
  • Event - register/unregister interest in specific events
  • Trader - publish/subscribe support for object marketing
  • Concurrency - locking support for resource sharing
  • Security - up to B2 (government strongest) distributed security support
  • Persistency - for transparent storage (file, RDB, ODB)

HTML version of Basic Foils prepared Aug 14 1997

Foil 73 CORBA Services - II

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Externalization - the same as Serialization in Java
Query - search in the object space
Collection - operations on the query results
Relationship - building relations among objects
Licensing - support for object licensing
Time - support for synchronized global clock

HTML version of Basic Foils prepared Aug 14 1997

Foil 74 CORBA Facilities

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
CORBA Facilities are high level software concepts that build on top of Services
Facilities split into Horizontal (general purpose) and Vertical (market specific) segments
At the moment, most facilities are at the level of requirement specifications or Requests for Proposals
The OMG process of specifying Services and Facilities is ongoing, never ending and reflecting the software technology evolution
In the following, we list the major Facilities, discussed in the recent OMG publication

HTML version of Basic Foils prepared Aug 14 1997

Foil 75 CORBA Facilities

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
User Interface
  • Compound Presentation
  • User Support
  • Desktop Management
  • Scripting
Information Management
  • Information Modeling
  • Information Storage and Retrieval
  • Compound Interchange
  • Data Interchange
  • Information Interchange
  • Data Encoding and Representation
  • Time Operations

HTML version of Basic Foils prepared Aug 14 1997

Foil 76 CORBA Facilities

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
System Management
Task Management
  • Workflow
  • Agents
  • Rules
  • Automation
Vertical Market Facilities
  • Imagery
  • Information Superhighway
  • Manufacturing
  • Distributed Simulations
  • Oil and Gas Industry Exploration & Production
  • Accounting
  • Application development
  • Mapping

HTML version of Basic Foils prepared Aug 14 1997

Foil 77 Commercial CORBA Products: CORE ORB Support

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 78 Commercial CORBA Products: Common CORBA Services (COS)

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 79 Towards High Performance CORBA

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
If the current Object Web program succeeds, IIOP will become a `cosmic' message passing protocol
In HPCC domain, people are typically using low level high performance communication packages such as PVM, MPI or Nexus and they consider CORBA/IIOP as not very useful as too low performance
However, it seems possible and natural to build High Performance CORBA support by providing dedicated HP-ORB that offers optimized IIOP on top of Nexus
The resulting HP-CORBA (see next slide) offers an interesting paradigm for new Web based HPCC

HTML version of Basic Foils prepared Aug 14 1997

Foil 80 Towards High Performance CORBA

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index

HTML version of Basic Foils prepared Aug 14 1997

Foil 81 Some Aspects of JavaBeans in More Detail

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
ComponentWare in General
CORBA
JavaBeans -- follows
  • Communication/Linkage Model
ActiveX/DCOM Not covered in this talk!

HTML version of Basic Foils prepared Aug 14 1997

Foil 82 Picture of JavaBean and JDK1.1 AWT Event Model

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
5)Actual Data Transfer

HTML version of Basic Foils prepared Aug 14 1997

Foil 83 ComponentWare Linkage Model

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
This involves sources, listeners and observers and is an interesting multi-tier model of linkage/communication
One can (in some cases) merge observer and listener but not the listener and source
Registration involves sending an object name -- termed the callback object -- from the listener to the source.
When event occurs, the source invokes a particular (event dependent) method of the callback object
Events can be distinguished by using different callback methods (demultiplexing) or by inspecting the argument of a more generic method.
Sources and Listeners use a "controlled syntax" but there are no special interfaces or methods for linkage of observers and listeners as usually(often) these are combined.

HTML version of Basic Foils prepared Aug 14 1997

Foil 84 JavaBean and JDK1.1 AWT Event Model

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The various listeners and events are named in pairs XListener (an interface extending java.util.EventListener) and XEvent (an object extending java.util.EventObject)
Registration involves methods for the source called
  • public void addXListener ( XListener callbackobject)
  • public void removeXListener ( XListener callbackobject)
  • These increment or decrement an array of listeners which the source must keep
Such naming conventions are part of the design pattern for the JavaBean (JDK1.1) framework
X = Component, Focus, Key, Mouse, MouseMotion, Window, Container, Text, Action, Adjustment and Item in JDK1.1 AWT

HTML version of Basic Foils prepared Aug 14 1997

Foil 85 Registration and Callback

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Source of any class
Listener implementing XListener
Source contains method addXListener
Source creates Event of type XEvent
Listener contains a callback object with several methods each accepting argument of
type XEvent
Register
callback
object
Invoke Callback

HTML version of Basic Foils prepared Aug 14 1997

Foil 86 Discussion of Event Linkage Model for Message Passing between Modules

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Here we contrast the simple "A sends a message to B" model normally used in computing with the more general approach in the JavaBean Linkage model

HTML version of Basic Foils prepared Aug 14 1997

Foil 87 DataFlow in JavaBeans

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Define an event ADataReadyEvent with A as source and B as combined sink and listener
A defines an instance Evtcontrol of ADataReadyEvent which has a method transferdata
B instantiates an object Bcallback implementing interface ADataReadyListener with a method readytogo()
B registers this listener object as a callback with A
When A is ready to send data to B, A callbacks Bcallback.readtogo(ADataReadyEvent Evtcontrol)
B calls back Evtcontrol.transferdata(sink information)
Note that "control" mechanism uses powerful JavaBean approach (this is handshake) whereas one can use a totally different and faster approach to actually send data
Traditional (in my world) mechanisms combine control and data transfer

HTML version of Basic Foils prepared Aug 14 1997

Foil 88 Persistence and Serialization

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Persistence of an object implies that one can save its value to some permanent store (e.g. a disk) and read it back
This is implemented using Serializable (default saving) or Externalizable (user defined saving)
In saving a Java Object, we save the values of data members but assume that the entity reading back object has access to class definition so that one just needs data member values to define instance
  • Only save public, protected and private members but not static ones as these are defined in class definition
  • transient variables are not saved
  • If you have confidential data declare it as private transient (and define its value in encoded fashion using non transient variables) or use Externalizable Interface

HTML version of Basic Foils prepared Aug 14 1997

Foil 89 Serializing Object Graphs

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
One needs to flatten the hierarchical linkage of objects to any root Java object
In diagram, one needs to output members of A, B, C and D with D only output once!
Object A
Object B
Object C
Object D
Root object
Leaf object

HTML version of Basic Foils prepared Aug 14 1997

Foil 90 Serialization - I

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The Serialization interface is essentially a flag as there are NO methods or data attached to this interface -- implementing Serialization implies your willingness to be saved using default Java mechanism!
The Serialization process is typically implemented by a container (Java Applet, Application, Java Beans Container)
Typically one serializes to an output stream and deserializes from an input stream
DataOutput Interface describes streams that can write out data in a machine independent fashion
ObjectOutputStream class extends DataOutput (and an ObjectOutput Interface) and defines methods to write out variables of all the primitive types with a general
  • writeObject(Object obj)
  • and a whole bunch of methods like writeShort(int data)

HTML version of Basic Foils prepared Aug 14 1997

Foil 91 Serialization Externalization II

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
java.awt.Component class implements the Serializable interface and any bean extending this class or any of its subclasses is automatically Serializable and hence can be persistent
Note Object class is not Serializable and so one must inherit from a subclass of Object that is Serializable in order to automatically get this property
One can explicitly implement the Serializable Interface by supplying writeObject() and readObject()
Beans should store references to external Beans as transient as linkage is responsibility of BeanBox
Externalizable Objects must implement writeExternal() and readExternal() methods for user implemented persistency

HTML version of Basic Foils prepared Aug 14 1997

Foil 92 RMI: Remote Method Invocation

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
This is Java's CORBA-like capability to allow Java objects to access each other's methods remotely
Note COM is Microsoft's (remote) object model
CORBA is Industry (OMG) remote object model
RMI is Java's way for remote objects to communicate
It extends the well known Remote Procedure Call (RPC) used in UNIX
RMI is thus part of a JavaBean global object model
  • One can imagine that RMI will not "survive" but rather one will use instead the JavaBean to CORBA interface described in earlier examples

HTML version of Basic Foils prepared Aug 14 1997

Foil 93 RMI versus RPC Summary

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
RPC was designed for UNIX systems
RPC serializes parameter and return values but is simpler than RMI as one was not using objects
External Data Representation (XDR) is used by RPC to support data serialization
RPC uses fast but unreliable UDP protocol
RMI uses slower but reliable TCP/IP

HTML version of Basic Foils prepared Aug 14 1997

Foil 94 RMI Architecture Overview

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
This involves transport of serialized objects
RMI Client
RMI Server
Client Side Stubs
RRL: Remote Reference Layer
Transport Layer
Server Side Skeleton
RRL: Remote Reference Layer
Transport Layer
Created by rmic command

HTML version of Basic Foils prepared Aug 14 1997

Foil 95 RMI Stubs and Skeletons

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Stubs are the client side proxies representing the remote server side objects
  • They look like local objects as far as other client side objects are concerned
  • They serialize input parameter data and pass to RRL as a "marshall stream"; correspondingly stubs deserialize return values of remote methods and pass to client object that called remote method
The skeleton is server side interface of server side method to RRL
  • The skeleton deserializes input parameters and calls actual server side method; it serializes return values and hands as "marshall stream" to RRL

HTML version of Basic Foils prepared Aug 14 1997

Foil 96 Other RMI Components

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The RRL takes care of references between client and server
The transport layer is responsible for establishing connection between client and server
The RMI Registry must be started before the server side application and maintains a list of "published objects"
  • The server exports its methods by calling rebind() or bind() methods of Naming class (in java.rmi package) which associate a specific name with a particular server side object
  • The client uses lookup() method of Naming with a URL argument to obtain a reference to a server side remote object
Security is implemented using RMISecurityManager which customizes the normal Java Security Manager
Note RMI essentially uses Java as its IDL and does not have a special skeleton/stub definition language

HTML version of Basic Foils prepared Aug 14 1997

Foil 97 Reflection and Introspection

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Introspection refers to the process by which JavaBeans are inspected to discover their characteristics. This a combination of
  • Explicit Information provided by the BeanInfo interface where the bean fred must have BeanInfo fredBeanInfo
  • A combination of design patterns (naming conventions for methods events properties etc.) and use of the Java Reflection mechanism
The Java Core Reflection API allows one to determine information about objects at runtime.
  • It consists of a set of classes in the java.lang.reflect package, enhancements to the Class class and extensions to java.lang package to provide more uniform powerful wrapper classes for the primitive types.
The reflection API is used in two ways:
  • lightweight: public methods fields and constructors: this is JavaBean case
  • heavy weight: all aspects of an object: this is Object Serialization, debugger, interpreter and class browser need

HTML version of Basic Foils prepared Aug 14 1997

Foil 98 The Reflection API

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
First one invokes for any Object obj
  • Class cl = obj.getClass()
Second process instance cl of class Class, has methods
  • public Field[] getFields() returns all fields in object
  • public Method[] getMethods() returns all methods in object
  • public Constructor[] getConstructors() returns constructors
These return public instances only
Thirdly process arrays like Field, Method, Constructor etc. which are in java.lang.reflect and have a whole set of methods to find out further information including
  • fl =Field[0]
  • fl.getName() obtains name
  • fl.get(Object obj) gets value of field
  • fl.set(Object obj) sets value of field
  • fl.getType() is type of field etc.

HTML version of Basic Foils prepared Aug 14 1997

Foil 99 BeanInfo and JavaBean Customization

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
The java.beans.BeanInfo interface is used to define everything about a Bean that is not implied by reflection and design patterns
extend java.beans.SimpleBeanInfo which defaults all the methods to null which implies that one use reflection
  • this allows one to violate all the design patterns for methods events and properties and supply information by hand!
BeanInfo can supply
  • an icon to represent Bean
  • a list of supported properties, events and methods with a short (help) description of them
  • the default property event or method
  • custom property editors for all or some of properties of the Bean
BeanDescriptor is one of entities you can get from BeanInfo and this holds overall information about the Bean

HTML version of Basic Foils prepared Aug 14 1997

Foil 100 JavaBean Design Patterns - I

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Beans of name B:
  • Any class or superclass
  • Needs a no-argument constructor
  • JAR file manifest entry specifies Java-Bean: True
Property P of type T is gotten by public T getP()
  • or public boolean isP() if P boolean
  • and set by public void setP(T value)
  • add index to argument for arrays
Bound and Constrained Properties are each supported by a single list of event listeners and B must support methods
  • addPropertyChangeListener(PropertyChangeListener l) Bound
  • removePropertyChangeListener(PropertyChangeListener l)
  • addvetoableChangeListener(VetoableChangeListener l) Constrained
  • removevetoableChangeListener(VetoableChangeListener l)

HTML version of Basic Foils prepared Aug 14 1997

Foil 101 JavaBean Design Patterns - II

From JavaBeans CORBA ComponentWare UC Web applications Certificate -- Aug 11,14 97. *
Full HTML Index
Events with name E
  • event class name: Eevent
  • event listener class name: Elistener
  • listener methods: public void methodname(Eevent E)
  • listener registration: public void addEListener(Elistener l)
  • listener removal: public void removeEListener(Elistener l)
No constraints on names for methods
BeanInfo class (for Bean B) is BBeanInfo
Property Editor for properties of type T are Teditor
  • can register editors for individual properties via PropertyDescriptor
Customizer for Bean B is typically called BCustomizer and must be a component with a no argument constructor
  • In general register name via BeanDescriptor

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Jan 8 1998