94
TOOLS Europe ‘99 Tutorial TOOLS Europe ‘99 Tutorial Trygve Reenskaug, Lasse Bjerde Trygve Reenskaug, Lasse Bjerde Numerica Taskon Numerica Taskon Oslo Oslo Unleashing the Power Unleashing the Power of Distributed of Distributed Enterprise Information Enterprise Information Systems Systems

TOOLS Europe ‘99 Tutorial Trygve Reenskaug, Lasse Bjerde Numerica Taskon Oslo Unleashing the Power of Distributed Enterprise Information Systems

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

TOOLS Europe ‘99 TutorialTOOLS Europe ‘99 Tutorial

Trygve Reenskaug, Lasse BjerdeTrygve Reenskaug, Lasse Bjerde

Numerica TaskonNumerica TaskonOsloOslo

Unleashing the Power Unleashing the Power of Distributed of Distributed

Enterprise Information Enterprise Information SystemsSystems

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Legal NoticeLegal Notice

This presentation is copyright ©1998 Trygve Reenskaug, Lasse Bjerde

Oslo, Norway.

All rights reserved.

Unauthorized reproduction prohibited.

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

The Connected EnterpriseThe Connected EnterpriseContent and CommunicationContent and Communication

AerialPhotos

DigitalMap

CensusData

HouseDrawings

PoliceRecords

PoliceDispatcher

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

AdvantagesAdvantagesCommunication-Centered paradigmCommunication-Centered paradigm

• Unlimited Scaling

• Distributed Information Ownership

• Support people’s Tasks

• Flexible Consistency Requirements

• Unlimited Scaling

• Distributed Information Ownership

• Support people’s Tasks

• Flexible Consistency Requirements

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

The Real ChallengesThe Real Challenges

TheConnected

Organization

TheConnected

Organization

Effective,Enjoyable

andInstructive

Tools

Effective,Enjoyable

andInstructive

Tools

EffectivePartitioning

ofInformation

Services

EffectivePartitioning

ofInformation

Services

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

ExerciseExercise

Assuming that a great variety of information services are available:

List users who will benefit from using this new technology in

performing their tasks.

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

The Short-Term ProblemsThe Short-Term Problems

GUIGUI Business LogicBusiness Logic DatabaseDatabase

Multithreading/Transactions/Security/…Multithreading/Transactions/Security/…

Middleware (distribution)Middleware (distribution)

Java Beans Enterprise Java Beans

Enterprise Java Beans

Java Remote Method Invocation

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan

• Introduction: The connected enterprise

• The powerful communication paradigm

• Divide and conquer.Separation of concern with role models,responsibilities, and interfaces

• The Lego idea.Constructing software with components

• Summary.How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction: The connected enterprise

• The powerful communication paradigm¤ The new paradigm¤ An Applet built with Java Beans¤ Remote Method Invocation (RMI)

• Divide and conquer.Separation of concern with role models,responsibilities, and interfaces

• The Lego idea.Constructing software with components

• Summary.How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

CPU-CenteredCPU-Centeredparadigmparadigm

Input

Tape

Output

Hardware Software

FORTRANAlgol 60

CentralProcessing

Unit

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Storage-CenteredStorage-Centeredparadigmparadigm

Input

Tape

Output

Hardware Software

CentralProcessingUnit

Disk

Shareddatabase

App.1 App.2

App.4App.3

DB Schema languagee.g. Entity-Relation

e.g. NIAM

Memory

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Communication-Centered Communication-Centered paradigmparadigm

Memory

Input

Tape

Output

Hardware Software

CentralProcessingUnit

Disk

Composition tools.Languages ????

Com

mun

icat

ion

Bus

Object 1 Object 2

Object 4Object 3 Info

rmat

ion

Bus

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

IN OUT-B

OUT-C

Methods Variables

The communication ageThe communication ageis based on objectsis based on objects

Object-C

Object-B

Message (operation)triggers method

causes response

Message (operation)triggers method

causes response

Object-A

IN OUT-C

Methods Variables

IN

Methods Variables

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction: The connected enterprise

• The powerful communication paradigm¤ The new paradigm¤ An Applet built with Java Beans¤ Remote Method Invocation (RMI)

• Divide and conquer.Separation of concern with role models,responsibilities, and interfaces

• The Lego idea.Constructing software with components

• Summary.How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

App. for booking meeting roomsApp. for booking meeting rooms A demo of our illustrative exampleA demo of our illustrative example

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

WEBBrowser

