Universal Beans Java and DB2 Matthew Perrins B23.

37
Universal Beans Java and DB2 Matthew Perrins B23

Transcript of Universal Beans Java and DB2 Matthew Perrins B23.

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 standardsThese standards matured to allow HTML to be definedHTML allows the layout of visual items using a TAG based syntax

Page design soon became an issue Early HTML browsers were primitive

causing content to be the main focus not design

Where are we today

Navigator and Internet Explorer supportJava 1.1 SupportHTML 4.0JavaScript 1.2

Delivering cross platform support on all major GUI platforms

Windows,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

Java Script

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 NavigationObjects can be reused creating consistencySites move towards navigational views bringing content to usersVisual aspects of design can be improved without need for Java

Start Using to the Components Correctly Leverage Internet components to simplify developmentUse 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 SpecificationCSS 1 & CSS PDynamic FontsNew Object Model

Presentation LanguagePixel perfect positioningMovable objects more user interactionMove towards application design not page design

Dynamic HTML

Java 1.1

Java 1.1

Key ComponentsBeans SupportJDBCLightweight Component Model

–Consistent GUI across platforms Programming allows:

Complex visual objects to be usedSupports communication with other data formats

–Including InfoBus Technology from Lotus

Java Script

Java Script

Scripting LanguageCan access Cascading Style Sheet ObjectsManipulation all objects including Beans through Bean Connect

Visual Function can be contained in Java Script Objects allowing for reuse across applications

–Tray, ContentView, Menu , TickerWith Dynamic HTML and JavaScript.

–Improved design can be achieved without complex programming

The glue to hold it all together

IBM and JavaWhy Java Beans?What are Java Beans?Demo - connecting beansJDBC BeansDemo - 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 forprograms on networks

Compiles to standard 'bytecode binaries'Runs anywhere without recompilationIndustry-wide endorsement & support100% 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 TransactionsAvailable now - CICS Gateway for JavaPure Java, runs anywhere

MQ MessagingUnder developmentJoint activity with Sun

DB2 DatabasesAccess via JDBC

AS/400 ResourcesAS/400 Access Toolkit

SNA NetworksAPPC 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 JDKProvided 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 manifestIdentifies bean classesIdentifies dependenciesIdentifies design time only classes

Resources may includeSaved bean statesHTML help filesLocale dependant informationImages...

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 FusionFrontPage

Java for BeansVisual Age JavaSymantec CafeLotus Bean MachineVisual 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 GUIGrew into C++ with proprietary class librariesmoved into Visual Basic and still locked to the Windows platform15 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 flexibility

Improves usability of Sites DesignLeverage the Internet Components to simplify development

HTML,JavaBeans and JavaScriptOpportunity for real ReUsePlatform 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 protected]