Components in Java

publicité
Components in Java
Sebastian Pavel
OBASCO Project – EMN/INRIA
Plan
ArchJava
Dynamic Configuration in ArchJava
Asynchronous Communication Experiments
Symbolic Transition Systems for Components
DISPO 23 Septembre 2004
2
ArchJava
Specifies architecture within Java code
Small extension to express hierarchical components and
connections
Verify control flow preserving communication
integrity consistency property
Code and architecture evolve together
Supports dynamically changing architectures
Allows common implementation techniques
DISPO 23 Septembre 2004
3
Dynamic Configuration
Context SPL (Software Product Lines)
Families of Software Products
Communication Integrity
+
+
+
-
Good architectural property
No hidden communication channel
Implementation conforms to architecture
No component classes in ports
Black-box components
DISPO 23 Septembre 2004
4
Communication integrity
restrictions
Account
Payment
glue
payment
payment
Configuration-related logic inside composite component
Difficult to build and evolve
DISPO 23 Septembre 2004
5
Configuration Pattern
Configuration knowledge out of composite components
BankApplication
internal port
AccountConfigurator
connect
Account
connect
glue
Payment
payment
payment
payment
AccountConfigurator = dynamic generator + placeholder
DISPO 23 Septembre 2004
6
Plan
ArchJava
Dynamic Configuration in ArchJava
Asynchronous Communication Experiments
Symbolic Transition Systems for Components
DISPO 23 Septembre 2004
7
Ticket reservation system
Application
Client
Client
Company
connect
connect
con
nec
t
Counter
Client
ect
n
n
co
connect
Bank
port interface
Implementation Solutions:
buffer inside receiver
connectors
DISPO 23 Septembre 2004 Component)
AsCC (Asynchronous Communication
8
AsCC -
Asynchronous Communication Component
Client
Client
connect
ge
sc he dule r
me
ss a
AsCC
put
connect
connect
buffe r
m
ge
essa
p ro c
ng
e ss i
Counter
DISPO 23 Septembre 2004
9
AsCC2
Counter
connect
AsCC1
connect
Client
AsCC3
Bank
DISPO 23 Septembre 2004
10
Too complicated … we need some implicit asynchronous communication mechanism
Company
connect
Client
General Overview
MultipleCommunication
Package
ProActive
Reflective mechanisms to transform
Passive objects into active objects
Use Futures for synchronous communication
MultiComm
(A)Synchronous remote communication
Transparent use of RMI registry/proxies/stubs
(thanks to java 1.5.0)
DISPO 23 Septembre 2004
11
Y
ClassExampleProxy:proxyObject3
SyAsCProxy:proxyObject1
:aClientObject
ClassExampleProxy:proxyObject4
SyAsCProxy:proxyObject2
X
Client Side
Server Side
<<interface>>
SynchronousComm
RMI
ClassExample:anObject
X
SyAsC:anSyAsCObject
Y
<<interface>>
AsynchronousComm
DISPO 23 Septembre 2004
12
Plan
ArchJava
Dynamic Configuration in ArchJava
Asynchronous Communication Experiments
Symbolic Transition Systems for
Components
DISPO 23 Septembre 2004
13
STS for Components
STS definition
1.
•
•
2.
3.
Graphical
Textual for manipulation
Set of rules for translation into
Code: Java, ArchJava, others
DISPO 23 Septembre 2004
14
STS for Components
Availability property
STS Description
Generation
Code
Behavior
Control
Business
Code
DISPO 23 Septembre 2004
15
Current Work and
Perspectives
Resource Allocation Case Study
STS definition
Synchronous/asynchronous communication
Availability Property?
Generation Process
Code Conformance
DISPO 23 Septembre 2004
16
~operation ::=asynchronous operation
3
required acquireR(acquireG(self))
~acquire
[subscribedG(self)]
release
1
unsubscribe
required ~subscribed
[subscribeG(self)]
Types
~subscribe
required ~notsubscribed
[not subscribeG(self)]
Name
Description
Client
...
Ressource
...
2
Operations
Name
Parameters
Type
subscribe
?idClient:Client
public/provided
unsubscribe
?idClient:Client
public/provided
subscribed
void
public/required
notsubscribed
void
public/required
Description
17
Téléchargement