tiny components – a collection of initial ideas copyright © 2003 tiny components tiny components...

19
Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Upload: nancy-tyler

Post on 28-Dec-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Tiny Components

A Component Model for Small, Embedded or Mobile devices

Page 2: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

What is a component architecture

Most important principle: Separation of Concerns

Functional concerns of an application are factored into reusable Components

Technical concerns are provided by a standardized entity, a so-called Container

Components are accessed only through a Component Interface

Functionality of a Component is well defined, thus reusable.

C lient

...

C onta iner

Com

pone

nt 1

Com

pone

nt 2

Com

pone

nt 3

Page 3: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Client Application

Client Program

A PPLICATION S ERVER

SE S S IO N

C O M P O N E N T 1

CO N T A IN E RINSTANCE P OOLING

CO N T A IN E R

A S S E M B LY P A C K A G E

CO M P O N E N T P A C K A G E

CO M P O N E N T

IM P LE M E N T A

-T IO N

CO M P O N E N T

IN T E R FA C E

supportfile

supportfile

supportfile

supportfile

supportfile

CO M P O N E N T P A C K A G E

CO M P O N E N T

IM P LE M E N T A

-T IO N

A N N O T A -T IO N S

CO M P O N E N T

IN T E R FA C E

supportfile

supportfile

supportfile

supportfile

supportfile

A N N O T A -T IO N S

C O M M O N

C O N FIG -U R A T IO N

CO M P O N E N T P A C K A G E

CO M P O N E N T

IM P LE M E N T A

-T IO N

A N N O T A -T IO N S

CO M P O N E N T

IN T E R FA C E

supportfile

supportfile

supportfile

supportfile

supportfile

C O N T A IN E R

Security Manager

CLIE N T

L IB R A R Y

C OMPONENT B US

CO M P O N E N T

C O M P O N E N T

IM P LE M E N T A T IO N

Business Operations

L IFE C Y C LE CA LLB A C K

Operations

CO M P O N E N T HO M E

Operations

CO

MP

ON

EN

T

INT

ER

FA

CE

S ERVICE

C OMPONENT

S ERVICE

C OMPONENT

S ERVICE

C OMPONENT

S ERVICE

C OMPONENT 1

S ERVICE

C OMPONENT

S ERVICE

C OMPONENT

S ERVICE

C OMPONENT

S ERVICE

C OMPONENT 2 Legacy App

E N T IT Y

CO M P O N E N T 1{ID=0815}

E N T IT Y

CO M P O N E N T 1{ID=4711}

Database

S E S S IO N

CO M P O N E N T 1

S E S S IO N

CO M P O N E N T 1

S E S S IO N

CO M P O N E N T 1

operation nam e andparam eters

IN V O C A T IO N CO N T E X T

transaction contextsecurity context

P R IM A R Y

KE Y

P R IM A R Y

KE Y

G LU E C O D E LA Y E R

C O M P O N E N T

P R O X Y

CO M P O N E N T

CO N T E X T

Transaction Manager

CO M P O N E N T

IN S T A LLA T IO N

operations &param eters

hom e operations

com ponent nam e

CO M P O N E N T

IN T R O S P E C T IO N

V IR T U A L IN S T A N C E

PASSIVATION

E NTITY

C OMPONENT

E NTITY

C OMPONENT

E NTITY

C OMPONENT

C OMPONENT

H OME

SE S S IO N

CO M P O N E N T 1

SE S S IO N

CO M P O N E N T 1

Com plex

Subsystem

M A N A G E D RE S O U R C E S

ResourceResource

ResourceResource

N AMING

com m ycom pany com ponen ts C om ponen tA C om ponen tB resou rces R esourceX R esourceY

CO N FIG U R A T IO N

P A R A M E T E R S

nam e1 - value1nam e2 - value2

...nam en - valuen

ResourceAdapter

P LU G G A B LE

RE S O U R C E S

RE

QU

IRE

D I

NT

ER

FA

CE

S

Client Application

HA N D LE

!

!S Y S T E M

E R R O R S

What is a component architecture (II)

Take

n f

rom

Voelt

er,

Sch

mid

, W

olff

, S

erv

er

Com

pon

en

t P

att

ern

s, W

iley 2

00

2

Page 4: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

So, then, what is a Component?

Additional properties of the kinds of Components we are interested in:

a component is coarse grained

principle of separation of concerns is employed

components can be accessed remotely

“A software component is a unit of composition with contractually specified interfaces and explicit context

dependencies only. A software component can be deployed independently and is subject to composition by

third parties.”

Definition by Szyperski

Page 5: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Components in the enterprise environment

There are several popular component architectures in the enterprise environment:

Enterprise Java Beans (EJB), a Java-only component model that is part of the Java 2 Enterprise Editition

CORBA Components (CCM), a component-extension to OMG's object request broker technology,

Micorsoft's COM+, a widely-used component architecture limited to Windows operating systems.

Many other component architectures that have been designed specifically for a specific system

Page 6: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Why are they successful in enterprise apps

