Universal Java Beans with DB2 from 1999, early Internet work

37
Universal Beans Java and DB2 Matthew Perrins B23

Transcript of Universal Java Beans with DB2 from 1999, early Internet work

Universal Beans

Java and DB2

Matthew Perrins

B23

Contents

Introduction

Crossware

Java

Java Beans

Tools

Summary

Demos

What is a UI for the Web

Web Started as a mechanism to share

informationThrough common protocols and standards

These standards matured to allow HTML to be defined

HTML allows the layout of visual items using a TAG based

syntax

Page design soon became an issue

Early HTML browsers were primitivecausing content to be the main focus not design

Where are we today

Navigator and Internet Explorer supportJava 1.1 Support

HTML 4.0

JavaScript 1.2

Delivering cross platform support on all major GUI

platformsWindows,MAC,OS/2,UNIX Motif

Allowing Internet and Intranet Application development

Still problems with complexity of Design and Development

So how can we improve what we have today

Dynamic HTML

Java 1.1

Beans Components

JavaScript

Objects

View

By Introducing CrossWare

Presentation

Programming

Scripting

Three Major

Components

CrossWare User Interface Design

Internet and Intranet DesignSites moving more towards an application design

Content now becomes separated from Navigation

Objects can be reused creating consistency

Sites move towards navigational views bringing content to users

Visual aspects of design can be improved without need for Java

Start Using to the Components CorrectlyLeverage Internet components to simplify development

Use JavaScript to improve usability of site through easy navigation

Use Beans to deploy effect reuse, a single component can be reused

across applications

IBM Webtop Demo...

Dynamic HTML

Key Components for Dynamic HTML4.0 Specification

CSS 1 & CSS P

Dynamic Fonts

New Object Model

Presentation LanguagePixel perfect positioning

Movable objects more user interaction

Move towards application design not page design

Dynamic HTML

Java 1.1

Java 1.1

Key ComponentsBeans Support

JDBC

Lightweight Component Model–Consistent GUI across platforms

Programming allows:Complex visual objects to be used

Supports communication with other data formats

–Including InfoBus Technology from Lotus

Java Script

Scripting LanguageCan access Cascading Style Sheet Objects

Manipulation all objects including Beans through Bean

Connect

Visual Function can be contained in Java Script Objects

allowing for reuse across applications–Tray, ContentView, Menu , Ticker

With Dynamic HTML and JavaScript.

–Improved design can be achieved without complex

programming

The glue to hold it all together

IBM and Java

Why Java Beans?

What are Java Beans?

Demo - connecting beans

JDBC Beans

Demo - connecting beans to data

Introduction to Beans & DB2

IBM's world-wide Java

Technology Centre

Java source code guardians

for IBM

Porting Centre

Technology advocates

IBM's Java Efforts

Java - The bytecode binary standard for

programs on networksCompiles to standard 'bytecode binaries'

Runs anywhere without recompilation

Industry-wide endorsement & support

100% Pure Java ensures reusability & portability

The IBM ViewPut Java on all IBM platforms (OS/2, AIX, OS/400, MVS)

Connect Java to everything (CICS, MQ, DB2, SNA)

Get everyone to use Java!

Java

CICS Transactions

Available now - CICS Gateway for Java

Pure Java, runs anywhere

MQ Messaging

Under development

Joint activity with Sun

DB2 Databases

Access via JDBC

AS/400 Resources

AS/400 Access Toolkit

SNA Networks

APPC access

Access to Everything

A flexible, open, component model

Provides a packaging unit for third party

vendors

Easy to learn and use

Cross-platform, cross tier

A lightweight alternative to ActiveX

Provides a bridge to ActiveX

Provides a migration path from ActiveX

Why Java Beans?

A Java class that follows a design pattern

defined by the Java Beans Specification.

The design pattern allows other programs,

most commonly Visual Builders, to

understand bean capabilities and so connect

beans together.

Bean capabilities may be inferred, or explicitly

defined.

What is a Java Bean?

A Visual Builder for Java Beans uses existing

Java Beans to create:

New Java Beans

Java Applets

Java Applications

or simply to test Beans under development

Examples:

Visual Age for Java

Lotus BeanMachine

WebRunner

What is a Visual Builder?

Persistence

Properties

Events

Customisation

Packaging

Invisible Beans

...

Java Bean Features Overview

Uses Java serialisation support

In many cases automatic

– May be hand-crafted

State may be stored within container

Used by Visual Builders

Persistence

Define the state of a bean

May be primitive data types such as boolean,

int, char...

...or complex objects

– May be read/write, read only, write only

Accessed via methods

May be simple or indexed

