Component based engineering in MDA

Download Report

Transcript Component based engineering in MDA

Component Based
Engineering in MDA
MDA and CCM
Dr. Philippe Merle
CR1 INRIA Futurs Lille / LIFL – USTL
President of the ObjectWeb College of Architects
Chair of the OMG Components 1.1 RTF
Leader of the OpenCCM project
Summer school “MDA for Embedded System Development”,
Brest, Brittany in France, September 17th, 2002
September 17th, 2002
MDA and CCM
1
Contents

From Software Components to MDA


The CORBA Component Model (CCM)



A quick guided tour
New Component Models with MDA and CCM


Components, component models, distributed object and
component middleware to MDA
New PIM and transformation to CCM
How building MDA to CCM transformation platforms with
OpenCCM
Conclusion

MDA and CCM at OMG (current RFP and proposals)
September 17th, 2002
MDA and CCM
2
From Software Components
to MDA
September 17th, 2002
MDA and CCM
3
Why Software Components?

Time to market




Programming by assembly (manufacturing) rather
than development (engineering)




Improved application productivity
Reduced complexity
Reuse of existing code
Reduced skills requirements
Focus expertise on domain problems
Improving software quality
Key benefit with client-side & server-side
development
September 17th, 2002
MDA and CCM
4
Why Software Component Models?

Deal with recurrent technical requirements


e.g. CORBA = communication between distributed objects
Provide means to abstract technical requirements

e.g. OMG IDL = interfaces and operations of distributed objects
=> Abstraction instead of technical skills


e.g. OMG IDL versus socket API
Product software components automatically

e.g. stubs and skeletons for CORBA communication
=> Improve software productivity and quality
=> Reduce development costs
September 17th, 2002
MDA and CCM
5
Why Software Component Models?

Implementation neutral



e.g. multi transport layers: TCP/IP, ATM, shared memory, …
e.g. multi programming languages: C++, Java, IDLscript, …
e.g. multi OS: Windows, Unix, Cray, PDA, RTOS, …
=> Portability and interoperability

Could be also efficient than ad hoc solutions!


e.g. Real-Time ORBs like TAO, omniORB, Orbix/E, …
Requirements for tools and platforms in order to be
really useable!
September 17th, 2002
MDA and CCM
6
From Distributed Objects …

Distributed Object Computing (DOC) Middleware




No architectural vision of applications



Object bindings are hidden in code
Often not declared or configurable
No separation between functional / non functional aspects



e.g. CORBA – DCOM - Java RMI
Rationalize software processes for defining, developing and
executing distributed applications
Strongly used in industrial applications
All application aspects are programmed explicitly!
Complexity for business domain experts
No packaging and deployment facilities

Only ad hoc solutions!
September 17th, 2002
MDA and CCM
7
... To Distributed Components

DOC middleware evolution



Some architectural notions



Bindings are declared and configurable
e.g. JavaBeans and ports in CCM
Better separation of functional / non functional aspects



e.g. CCM - .NET - EJB
Cover software processes for packaging, assembling and
deploying distributed applications
Components / containers
Described instead of programmed (e.g. XML descriptors)
Packaging for automatic deployment


Standard format for binary archives
API to control distributed deployment
September 17th, 2002
MDA and CCM
8
But No Universal Component Middleware!
for
MDA?
Major Challenge!
CORBA
September 17th, 2002
EJB
.NET
MDA and CCM
...
9
Challenges With Component Middleware

A lot of standard component middleware











SUN = Java RMI, EJB, JMS, J2EE, Jini …
Microsoft = OLE -> COM -> DCOM -> COM+ -> .NET
W3C = HTTP -> XML -> SOAP -> Web services
New ones appear, e.g. CCM, .NET, Web services, …
When old ones disappear, e.g. COM, DCE, …
What is the “best” one?
What is the “Next Best Thing”?
How building software for the long term?
How moving between component middleware?
How preserving business application logic designs?
How addressing the recurrent gap between business
requirements and component middleware artifacts?
September 17th, 2002
MDA and CCM
10
Model Driven Architecture

New orientation for OMG activities


Models are centric!


Target middleware is not important!
Focus on Platform Independent Models (PIM)


New step beyond the Object
Management Architecture (OMA)
Without middleware details
Abstract Platform Specific Models (PSM)

Including all middleware details

Define PIM to PSM transformations

Preserving PIM when new middleware appears!
September 17th, 2002
MDA and CCM
11
Current MDA Technologies

Meta Object Facility (MOF)

Unified Modeling Language (UML)

XML Model Interchange (XMI)

Common Warehouse Meta-model (CWM)

Software Process Engineering Meta-model (SPEM)