A Typical application structure: database contains business dataprocesses that manipulate this datausually in the context of transactions.

It is relatively easy to separate the functional from the technical concerns, and they can be implemented generically.

Standards and commercially available containers

People and their skills suit the sep. of concerns well

Standardized Programming Model

Page 7: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Target Platform: Small Systems

We consider the following kinds of devices to be „small systems“:

Mobile Phones

PDAs, Organizers

Embedded computers, such as controllers or ECUs in vehicles orairplanes

Page 8: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Characteristics of small devices

Non-homgeneity, almost every device is different

Limited memory, only some hundred kB or some MB are available

Limited computing power because the device often contain only small processors

Limited electrical power because the device might be battery powered

Timing requirements can be more stringent:No real timeSoft real timeHard real time (out of scope!)

Network connection can either be permanent or intermittent

Page 9: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Typical software architecture for small devices

An OS Abstraction Layer hides some of the details of the underlying (realtime) operating system.

A more sophisticated approach,especially for product families, isthe use of a framework – provides reuse for repeating aspects.

O perating System

OS Abstraction Layer

Application

O perating System

O S Abstraction Layer

Fram ew ork

Application

Page 10: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Software architecture with components

Using a component container is basically a framework thatuses separation of concernsand optionally generative techniques.

Reuse is simplified by only accessing components through their interfaces.

OS Abstraction Layer + Framework + Separation of Concerns + Reuse = Component Architecture

O perating System

O S Abstraction Layer

Container

Com-ponent

Com-ponent

Com-ponent

Page 11: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Software architecture with components II

In a last step, the container and the OS Abstraction Layer, as well as the operating system can be integrated to improve performance and reduce footprint even more.

Container

+ OSAbstraction Layer+ Operating System

Com-ponent

Com-ponent

Com-ponent

Page 12: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Main characteristics of a component model for small devices

Platform independent. The component architecture and ideally, the programming language should be available on several systems

Simple: An API should be as simple as possible, much simpler that EJB or CCM

Modular: not all containers need to provide all possible features. Necessary to run the system on limited devices.

Reflective: Components must know what their requirements are regarding the container and the containers must know what they provide.

Network-aware: Different network transport protocols must be pluggable without changing the component implementations (CORBA, Sockets, RMI, ...)

Page 13: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Container Features (Technical Concerns)

Scheduling

Interrupt Handling

Storage Service

Simple Event service

Generic driver interface

Pluggable transport

Security

Store and forward

Paging

...

Page 14: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Related Technologies Jini is a platform for spontaneous networking

Ninja is a project by the University of Berkeley that defines an architecture for intelligent network-centric services.

OSGi is a platform to manage services on small devices. Maybe it could be used as a basis.

WebServices defines an XML over HTTP based RPC mechanisms for use in the internet.

Apache SF project to build a framework for server apps

MQ everyplace is a version of the MQSeries messaging middleware that is available for small devices.

Java could be useful as a platform independent programming language.

TAO is a well-known and modular ORB that might be useful as a communication backend.

Page 15: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Related Technologies: OSGi

OSGi, the Open Services Gateway Initiative:

OSGi allows the deployment of services to a „host“ andTracks dependencies and versionsManages installation and deinstallationsManages dependencies to external resources

The Open Services Gateway Initiative (OSGi), established in 1999, is an independent, non-profit corporation working to define and promote open specifications for the delivery of managed broadband services to networks in homes, cars and other environments. OSGi also works to proliferate these open specifications through the sponsorship of technology, market, and user education programs.

Page 16: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Related Technologies: OSGi

OSGi comes with a set of additional services,

Package Admin Service: Status information of packages and bundles, minimal update

Permission Admin Service: permission management for bundles before, during or after installation

LogService: handling of log messages

HttpService: simple framework for http servers

Device Access Spec: Generice devices driver model

Page 17: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Related Technologies: OSGi

OSGi provides a set of useful services, but

It provides no separation of concerns

Does not address any of the issues we mentioned before (scheduling, interrupts, events, ...)

So, it could serve as a basis for the Small Component Architecture, but it is not extensive enough.

OSGi is a standard, implementations areSun‘s Java Embedded Server (JES)IBM‘s Service Management Framework (SMF)IBM‘s Websphere Everyplace suite

Page 18: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

Architectural/Implementation considerations

A real big, generic, monolithic application server is certainly useless in small devices.

Generative Programming techniques, especially code generation can help to reduce the footprint.

Aspect Orientation can provide a useful means to decompose the system.

Page 19: Tiny Components – a collection of initial ideas copyright © 2003 Tiny Components Tiny Components A Component Model for Small, Embedded or Mobile devices

Tiny Components – a collection of initial ideas copyright © 2003

Tiny Components

It‘s time to start NOW!

The patterns community is exploring the embedded applications domain (see DRE Patterns Workshop at OOPSLA)

there are CORBA implementations for embedded devices (TAO, Orbacus/E)

systems are extending into the embedded domain (minimumCORBA, RealtimeJava)

and generative programming can help to get things small and efficient