BookingApplet(end user tool)

The Objects and InterfacesThe Objects and Interfacesof the simple Applet solutionof the simple Applet solution

RoomChooser

Java Beans

Booking(business logic)

Applete.g., init(); paint(Graphics);

AppletContext e.g., getImage(URL)

RoomBooker e.g., getRooms(); reserve(...);

ActionListener e.g., actionPerformed(ActionEvent)

JComboBox e.g., addItem(...); getSelectedItem();

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

public interface RoomBroker {public void reserve

( );

public void release(

);

public Vector getReservations( );

public Vector getRooms();}

RoomBookerRoomBookerinterfaceinterface

package EJBWorkshop.Booking;

import javax.ejb.*;import java.util.*;

public interface RoomBroker {public void reserve

(String room, String username, Date date, short startIntervalNo, short length);

public void release(String room, String username, Date date

, short startIntervalNo, short length);

public Vector getReservations(Date theDate, String room);

public Vector getRooms();}

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

WEBBrowser

BookingApplet(end user tool)

RoomChooser

Java Beans

Booking(business logic)

The Communication ParadigmThe Communication Paradigmwith objectswith objects

The object+ has responsibility+ knows its collaborators+ is robustNobody knows everything!

The object+ has responsibility+ knows its collaborators+ is robustNobody knows everything!

ObjectsReferencesInterfacesare visible!

ObjectsReferencesInterfacesare visible!

Codeis

invisible!

Codeis

invisible!

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction: The connected enterprise

• The powerful communication paradigm¤ The new paradigm¤ An Applet built with Java Beans¤ Remote Method Invocation (RMI)

• Divide and conquer.Separation of concern with role models,responsibilities, and interfaces

• The Lego idea.Constructing software with components

• Summary.How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

WEBBrowser

BookingApplet(end user tool)

Java RMIJava RMIRemote Method InvocationRemote Method Invocation

RoomChooser

Java Beans

Booking(business logic)

Info

rmat

ion

Bu

s

ServerClient

• Move from centralized to distributed control

• Move from closed to open systems

• Catch new exceptions

• Move from centralized to distributed control

• Move from closed to open systems

• Catch new exceptions

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

