Title: Model Driven Architecture
1Model Driven Architecture
- Pankaj Joshi
- Based on presentation by
- R.M. Soley, CEO OMG
- and
- Johann Oberleitner, Vienna University of
Technology
2Heterogeneity is Permanent
- Programming languages
- 3 million COBOL programmers
- 1.6 million VB programmers
- 1.1 million C/C programmers
- Operating systems
- Unix, MVS, VMS, MacOS, Windows, PalmOS
- Embedded devices (mobile, set-top, pSOS, VXWorks,
etc.) - Networks
- Ethernet, ATM, IP, SS7, Firewire, USB
- Bluetooth, 802.11b, HomeRF
3Where Can We Agree?
- There will not be consensus on hardware platforms
- There will not be consensus on operating systems
- There will not be consensus on network protocols
- There will not be consensus on programming
languages - There must be consensus on interfaces and
interoperability!
4Goal of OMG
- Develop an architecture, using object technology,
for distributed application integration. - Specifications freely available
- Implementations exist
- Member-controlled not-for-profit
5How Can We Protect Software Investment?
- The problem remains
- Tracking the next best thing
- Protecting your investment in existing software
base - Retaining qualified staff
- Maintaining existing code base
6The Model Driven Architecture
- Provides opportunity to increase your bottom line
by integrating your assets - Industry standards support that goal by
future-proofing your application design - The MDA will help you integrate the mix you have
today, and give you an architecture to support
the unexpected - Focus on integrating legacy applications
- Ensure smooth integration of COTS applications
- Models are testable and simulatable
7What is Model Driven Architecture?
- A New Way to Specify and Build Systems
- Based on modeling with UML
- Supports full lifecycle
- Builds in Interoperability and Portability
- - Applies directly to the mix you face
- Programming language
- Network
- Operating system
- Middleware
8What is OMG (Contd.)
9Basic Idea of MDA
Transformation Rules
- Meta Data!
- Models are stored in a repository
- Transformations!
- Steps/rules are defined to transform the domain
entities to the necessary pieces of the technical
architecture - First pass is an Application Model
(technology-specific) - Second pass is the Code Model (i.e., working app)
Domain Model
Domain Model
Technology Transformations
Application Model
Implementation Transformations
Code Model
Code Model
10Primary Idea of MDA
PIM
PSM (1)eg. EJB
PSM (2)eg. .NET
System Code EJB
System Code .NET
11Primary Idea of MDA Contd.
- Platform Specific Models
- PSMs are generated from PIMs
- Model transformation
- Upcoming UML Standard (QVT)
- Mark Model in PIM
- Currently only partial PSMs are generated
- PSMs are source for code generators
- These code generators can be complete
12Primary Idea of MDA Contd.
- Verification of system properties at PIM
- Verification of system properties at PSM
- In theory no component testing at code level
- Only System Test
- Documentation always up-to-date
13Generating Implementations
Platform-Independent Model
Java/EJBModel
OtherModel
CORBA Model
XML/SOAPModel
14Integrating Legacy COTS
Platform-Independent Model
COTS App
OtherModel
Legacy App
15Automating Bridges
Platform-Independent Model
MDA Tools combine application and platform
knowledge to generate bridges
XML/SOAPModel
CORBA Model
XML/SOAP System
16MDA Models
- Usually represented in UML
- All MOF based models possible
- Detailed Models
- Complete naming of elements
- All details left out in the model are left out in
the system - Constraints of model elements
17Technologies
- UML, CWM, MOF
- Modeling Baseline
- XMI
- Representation for MOF/UML models
- JMI, EMF
- APIs for XMI
- OCL
- Enhances models with formal descriptions
- QVT
18Modeling Baseline
- UML
- MOF
- CWM (Common Warehouse Metamodel)
- Modeling constructs for Data Warehouses
- Database Models
- Query Facilities
- Supported by major Portal Vendors
- IBM, Oracle, Unisys
19Meta-Object Facility (MOF)
- 4 layer stack
- Base for different modeling standards
- UML, CWM
- Principally open
- M3 contains a principal set of modeling constructs
MOF Class
M3 MetametametadataMetaMeta-Model
instance of
M2 MetametadataMetamodel
UML Class
instance of
M1 MetadataModel
instance of
BMWW-1234
M0 Objects/Data
20UML Extensions
- UML cannot be complete
- 2 ways to extend UML/MOF
- heavyweight completely new meta-model
- Lightweight
- Stereotypes
- Tagged Values
- UML/MOF profiles
21UML Profiles in MDA
UML Class
M2
inherits
entity
ltltentitygtgt Book
M1
22UML Profiles in MDA
- UML Profile for EDOC
- Specialized Profiles
- Problem
- Only proof-of-concept
- Incomplete
- Lack of formality
- MDA Tool Vendors have invented their own profiles
- Lack of portability
23UML Profiles in MDA
- Stereotypes/Tagged Values
- Interpreted by code generators
- Example
- Model generator for EJB
- Stereotype entity
- persistent objects Entity Beans
- Stereotype PK
- Marks attribute as Primary Key
24UML Profiles in MDA
PSM
PIM
Book EJB
Database Tables
Deployment Descriptor
BookImpl(implementation class)
PK
BookHome(home interface)
BookRemote (remote interface)
25OCL
- Object Constraint Language
- Used for exact modeling of UML/MOF models
- Small language
- Simple built-in types
- Collection types
- Elements of the model can be used
26OCL
- Describes Logical Constraints
- Attached to modeling elements
- Documentation Purposes
- Used for formal verification
- Used for generation of testcases
- Can be checked at runtime
- May throw exceptions
- See Design by Contract
27OCL
- OCL for pre-/postcondition
- Directly from specification
- Example
- Class Account models bank account
- Field balance stores balance
- Methods deposit/withdraw
- context Accountdeposit(int amount)
- pre amount gt 0
- post balance balance_at_pre amount
- context Accountwithdraw(int amount)
- pre amount gt 0 and balance gt amount
- post balance balance_at_pre - amount
28OCL
- OCL used for invariants
- Holds during lifetime of an object
- Constraints between model elements
- Defined at the level of the meta-model
- Must hold before and after transformation
29OCL
- OCL for Initialization code
- OCL for Navigation expressions
context Copyinv self.copyOfBook.authorsOfBook-gts
ize() gt 0
Book
Author
Copy
authorsOfBook
copyOfBook
1
30QVT
- Querie, View, Transformation
- RFC of OMG for MDA transformations
- 15 submissions
- Declarative transformation languages
- Imperative transformation languages
- Hybrid
31MDA Tools
- IDEs Modeling Tools
- IBM Rational XDE (Java .NET)
- Borland Together
- Microsoft Whitehorse (appears 2005)
- Poseidon
- MDA based Code Generators
- AndroMDA
- PEERS
- Architectural IDEs
- Interactive Objects ArcStyler
32IDEs Modeling Tools
- Focus on Roundtrip Engineering
- Growing support for dynamic stuff
- Partial support for code generators
- Invoked called from the tool
- Support for Design Patterns
- Strong reverse engineering support
- String refactoring support
33MDA based Code Generators
- Models as Input
- Generates Code from these Models
- UML Profiles guide code generation
- Examples
- AndroMDA
- Extensible with cartridges
- PEERS
- Generation of Persistent .NET DataModel from UML
class diagrams
34MDA Applicability
- MDA good for
- Persistent objects
- Generation of Datamodels
- Those scenarios where Models are expressive
enough - Class diagrams are well understood
- Generation of StateMachines
- Generation of (Design) Patterns
- Many Patterns already supported by IDEs
- Generation of constraint checks
35MDA Applicability
- MDA not so good for
- Dynamic stuff
- Operations
- UML Action Semantics
- Describes semantics of operations
- Requires a concrete language that conforms to UML
Action Semantics
36Next Steps
- Automatic Generation of methods
- Automatic Generation of database Queries
- Integrated Model Checking
- Deadlock detection
- State machines
- Theory based on Hoares Concurrent sequential
processes (CSP)
37Conclusion
- Smooth integration across intra- and
inter-business boundaries (across deployment
technologies) - Reuse of applications, code, training and people
- Technology-independent representation of the
business - Scalability, robustness security via generated
code - Stable model-based approach maximizes ROI
- Rapid inclusion of the next best thing