Action Semantics Language (ASL)

Various UML profiles

...
September 17th, 2002
MDA and CCM
12
All are (Meta-)Models in MDA
Submissions
Java
EJB
CORBA Med
UML
Evaluating
XMI
MDC OIM
CIAS
Standards
EC
EAI
CCM
CWM
UML
XML
Enterprise
App Integration
MOF
September 17th, 2002
UML Profile for
EDOC...
SPEM
UML
MOF
Life Sciences
EC
EAI
CCM
CWM
UML
Electronic
Commerce
Document
Management
CCM
MDA and CCM
Etc.
IDL
UML4CORBA
CWM
13
PIM, PSM, and Transformations in MDA
Platform Independent Model
(PIM)
TRANSFORMATION RULES
Platform Specific Model
(PSM)
September 17th, 2002
Platform Specific Model
(PSM)
MDA and CCM
14
PIM to PSM Transformation
Examples with MOF/XMI
UML Model (PIM)
XMI Document (PSM)
XMI
IDL, Java… (PSM)
interface Auto
{
Class Auto
};
{public String color;
public int Door;
public int Engine;
}
September 17th, 2002
<Auto>
<Color> Red </Color>
<Door> 4 </Door>
<Engine> 2 </Engine>
</Auto>
XMI DTD, Schema (PSM)
<!Element Auto
(Color*,
Door*,
Engine*)>
MDA and CCM
15
Transformation Models in MDA
PIM
Software
Infrastructure
PSM
J2EE
.Net
J2EE
PIM to PSM
Transformation
Model
PIM
HealthCare Business
Application (CIAS)
September 17th, 2002
PSM
.Net
MDA and CCM
16
Could Transformation Models be
Considered as MDA-oriented?
Model for
Model Transformation
TRANSFORMATION RULES
J code for
Code for
Objecteering Rational Rose


XSLT
...
PIM = Abstract Model for Model Transformation
PSM = Concrete Transformation Technologies
September 17th, 2002
MDA and CCM
17
Could OMG IDL be Considered as
MDA-oriented?
OMG IDL
MAPPING RULES
C++


Java
IDLscript
...
PIM = Abstract Interface Definition Language
PSM = Concrete Programming Languages
September 17th, 2002
MDA and CCM
18
Could OMG IDL be Considered as
MDA-oriented?
OMG IDL
MAPPING RULES
GIOP


ESIOP
SOAP
PIM = Abstract Interface Definition Language
PSM = Concrete Network Transport Syntaxes
September 17th, 2002
MDA and CCM
19
Could GIOP be Considered as
MDA-oriented?
GIOP
MAPPING RULES
IIOP


UDP
Shared
Memory
...
PIM = Abstract Network Transfer Syntax
PSM = Concrete Network Transport Layers
September 17th, 2002
MDA and CCM
20
MDA Applied To Component Middleware
Entreprise Distributed
Object Computing
(EDOC)
TRANSFORMATION RULES
CORBA


EJB
.NET
...
PIM = Abstract Component Model for enterprise computing
PSM = Concrete Standard Component Middleware
September 17th, 2002
MDA and CCM
21
The CORBA Component Model
(CCM)
September 17th, 2002
MDA and CCM
22
TO BE COMPLETED
September 17th, 2002
MDA and CCM
23
New Component Models
with MDA and CCM
September 17th, 2002
MDA and CCM
24
Why New Component Models?

Often application designers want to use concepts
not present in PSM

e.g. CCM has no active JavaBeans properties
1) Creating a new PSM but also requires to develop
the associated middleware

Very expensive and time consuming!!!
2) Creating a new PIM and defining PIM to PSM
transformation rules
September 17th, 2002
MDA and CCM
25
The Message Filtering Example

A filter has





1 input for receiving messages to filter
Configurable filtering properties
1 filtering function
1 output for accepted messages
1 output for rejected messages
Filter
OK
F = M.C1 == P1 or M.C2 > P2
NO
P1 = V1
P2 = V2
September 17th, 2002
MDA and CCM
26
Application = Assembling Filters
September 17th, 2002
MDA and CCM
27
The Message Filtering Example With CCM
eventtype Message {
. . . Message fields . . .
};
component Filter {
consumes Message input;
publishes Message accepted;
publishes Message rejected;
. . . Configurable filtering properties . .
.
};
home FilterHome manages Filter {
factory create_filter(. . .);
};
September 17th, 2002
MDA and CCM
28
Problems

All must be done manually!