May be bound and/or constrained

Properties

Describe significant things that happen

Are broadcast to listeners

May be selectively listened to

Events

A bean may have Customizers

Bean properties may have Editors

Supplied as standard by the JDK

Provided by the bean author

A visible bean may have a run time user interface

for customisation

Customisation

Bean class(es) and dependant classes and/or

resources packaged in a (compressed) JAR file

Contents of a JAR file described by a manifest

Identifies bean classes

Identifies dependencies

Identifies design time only classes

Resources may include

Saved bean states

HTML help files

Locale dependant information

Images

...

Packaging

Time for a demo

Connecting Beans

Objectives

Easy access to data via JDBC

Maximum flexibility in subsetting query results

Maximum flexibility in connecting data to visual beans

A demonstration vehicle for this Conference

"Universal Data Adapters for the Universal Database"

Not covered

Create, Insert, Update and Delete

JDBC Beans

Query bean encapsulates:

Database driver

Server name/address

Database name

Userid/password

SQL Query

Result set limiter

execute() method performs

Database connection

Query submission

Result set retrieval and data extraction

Disconnection

Query

Selectors provide:

A hook into a defined subset of Query result set

Subset may be customised at design time, or modified

at run time

Flexible data coercion to maximise connectivity to other

beans

Four flavours of selector to suit different views on data:

Cell, Column, Row, CellRange

Multiple selectors may be used to map result set data to

multiple beans

Selectors

CellSelector provides:

Access to a single cell, defined by

column name or number, and row

number

Forename Surname Bonus

Matt Perrins 5,000

Andy Smith 5,000

Lou Gerstner 5,000,000

Cell defined by column name or number, and row

number

Cell definition may be set at design time, and modified at

run time

Column/row indexing may be one based or zero based

Cell value accessible as a bound property, the type of

which may be specified to suit target bean

CellSelector

ColumnSelector provides:

Access to subset of a single column,

defined by column name or number,

and row number

Forename Surname Bonus

Matt Perrins 5,000

Andy Smith 5,000

Lou Gerstner 5,000,000

Column identification the same as with DbCellSelector

Column data may optionally include column label

Column values accessible as bound property, the type

of which may be specified to suit target bean

Property may be a one dimensional array, or a Vector

ColumnSelector

RowSelector provides:

Access to subset of a single row,

defined by start column number, end

column number, and row number

Forename Surname Bonus

Matt Perrins 5,000

Andy Smith 5,000

Lou Gerstner 5,000,000

Row values accessible as bound property, the type of

which may be specified to suit target bean

Property may be a one dimensional array, or a Vector

Values may retain their "native" type when delivered as

a Vector

RowSelector

CellRangeSelector provides:

Access to subset of a columns and

rows, defined by start column number,

end column number, start row number,

and end row number

Forename Surname Bonus

Matt Perrins 5,000

Andy Smith 5,000

Lou Gerstner 5,000,000

Range values accessible as bound property, the type of which

may be specified to suit target bean

Property may be a two dimensional array, or a Vector of

Vectors

Values may retain their "native" type when delivered as a

Vector of Vectors

CellRangeSelector

Image is an example of a visual bean that can present

BLOB (Binary Large OBject) data retrieved from a

database, provided it is in GIF or JPEG format.

Image

Time for

another

demo

Connecting JDBC Beans

Tools

HTML for PresentationNet Objects Fusion

FrontPage

Java for BeansVisual Age Java

Symantec Cafe

Lotus Bean Machine

Visual Age Webrunner

JavaScript for GlueVisual JavaScript

Use the Correct Tools to get the Job done right !

Summary

What We HadC started without and tools and no GUI

Grew into C++ with proprietary class libraries

moved into Visual Basic and still locked to the Windows

platform

15 years of PC development history

The Internet standards are delivering its solutions

in period of 3 years

This has resulted in ....

Summary

Improvements on existing standards allowing for greater UI

flexibilityImproves usability of Sites Design

Leverage the Internet Components to simplify developmentHTML,JavaBeans and JavaScript

Opportunity for real ReUse

Platform Independent Solutions

more information...

IBM activities with Java and Java Beans - http://www.ibm.com/java/

alphaWorks - http://www.alphaworks.ibm.com/

NetObjects BeanBuilder - http://www.netobjects.com/

WebRunner - http://www.software.ibm.com/ad/webrunner/

DB2 UDB - http://www.software.ibm.com/data/db2/

Sun Java Beans site - http://java.sun.com/beans/ or

drill down from http://java.sun.com/

NetObjects Fusion - http://www.netobjects.com/

Useful references

eMail

[email protected]