Title: Model Driven Architecture
1Model Driven Architecture
- An approach to MDA
- using MOF modeling and
- lessons learned
- Werner Froidevaux
- wfro_at_omex.ch
2Generating Implementations
Platform-Independent Model
MDA tool applies a standard mapping to generate
Platform-Specific Model (PSM) from the PIM. Code
is partially automatic, partially hand-written.
Refinement
XML/SOAPModel
OtherModel
CORBA Model
Java/EJBModel
Map PSM to application interfaces, code, GUI
descriptors, SQL queries, etc.
MDA tool generates all or most of the
implementation code for deployment technology
selected by the developer.
XML/SOAP
Other
CORBA
Java/EJB
3Benefit of MDA
- Generators accelerate component development
typically by orders of magnitude compared to
manual implementation - and many more
- BUT
4Is this the Vision of MDA?
- effective code generation requires
platform-specific UML extensions (e.g.
tool-specific profiles, Web Application Extension
(WAE), UML Profile for EJB (JCP JSR-26)) - tools generate platform- and vendor-specific
bindings (e.g. CORBA-, EJB-, WebServices bindings)
- vendor-specific, non-portable models
- models decorated with platform-specific tags
- non-interoperable applications
- non-portable application-code
5The MOF IFR Prototype _at_ 1999
- 'MOF compliant IFR' _at_ 1999 OMG Meeting,
Philadelphia - Extensive use of code generators (PIM and PSM)
GUI Generator
Implementation Generator
Rose Exporter
MOF Repository
XML Exporter/ Importer
IDL Generator
Component (MOF IFR)
MOF Generator Toolset
6MDA Lessons Learned
- 1 Platform-specific modeling (PSM) is not
required. - 2 Code-generation can be reduced to a minimum
if model is part of runtime. - 3 Increase interoperability and reusability by
allowing to mix language bindings.
71-1 PSM is not required
PIM
- Class Diagrams MOF
- Behavior UML Activity and State Diagrams
- Typically proprietary and non-portable.
PSM
81-2 MOF for class diagrams
- Although MOF is level M3 it can also be used as
level M2 metamodel - Application-level class diagrams can be defined
as MOF-compliant class diagrams (not only
metamodels!) - Advantage Existing platform-independent mappings
can be applied JMI, XMI (or other user-defined,
e.g. JDO)
Component
Component Implementation
MOF Mapping
MOF-compliant Model
platform-independent binding (e.g. JMI)
Interface
91-3 MOF for class diagrams
101-4 Runtime environment for platform-independent
components
- Provide a platform-optimized runtime environment
for platform-independent components which
abstracts from component model and middleware.
platform-specific component (generic PIM to PSM
mapping)
PS binding
1..n
platform-independent component
PI config
EJB, CCM, .NET, runtime
platform
111-5 Abstract from Middleware
- Generic runtime environment for PI components
must support pluggable middleware.
121-6 Abstract from Programming Language?
- UML Approach Use UML Action Semantics, Activity
Diagrams or Sequence Diagrams to model behavior.
UML execution engine or generate a component
implementation. - GPPL Approach General Purpose Programming
Languages such as Java, C allow to implement
platform-independent components if - platform-independent bindings are used
- component model and middleware runtime
abstraction is used
132 Let Model be part of Runtime
- Let the PIM be part of the runtime environment.
Support reflective and typed programming. - This allows the implementation of generic,
model-driven framework and components. - Minimize use of generators. No generation,
implementation and testing for each model.
model-driven implementation
Allows to implement components which
implement generic patterns, e.g. persistence,
state, role, security, accounting, notification,
logging, wrappers, bridges.
PIM
JMI typed and reflective binding
EJB
CORBA
143 Allow to mix language bindings
- Separate binding used to access a component and
binding which is used to implement a component. - Client is not required to use a specific binding.
- Component can be used by different types of
clients.
PI Component
Implementation
JMI
Generic
PI Component
Implementation
JDO
JDO
15Benefits
- Platform-independent, portable, reusable models.
- Portable, platform-independent components.
- Fast, simple and transparent roundtrips through
minimized use of code generators. - Proof of Concept Available?
16SPICE An MDA Implementation
- YES. The OMEX/SPICE application and integration
framework provides - generic, model-driven runtime environment for
platform-independent components - No platform-specific modeling required
- Library of standard components implementing
standard patterns - Proven since years in real-world projects
17SPICE An MDA Implementation
- Some Facts and Figures
- Code generators
- Average component size 100-2'000 LOCs. Samples
MOF repository 500 LOCs Role, State,
Persistence 2'000 LOCs. - Supports mixed in-process, EJB, CORBA deployment.
- Standard plugins type checking, persistence,
role, state, ocl, - Supports MOF, JMI, XMI, JDO,
18Questions?