Defining OMG IDL for message eventtypes, filter component and
home types
Implementing CCM eventtypes, components and homes
Writing CCM XML descriptors
Extremely verbose, time consuming and error prone!!!
How improving productivity and quality?
How dealing with thousand messages and filters?
How dealing with other Message Oriented Middleware
(MOM)?

Like EJB 2.0 message beans
September 17th, 2002
MDA and CCM
29
The Message Filtering Example With MDA

Capturing the essence through a meta model



Structure of messages, i.e. message fields
Filtering properties and function
Using XMI to obtain a XML DTD or Schema

Syntax for serializing instances of the meta model

Providing a UML profile for end users

Defining transformation to MOM PSMs

Generating message filtering components automatically
=> Improve productivity and quality
=> Reduce development costs
=> Preserve PIM when new MOM appears
September 17th, 2002
MDA and CCM
30
The Message Filtering Meta-Model
InheritsFrom
InheritsFrom
0..1
<<metaclass>>
Message
<<metaclass>>
Filter
1
id : string
function : string
AppliedOn
id : string
0..1
1
1
Properties
*
Fields
*
<<metaclass>>
Field
<<metaclass>>
Property
name : string
name : string
ty p e
1
1
<<metaclass>>
DataType
ty p e
id : string
September 17th, 2002
MDA and CCM
31
The Message Filtering XML DTD
<!ELEM MFL (message, filter)*>
<!ELEM message (field)*>
<!ATTRLIST message id ID>
<!ELEM field EMPTY>
<!ATTRLIST field
name CDATA
type CDATA>
<!ELEM filter (property)*>
<!ATTRLIST filter
id ID
appliedOn IDREF
function CDATA>
<!ELEM property EMPTY>
<!ATTRLIST property
name CDATA
type CDATA>
(The XMI generated DTD is very similar)
September 17th, 2002
MDA and CCM
32
A Message Filtering XML Descriptor
<MFL>
<message id=«Email»>
<field name=«to» type=«string»\>
<field name=«from» type=«string»\>
<field name=«title» type=«string»\>
<field name=«contents» type=«string[]»\>
</message>
<filter id=«FromFilter»
appliedOn=«Email»
function=«e.from == from»>
<property name=«from» type=«string»\>
</filter>
</MFL>
September 17th, 2002
MDA and CCM
33
Using the Message Filtering UML Profile
«message»
Email
to: string
from: string
title: string
contents: string[]

«filter»
FromFilter
« AppliedOn »
from: string
f(e: Email): boolean
{e.from == from}
This UML Profile reuses UML concepts to map the
Message Filtering Meta-Model concepts when they are
adequate and UML user-friendly
September 17th, 2002
MDA and CCM
34
Message Filtering PIM to MOM PSMs
Transformation
Message Filter
Component Model
TRANSFORMATION RULES
CCM


EJB/JMS
Other MOM
...
PIM = Abstract Message Filter Component Model
PSM = Concrete Message Oriented Middleware
September 17th, 2002
MDA and CCM
35
The Message Filtering PIM to CCM
Transformation
eventtype Email {
public string from, to, title;
public sequence<string> contents;
};
component EmailFilterBase {
consumes Email input;
publishes Email accepted;
publishes Email rejected;
};
component FromFilter : EmailFilterBase {
attribute string from;
};
home FromFilterHome manages FromFilter{
factory create_filter(in string from);
};
September 17th, 2002
MDA and CCM
36
Next Step on the Message Filtering
Meta-Model




Only allow definition of message and filter types
Only generate OMG IDL types, implementations,
and CCM XML packaging descriptors
Complete the meta model to describe filter
instances and connections between them
Then allow generation of CCM XML assembling
descriptors for automatic deployment
September 17th, 2002
MDA and CCM
37
Drawback around MDA-oriented Tools

Few MOF compliant tools to experiment the creation of
new component meta models!

Developing UML profiles are time and money consuming

UML Profile Builders are still expensive and proprietary

No portability of developed UML profiles between UML
Tools!!!

Few formalisms to express MDA transformation


OMG RFP under work
Few PSM meta models for


Programming languages like Java, C++, …
Component standard middleware
September 17th, 2002
MDA and CCM
38
How Building MDA to CCM
Transformation Platforms
With OpenCCM
September 17th, 2002
MDA and CCM
39
OpenCCM




An ObjectWeb project

http://www.objectweb.org/openccm

Open source under LGPL
The first available implementation of the CORBA
Component Model
A flexible and open platform to design, develop, package,
assemble, deploy and administrate CCM applications
Allow us to build MDA to CCM transformation platforms
September 17th, 2002
MDA and CCM
40
The OpenCCM Platform






