component based software development with java andrew k lui school of science and technology open...

35
Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Upload: joleen-hampton

Post on 23-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Component Based Software Development with Java

Andrew K LuiSchool of Science and Technology

Open University of Hong Kong

Page 2: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

2

A Strange World

OS Mouse

Page 3: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

3

Crisis in Software Industry

Cost Flexibility Quality Time

Page 4: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

4

A Perennial Problem?

Software engineering

- formal methods, verification, testing, programming language

- reuse, frameworks and libraries

Page 5: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

5

Component Based Software

- old wine in new bottle.

- breaking a system into reusable modules, components, sub-systems…

- facilitating system integration, reuse of design, testing and product evolution.

Page 6: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

6

BenefitsC FQ T

A Software System

Pre-fabricatedComponents

Page 7: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

7

In the Real World

The software industry has readily embraced CBSD.

Flashline (www.flashline.com) Javabeans/COM/ActiveX

Vbxtras (www.vbxtras.com) Visual Basic

Component Source (www.componentsource.com) Java/COM/C++/Delphi/VisualStudio

$

Page 8: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

8

The Industry Says …

“… companies can spend $1000 on a software component instead of $100000 on development resources.”

Sam Patterson (CEO ComponentSource)

“… These less skilled developers can ‘assemble’ components that were built by higher skilled developers … It is a solution to the skills shortage.”

Tom Dwyer (Research Directory EJB Aberdeen G)

Page 9: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

9

The Academic Says …

“ Working programmers are well aware of this last revolution … Academic researchers are doing little or nothing … The revolution has already happened, and in the academic community, nobody came.”

Peter Maurer (USF) 2000 in IEEE Computer

Page 10: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

10

What contributed to the Buzz?

According to Meyer and Mingins (IEEE Computer 1999)The current excitement about CBSD results from …

Scientific Industrial

Political OO Technology

Monolithic Systems (Stovepipes)

Page 11: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

11

Clashes of Views

IndustryComponent Providers

Political BodiesStandard/Technology

Custodians

Main ConcernInterconnecting technology for components.

ComponentAn abstract business process.

OutputArchitectures, frameworks, standards, reference implementations

Main ConcernCreation and sale of components of various base technologies

ComponentAn unit of reuse for a business domain

OutputIdentifying specific business process -> components.

Page 12: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

12

Component Definitions

So what is a component after all?

“ 1. A unit of independent deployment; 2. A unit of third party composition; 3. Has no persistent state.”

C Szyperski

Component is the next thing afterobjects...

Page 13: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

13

Component Definitions

“ … prepackaged generic elements”B. Meyer & C. Mingins

It is absurd … (that) CBD is the next thingbeyond object.

OO … provides the only serious technical basis ...

Page 14: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

14

A Holistic View of CBSD

ComponentLanguagePlatformInterface

GranularityDomain Component

Application Integration Environment

Composition/Integration ToolsComponent RepositoryComponent Contract/Metadata

Runtime Environment

Interconnecting TechnologyResource Management

Page 15: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

15

Component Environment

A component is tightly coupled to its native environment.

Component Environment

Page 16: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

16

Application Integration Environment

CBSD Process

Runtime Environment

Component

Component

interface, contract, instantiation

Component Component

Page 17: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

17

May I Join the Club?

• Yes, and there is no application fees.• Consider whether CBSD can benefit

your work/project.• Paying a higher upfront cost for

higher reusability and extensibility.

Page 18: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

18

Java as a CBSD Environment

JavaBean - Toolable components.

RMI/CORBA - Distributed components.

Jini/Serialization - Mobile components.

Messaging Middleware - Loosely-coupled

components.

Page 19: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

19

JavaBeans

- Introspection distinguishes JavaBeans from ordinary Java classes.

Who are you?

What can I do to you?

What would you do if I …?

What can I change on you?

Bean

Page 20: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

20

Toolable JavaBeans

Container

Bean Bean Bean

eventsproperties

java.lang.reflect

java.beansjava.awt.events

Page 21: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

21

Connecting JavaBeans

Bean Bean

Javabeans are connected by hookingproperties and event handling.

Bean

emitting an event

setting properties

Page 22: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

22

Example - Image library client

QueryInput SubmitBean

QueryBean

QuerySpecification

Textbox Button

SubmitEvent

QueryInput 2QuerySpecification

ImageLibrary

Page 23: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

23

Visual Appearance

submit

queryinput

Page 24: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

24

JavaBean Tools

•Inprise (Borland) Jbuilder

•IBM VisualAge

•Symantec Visual Cafe

Page 25: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

25

JavaBean Component Model• Visual oriented.• Stateful.• Introspectual.• Event driven.• Design Pattern Defined.

• Method naming.• Event naming.• BeanInfo class.

Page 26: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

26

Distributed Components

•JavaBean integration technique is local.

•Java supports distributed computing in RMI/CORBA

•How to extend JavaBean model to work with distributed computing.

Page 27: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

27

Distributed Image Library

ImageLibrary

ImageLibrary

ImageLibrary

Trader ClientClient Client

CORBA Services

Page 28: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

28

TraderBean

QueryBean

JavaBeans as Stubs

ImageLibrary

Stub

TraderStub

Client-side Server-side

Page 29: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

29

Rapid Application Dev (DSTO)

Page 30: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

30

QueryBean

Jini

Stubs themselves can be downloadedfrom services - encapsulating the protocol.

ImageLibrary

Stub

Page 31: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

31

Server Components?Enterprise JavaBeans (EJB)

Container

EJB Server

Home

ObjectEJBClient Database

Distributed transaction management, concurrency management, middleware support, ...

Page 32: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

32

Other CSBD Environments

•JavaBean connection is tightly coupled -one bean knows other beans.

•Distributed bean component has already made bean location independent.

•Use of messaging middleware can even encapsulate the existence of other beans.

Page 33: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

33

CSBD with messaging middleware

MessagingMiddleware

withChannels

Bean

Bean Bean

• provides and obtains information from relevant channels.

• does not care where the information comes from.

• connects to distributed services using other middleware.

XML

XML

XML

Page 34: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

34

Summary

•Very popular in industry but only at a beginning stage in academic.

• Lots of experience gained, but with thin theoretical support.

• Java is a good platform for CBSD.

Page 35: Component Based Software Development with Java Andrew K Lui School of Science and Technology Open University of Hong Kong

Andrew K Lui (Open University of Hong Kong)

35

The Future

• Loosely-coupled component model.

• Component Contracts.

• Microsoft Dot Net