public interface RoomBooker extends Remote {

public void reserve(

) throws RemoteException;

public void release(

)throws RemoteException;

public Vector getReservations( )

throws RemoteException;

public Vector getRooms(throws RemoteException;

}

package EJBWorkshop.Booking;

import javax.ejb.*;import java.rmi.*;import java.util.*;

public interface RoomBooker extends Remote {

public void reserve(String room, String username, Date date

, short startIntervalNo, short length) throws RemoteException;

public void release(String room, String username, Date date

, short startIntervalNo, short length)throws RemoteException;

public Vector getReservations(Date theDate, String room )

throws RemoteException;

public Vector getRooms(throws RemoteException;

}

RoomBookerRoomBookerinterfaceinterface

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Booking serv = new BookingServer();Naming.rebind(”BookingServer", serv);

Critical Code FragmentsCritical Code FragmentsServer SideServer Side

public class BookingServerextends UnicastRemoteObjectimplements RoomBooker{

public static void main (String args[])throws RemoteException {

System.setSecurityManager(new RMISecurityManager());try {

Booking serv = new BookingServer();Naming.rebind(”BookingServer", serv);

} catch (Exception e) {System.out.println("Server error: " + e.getMessage());e.printStackTrace();

}System.out.println("Server started.");

}

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

serv = Naming.lookup( "//” + this.getCodeBase().getHost() + "/BookingServer” );

private RoomBooker server() {if (serv == null) {

try { serv = (RoomBooker) Naming.lookup( "//” + this.getCodeBase().getHost() + "/BookingServer” );

} catch (Exception e) {System.out.println(”Get_Server_err: " + e.getMessage());e.printStackTrace();return;}

}return serv;

}

Critical Code FragmentsCritical Code FragmentsClient SideClient Side

public class BookingApplet extends JApplet {private RoomBooker serv;…

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Info

rmat

ion

Bu

s

RMI middlewareRMI middleware(1 second can grow to 3 hours!!)(1 second can grow to 3 hours!!)

TheBooking

object

TheBookingApplet

object

Java RMI Services (or CORBA or COM)TCP/IP - Guaranteed end-to-end data streamPhysical communication (ISDN/Ethernet/….)

Client Server

Booking Stub

(a proxy)

BookingSkeleton(a proxy)

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

What we have learnedWhat we have learned

• Shared server containing business logic and information

• Middleware takes care of communication details

• User interface adapted to task

Many-to-many relationshipbetween clients and servers

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan

• Introduction• The powerful communication paradigm

• Separation of concern with role models, responsibilities, and interfaces

• Constructing software with components• Conclusion.

How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan

• Introduction• The powerful communication paradigm

• Separation of concern with role models, responsibilities, and interfaces– Role-modeling– Synthesis

• Constructing software with components• Conclusion.

How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

OOram Method overviewOOram Method overview

Technology

Processes and Deliverables

Reuse

Concepts/ Notation / techniques

Organizing

ValuechainPeople

Reuse

Concepts/ Notation / techniques

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Object-oriented systemObject-oriented system

A system that consists of several objects who knows other objects, and “talks” to each other through message passing. Such a system could be the Internet, organisations, and programs.

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

The Object Model AbstractionThe Object Model Abstraction

aRealWorldPhenomena

Mental model

System

Manifest Model

Objects• A model is created for a purpose• A model is never complete• We think in multiple models• The world is rarely hierarchical

• A model is created for a purpose• A model is never complete• We think in multiple models• The world is rarely hierarchical

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

- Dijkstra, A discipline of programming, 1976last chapter, In retrospect

“To my taste the main characteristic of intelligent thinking is that one is willing and able to study in depth an aspect of one's subject matter in isolation, for the sake of its own consistency, all the time knowing that one is occupying oneself with only one of the aspects. ...

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

- Dijkstra, A discipline of programming, 1976last chapter, In retrospect

… Such separation, even if not perfectly possible, is yet the only available technique for effective ordering of one's thoughts that I know of. ...

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

- Dijkstra, A discipline of programming, 1976last chapter, In retrospect

… I usually refer to it as ‘separation of concerns’, because one tries to deal with the difficulties, the obligations, the desires, and the constraints one by one. ...

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Roles - ObjectsRoles - Objects

• Role is what an object does in a context of other objects

• Instead of trying to describe everything an object can do, we start with the roles an object can play

• At a later stage we merge these roles together into full-fledged objects

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Divide and conquerDivide and conquer

Goal

Separation of concern

Collaborations(Role models)

Implementation model

Synthesis

Use Cases

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Role modelsRole models

• Models a structure of collaborating objects with static and dynamic properties.

• Covers a particular area of concern for the structure of objects.

• Each role has a responsibility (attributes and actions) in the structure of objects.

aRealWorldGoal RoleModels anImplementedSystemanObjectModel

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

OOram Analysis stepsOOram Analysis steps

• Determine the area of concern

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Determine the area of concernDetermine the area of concern

The area of concern is the communication between the Person in need of a meeting room and the RoomBooker in our organization.

We focus on the actual bookings, and do not model details about other aspects, such as meeting agenda, transactions, updating etc.

Write a free form (prose) description of the issue under consideration

Write a free form (prose) description of the issue under consideration

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

• Determine the area of concern• Understand the problem and

identify the nature of the objects

OOram Analysis stepsOOram Analysis steps

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Understand the problem and Understand the problem and identify the nature of the objectsidentify the nature of the objects

Adam(Chief Accountant)

Beth(Technical author)

Joyce(Secretary)

Ruth(Programmer)

Eve(Software manager)

Joyce(Sales)

Ann(Secretary)

Pete(Marketing manager)

Ruth(President)

Identify the user community and understand their requirements. Identify the nature of the active participants.

Identify the user community and understand their requirements. Identify the nature of the active participants.

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

• Determine the area of concern• Understand the problem and

identify the nature of the objects• Determine environment roles

and stimulus / response

OOram Analysis stepsOOram Analysis steps

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Determine environment roles Determine environment roles and stimulus/responseand stimulus/response

Stimulus message Response message Comments

Project Review Meeting room reserved The Project Manager is having a meeting and the Booker reserves the room

Stimulus message Response message Comments

Project Review Meeting room reserved The Project Manager is having a meeting and the Booker reserves the room

Describe the messages that are sent from the environment.Also describe the response; The overall effect of the system.

Describe the messages that are sent from the environment.Also describe the response; The overall effect of the system.

SystemStimuli Response

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

• Determine the area of concern• Understand the problem and

identify the nature of the objects• Determine environment roles

and stimulus / response• Identify and understand the

roles

OOram Analysis stepsOOram Analysis steps

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Identify and understand the rolesIdentify and understand the roles

Role Explanation

Project Reviewer The person who is supervising a project

Project Manager The person who is setting up a meeting

Adam(Chief Accountant)

Beth(Technical author)

Joyce(Secretary)

Ruth(Programmer)

Eve(Software manager)

Joyce(Sales)

Ann(Secretary)

Pete(Marketing manager)

Ruth(President)

1

3

2

Separate and idealize the tasks and responsibility of the actors.

Separate and idealize the tasks and responsibility of the actors.

Booker The person who books a meeting room

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

• Determine the area of concern• Understand the problem and

identify the nature of the objects• Determine environment roles and

stimulus / response• Identify and understand the roles

• Determine the message sequences

OOram Analysis stepsOOram Analysis steps

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Determine the message Determine the message sequencessequences

For the stimuli and responses create a model showing the message sequences and/or tasks performed , and the corresponding work process.

For the stimuli and responses create a model showing the message sequences and/or tasks performed , and the corresponding work process.

RoomDate

setUpMeeting

checkaAvailability

checkaAvailability

ProjectManager

Project reviewer Booker Tool

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

ProjectManager Booker

Tool

Project review Project

meeting

setUpMeeting<Determine OK> Room

Request

checkaAvailability RoomDate

Determine the message Determine the message sequencessequences

For the stimuli and responses create a model showing the message sequences and/or tasks performed , and the corresponding work process.

For the stimuli and responses create a model showing the message sequences and/or tasks performed , and the corresponding work process.

Project reviewer

reserveRoom

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

• Determine the area of concern

• Understand the problem and identify the nature of the objects

• Determine environment roles and stimulus / response

• Identify and understand the roles

• Determine the message sequences

• Determine the collaboration structure

OOram Analysis stepsOOram Analysis steps

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Determine the collaboration Determine the collaboration structurestructure

ProjectManager

Booker

Tool

Show the roles in a structure of collaborating objects.Show the roles in a structure of collaborating objects.

Project reviewer

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

• Determine the area of concern• Understand the problem and

identify the nature of the objects• Determine environment roles and

stimulus / response• Identify and understand the roles• Determine the message

sequences• Determine the collaboration

structure• Determine the interfaces

OOram Analysis stepsOOram Analysis steps

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Determine the interfacesDetermine the interfaces

Determine the messages that each role may send to eachof its collaborators.

Determine the messages that each role may send to eachof its collaborators.

Project reviewer > Project ManagersetUpMeeting

Project Manager > BookercheckaAvailability

Booker > ToolcheckaAvailability

ProjectManager

Booker

Tool

Project reviewer

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

DEMODEMODEMODEMO

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan

• Introduction• The powerful communication paradigm• Separation of concern with role models, responsibilities,

and interfaces– Role-modeling

– Synthesis• Constructing software with components• Conclusion.

How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

SynthesisSynthesis

• Describe other phenomena the objects is to be found, and then merge them together into complete descriptions

• One or more of the earlier discovered objects will also be found in other relevant phenomena

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Objects play several rolesObjects play several roles

ProjectManager ProjectParticipant

ProjectParticipantProjectManager

Lasse

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Synthesis of rolesSynthesis of roles

message m1method M1

a1

message m2

message m3method M3

a2

message m4

message m1method M1

a1a2

message m2message m3

message m4

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Synthesis of UserBooking and Synthesis of UserBooking and DistributedBookingDistributedBooking

EnterpriseBooking

ComputerBooking

CompositeBooking

Projectreviewer

ProjectManager

Booker Tool

BookingTool RoomBooker

RoomBookerBookingToolBookerProjectManager

Projectreviewer

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

DEMODEMODEMODEMO

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction: The connected enterprise

• The powerful communication paradigm

• Divide and conquer.Separation of concern with role models,responsibilities, and interfaces

• The Lego idea.Constructing software with components

• Summary:How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction• The powerful communication paradigm• Separation of concern with role models,

responsibilities, and interfaces

• The Lego idea.Constructing software with components

¤ The component - a powerful application of objects

¤ Java Beans¤ Enterprise Java Beans (EJBs)¤ Organizing development with components

• Summary. How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

What is a Component?What is a Component?

• A Component is a (reusable) objectA Component is a (reusable) object

• A Component is an object playingA Component is an object playingstandardized roles within a containerstandardized roles within a container

• A component does not know its A component does not know its clientsclients

• A component is reused by cloningA component is reused by cloning

• Tools are used to compose systemsTools are used to compose systems

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Why use componentsWhy use components

Use components toUse components to• Avoid coding Avoid coding

to save timeto save time• Avoid coding Avoid coding

to increase qualityto increase quality• Use tools Use tools

to increase your productivityto increase your productivity• Get remote communication, Get remote communication,

transactions, security, etc. transactions, security, etc. for freefor free

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

The competing technologiesThe competing technologies

CORBACORBA™™ Object Management Group (OMG)Object Management Group (OMG)Public standardsPublic standards

JavaJava™™ SUN MicrosystemsSUN MicrosystemsBuild once, run anywhereBuild once, run anywhere

COMCOM™™ MicrosoftMicrosoftDominating on desktopsDominating on desktops

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Component standardizationComponent standardizationexamplesexamples

Java BeanJava Bean

• User InterfaceUser Interface

• PropertiesProperties

• EventsEvents

• CompositionComposition

Java BeanJava Bean

• User InterfaceUser Interface

• PropertiesProperties

• EventsEvents

• CompositionComposition

Enterprise Java BeanEnterprise Java Bean

• NamingNaming

• PersistencePersistence

• TransactionsTransactions

• SecuritySecurity

• Load sharingLoad sharing

ServerServerServerServerClientClientClientClient

Info

rmat

ion

Bu

s

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction• The powerful communication paradigm• Separation of concern with role models,

responsibilities, and interfaces

• The Lego idea.Constructing software with components

¤ The component - a powerful application of objects

¤ Java Beans¤ Enterprise Java Beans (EJBs)¤ Organizing development with components

• Summary. How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Java Beans characteristicsJava Beans characteristics

aJavaBean

aJavaBean

Properties

Introspection

Events

Messages

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

GUI by compositionGUI by compositionJava Beans and SUN BeanBox Java Beans and SUN BeanBox ®®

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Compose GUI Compose GUI with Java Beanswith Java Beansand Symantech Visual Café and Symantech Visual Café ®®

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Compose GUI Compose GUI with Java Beanswith Java Beansand IBM VisualAgeand IBM VisualAge®®

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

BookingApplet

Run-timedisplayUse Case

Bean object playsBean object playsseveral rolesseveral roles

Bean Object

ComposerUse Case

BeanBox

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Two stagesTwo stagesin the Bean Life Cyclein the Bean Life Cycle

RuntimeCollaboration

RuntimeCollaboration

ReleaseButton

Booking

RoomChooser

BookingApplet

Calendar

ReserveButton

MasterBean

BeanPalette

AssemblerTool

PropertyEditor

CanvasBean Assembler

Collaboration(Sketch)

AssemblerCollaboration

(Sketch)

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction• The powerful communication paradigm• Separation of concern with role models,

responsibilities, and interfaces

• The Lego idea.Constructing software with components¤ The component

- a powerful application of objects

¤ Java Beans

¤Enterprise Java Beans (EJBs)¤ Organizing development with components

• Summary. How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Client

Enterprise Java Bean (EJB)Enterprise Java Bean (EJB)OverviewOverview

Container

EJB Server

Container:MultithreadingTransactionsSecurityPersistence

EJB:SimpleSingle user

EJB

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Info

rmat

ion

Bu

s

WEBBrowser

Applet(End user tool)

The Bean andThe Bean andEEnterprisenterprise J Javaava B Beanean objects objects

NameServer

BookingBean

BookingObject

4: getRooms();

2: create(xxx);

1: lo

okup

("ro

ombr

oker

");

5: getRooms();

RoomChooser

Java Beans

6: a

ddItem

(ele

men

t)

3: ejbCreate(xxx);

BookingHome Factory object

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Info

rmat

ion

Bu

s

WEBBrowser

Applet(End user tool)

The Bean andThe Bean andEEnterprisenterprise J Javaava B Beanean objects objects

BookingBean

NameServer

BookingObject

RoomChooser

Java Beans

BookingHome

DataStore

Could be Entity Bean

Powerful toolsClear abstractions

Session Bean

Factory object

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

public interface Booking extends EJBObject {

}

package EJBWorkshop.Booking;

import javax.ejb.*;import java.rmi.*;import java.util.*;

public interface Booking extends EJBObject {public void reserve

(String room, String username, Date date, short startIntervalNo, short length)

throws RemoteException;

public void release(String room, String username, Date date

, short startIntervalNo, short length)throws RemoteException;

public Vector getReservations(Date theDate, String room )

throws RemoteException;

public Vector getRooms(throws RemoteException;

}

RoomBookerRoomBooker(business) (business) interfaceinterface

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

public interface BookingHome extends EJBHome {

Booking create()

}

package EJBWorkshop.Booking;

import javax.ejb.*;

import java.rmi.*;

public interface BookingHome extends EJBHome {

Booking create()throws CreateException, RemoteException;

}

RoomBookerHomeRoomBookerHome(factory) (factory) interfaceinterface

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

public class RoomBookerBean implements SessionBean {

ejbCreate() throws CreateException, RemoteException {

}

}

// RoomBooker interface operations reserve {… } etc.

}

RoomBookerBeanRoomBookerBeanclassclass

public class RoomBookerBean implements SessionBean {protected SessionContext ctx;

// Container managed beans public void setSessionContext(SessionContext ctx)

throws RemoteException {this.ctx = ctx;}

public void ejbCreate() throws CreateException, RemoteException {

}

public void ejbRemove()throws RemoteException {

}

// RoomBooker interface operationspublic void reserve {… } etc.

}

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

ExerciseExercise

Identify useful and interesting business components

and

discuss their mutual dependencies

Assuming that it is straight forward to program, install and assemble business components:

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction• The powerful communication paradigm• Separation of concern with role models,

responsibilities, and interfaces

• The Lego idea.Constructing software with components¤ The component

- a powerful application of objects ¤ Java Beans¤ Enterprise Java Beans (EJBs)

¤Organizing development with components

• Conclusion. How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

OOram Method overviewOOram Method overviewOrganizingOrganizing

Technology

Processes and Deliverables

Reuse

Concepts/ Notation / techniques

Organizing

Value chainPeople

Value chainPeople

Organizing

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Component Value ChainComponent Value ChainDistinguishing ResponsibilityDistinguishing Responsibility

Application Assembler Empower user

Component Deployer Limit choice & make available

Component Container Provider Provide tools and service environment

Component Provider Create capability

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Component Value ChainComponent Value ChainDistinguishing CompetenceDistinguishing Competence

Application Assembler User expert

Component Deployer Production Engineer

Component Provider Domain expert

Component Container Provider Systems programmer

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Component Value ChainComponent Value ChainDistinguishing ToolsDistinguishing ToolsApplication Assembler

Visual programming & Java

Component Deployer Component installation tool

Component ProviderUML Collaboration & Java & DB Design

Component Container ProviderFull UML & Java & C++

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

OOram Method overviewOOram Method overview Processes and DeliverablesProcesses and Deliverables

Technology

Processes and Deliverables

Reuse

Concepts/ Notation / techniques

Organizing

Value chainPeople

Processes and Deliverables

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

How to provide new functionality How to provide new functionality

ConsiderUse Cases

Consider businessComponents

Cost/Benefitanalysis

Architecture(OOram analysis)

Assemble

DevelopBusiness

Components

DevelopGUI

Components

Repeat Studies.

Choosebest solutionStudy

Construct

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Tutorial planTutorial plan• Introduction: The connected enterprise

• The powerful communication paradigm

• Divide and conquer.Separation of concern with role models,responsibilities, and interfaces

• The Lego idea.Constructing software with components

• Summary.How do we get from here to there?

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Distributed SystemsDistributed Systems What you getWhat you get

•Unlimited scaling

•Distributed ownership

•Information partitioning

•Specific task support

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Distributed SystemsDistributed Systems How you do itHow you do it

• Think in terms of objects, their responsibilities and collaboration.

• Think in terms of open systems, no main program.

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Component-based developmentComponent-based development What you getWhat you get

• Build by composing library objects,avoid coding.

• Leverage infrastructure mechanisms(transactions, security, persistence,…)

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Component-based developmentComponent-based development How you do itHow you do it

• Think in terms of objects, their responsibilities and collaboration.

• Penetrate vendor fog - find essentials(Objects and interfaces)

• Adapt to new layers in value chain

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

The main problemsThe main problems

We spend too much time and efforton low-level mechanics.

Current offerings are NOT:• Easy and intuitive to use• Smooth development platforms• Reliable• Secure• Extensible

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

How do we get from here to there?How do we get from here to there?

• Learn technologyJava + CORBA + Web + ...

• Do small, but significant projectIllustrating visions

• Plan large scale introductionWhat are the information

services?What are the Areas of Concern?

• Focus on objectsClasses are implementation

details

TOOLS '99 ©1999 Trygve Reenskaug, Lasse Bjerde

Distributed systemsDistributed systems

Go home andGo home anddo it!do it!

http://www.ifi.uio.no/~trygve