A compiler for OMG IDL, PSDL, and CIDL files
An Abstract Syntax Tree for IDL, PSDL, and CIDL
An Interface Repository
Generators to IDL, PSDL, CIDL, IDL2, CIF for Java files
A graphical user interface for CCM XML packaging and
assembling files
An Abstract Tree for packaging and assembling XML DTDs

A deployment tool
A runtime application server
An administration console

Runs on top of Unix, Windows, Win/CE for PDA


September 17th, 2002
MDA and CCM
41
The OpenCCM’s Compilation Chain for
IDL, PSDL, and CIDL Files
IDL/PSDL/CIDL
Compiler
Abstract Syntax Tree
for IDL/PSDL/CIDL
Interface
Repository
Generators
IDL/PSDL/CIDL
September 17th, 2002
OMG IDL2
MDA and CCM
CIF for Java
42
The OpenCCM’s Tool Chain for
XML Packaging and Assembling Files
CCM
XML
CCM
XML
CCM
CCMXML
XML
XML
parser
Abstract Tree
for CCM XML
Software components
Java Swing
GUI
Application
package
September 17th, 2002
MDA and CCM
43
The OpenCCM’s Deployment Chain
Abstract Tree
for CCM XML
Deployment Tool
Component distribution, installation,
instantiation, configuration and execution
Component servers
Target environment
September 17th, 2002
MDA and CCM
44
Generic Meta Tools for XML DTD

OpenCCM code for managing CCM XML DTD is
automatically generated


The Abstract Tree for packaging and assembling XML DTDs
The packaging and assembling GUI

Using generic meta tools for XML DTD

The Zeus DTD2Java meta tool



Generator of XML to Java binders
i.e. Java objects representing XML elements
The OpenCCM DTD2GUI meta tool

Generator of Java Swing GUI from XML DTD
September 17th, 2002
MDA and CCM
45
DTD2Java and DTD2GUI Meta Tools
GUI
Parametrization
XML DTD
OpenCCM
DTD2GUI
Zeus
DTD2Java
Java Tree
Java Swing GUI
Observer
Design Pattern
September 17th, 2002
MDA and CCM
46
Zeus DTD2Java Generation Example

For the following XML DTD
<!ELEMENT persons person*>
<!ELEMENT person EMPTY>
<!ATTRLIST person name CDATA>

Zeus DTD2Java generates
interface Persons {
void addPerson(Person p);
void removePerson(Person p);
List getPersonList();
};
class PersonsImpl implements Persons { . . . };
interface Person {
String getName();
void setName(String v);
};
class PersonImpl implements Person { . . . };
September 17th, 2002
MDA and CCM
47
OpenCCM DTD2GUI Generation Example
September 17th, 2002
MDA and CCM
48
Applying DTD2Java and DTD2GUI in MDA

Could be used on any XML DTD

Even those generated by XMI DTD

To parse, manipulate, and view






Any
Any
Any
Any
Any
Any
MOF meta model
UML model
PIM & PSM model
instance of any PIM
instance of any PSM
instance of any component model
September 17th, 2002
MDA and CCM
49
Building MDA to CCM Transformation
Platforms With OpenCCM
MOF
aCMM
MOF2DTD
Component Model
Designer
aCCM
XML DTD
Zeus
DTD2Java
OpenCCM
DTD2GUI
Java4aCMM
GUI4aCMM
September 17th, 2002
MDA and CCM
Component Model
End User 50
Building MDA to CCM Transformation
Platforms With OpenCCM
Transformation
Java4aCMM
Transformation
engine
Abstract Syntax Tree
for IDL/PSDL/CIDL
Generated
IDL/PSDL/CIDL
Abstract Tree
for CCM XML
CCM
XML
Generated
CCM
XML
descriptors
CCM XML
descriptors
descriptors
Generated Java
Implementation
September 17th, 2002
Java
IDLscript
Transformation
Transformation
Transformation
scripts
scripts
scripts
scripts
MDA and CCM
51
Building MDA to CCM Transformation
Platforms With OpenCCM
MOF
aCCM
XML DTD
aCMM
Component Model
Designer
Transformation
Java
IDLscript
Transformation
Transformation
Transformation
scripts
scripts
scripts
scripts
Java4aCMM
GUI4aCMM
Transformatio
n
engine
OpenCCM API
September 17th, 2002
Component Model
End User
MDA and CCM
Generated
CCM
Compliant
Transformation
Transformation
Transformation
Files
scripts
scripts
scripts
52
Transformation Script Example
for the Message Concept
event=to.declareEvent(from.getId())
ctx.addMapping("event_type", event)
Java4aCMM
ctx.visit(from.getFieldList(), event)
filter=to.declareComponent(
from.getId()+"FilterBase")
ctx.addMapping("filter_base", filter)
input=filter.startConsumes("input")
input.setEvent(event)
ctx.addMapping("input", input)
from
Transformatio
n
engine
ctx
accepted=filter.startPublishes("accepted")
accepted.setEvent(event)
ctx.addMapping("accepted", accepted)
rejected=filter.startPublishes("rejected")
rejected.setEvent(event)
ctx.addMapping("rejected", rejected)
September 17th, 2002
MDA and CCM
OpenCCM API
to
53
Transformation Script Example
for the Field Concept
Java4aCMM
member=to.startValueMember(
from.getName())
from
Transformatio
n
engine
member.setPublic()
member.setType(ctx.findType(from.getType()))
ctx.addMapping("member", member)
September 17th, 2002
MDA and CCM
ctx
OpenCCM API
to
54
Transformation Script Example
for the Filter Concept
Java4aCMM
c=to.declareComponent(from.getId())
c.setBaseComponent(
ctx.getMapping(from.getAppliedOn(),
"filter_base") )
ctx.addMapping("component_type", c)
ctx.visit(from.getPropertyList(), c)
from
Transformatio
n
engine
ctx
h=to.startHome(from.getId()+"Home")
h.setManagedComponent(c)
ctx.addMapping("home_type", h)
September 17th, 2002
MDA and CCM
OpenCCM API
to
55
Transformation Script Example
for the Property Concept
Java4aCMM
a=to.startAttribute(from.getName())
from
Transformatio
n
engine
a.setReadwrite()
a.setType(ctx.findType(from.getType()))
ctx.addMapping("attribute", a)
September 17th, 2002
MDA and CCM
ctx
OpenCCM API
to
56
Benefits for Building MDA to CCM
Transformation Platforms with OpenCCM

UML tool neutral



At design time, only XMI generation required
At runtime, no UML tool presence
Allow production of Open Source MDA to CCM
transformation platforms

All used tools are Open Source

Only require to write scripts for transformation

To do




Improve the transformation engine features
Simplify how transformation scripts are written
Express transformations in XML and generate scripts
Implement the MOF2DTD tool as a MDA transformation
September 17th, 2002
MDA and CCM
57
Conclusion
September 17th, 2002
MDA and CCM
58
Summary

Evolution from software components to MDA




Software component models are PSM
CCM should be the major PSM at OMG
New component models could be designed with
MDA and mapped to CCM
MDA to CCM Transformation Platforms can be
built with OpenCCM
September 17th, 2002
MDA and CCM
59
CCM and MDA at OMG

Fraunhofer FOKUS/IK++ submission to MOF 2.0 IDL RFP




Deployment and Configuration RFP


Chartered at the Yokohama meeting (April 26th 2002)
UML Profile for CCM RFP




OMG TC Doc orbos/2002-01-19
Components 1.1 Revision Task Force


MOF repositories should be CORBA Components
RFP = OMG TC Document ad/01-11-07
Subm. = OMG TC Document ad/02-05-06
OMG TC Doc telecom/2002-09-02
Revision of the UML Profile for CORBA for
including IDL 3.0 extension, PSDL, and CIDL
Presented at the next Helsinki OMG meeting
EDOC to CCM Mapping should be prepared!
September 17th, 2002
MDA and CCM
60
Open Source CCM Implementations

OpenCCM from LIFL & ObjectWeb



MicoCCM from FPX & Alcatel



Java on ORBacus 4.1 & OpenORB 1.2.1 & BES 5.x
http://www.objectweb.org/openccm/
C++ on MICO
http://www.fpx.de/MicoCCM/
CIF from Humboldt University


C++ on ORBacus 4.1
http://sourceforge.net/projects/cif
September 17th, 2002
MDA and CCM
61
Other CCM Implementations

Qedo from Fraunhofer FOKUS



EJCCM from CPI Inc.



C++ on MICO & ORBacus 4.1
http://qedo.berlios.de
Java on OpenORB 1.3.x
http://www.ejccm.org
K2 from ICMP


C++ on various ORBs
http://www.icmgworld.com
September 17th, 2002
MDA and CCM
62
More Information

OMG MDA Web Page


CORBA Components Specification


http://www.ditec.um.es/~dsevilla/ccm/
IST COACH Project


OMG TC Document ccm/2002-06-01
“The CCM Page”, Diego Sevilla Ruiz


OMG TC Document formal/2002-06-65
CORBA Component Model Tutorial


http://www.omg.org/mda
http://www.ist-coach.org
OpenCCM

http://www.objectweb.org/openccm/
September 17th, 2002
MDA and CCM
63
September 17th, 2002
MDA and CCM
64