Applying Model Driven Development to the DDS Domain Bruce Trask Hans van t Hag OpenSplice DDS Products
Complex Publish Subscribe Systems Object Oriented Component Based Multithreaded/MultiProcess Real-time Embedded C++/Java/Ada/VHDL Platform Independent High Performance Heterogeneous Distributed Vital Secure Fault Tolerant Portable Standardized Declarative Imperative Dynamic So what s the big deal? Each one by itself is difficult, let alone doing them all at the same time Slide 2 Copyright PrismTech 2006
Computer Science, Software Engineering Computer Science is the discipline that believes all problems can be solved with one more layer of indirection 1 Formalize the level of indirection Provide ways to program at this new level Provide automatic ways to get back to executable lower levels of abstraction Standardize Optimize 1 Dennis DeBruler, Refactoring, Fowler et. al. Addison Wesley 1999 Slide 3 Copyright PrismTech 2006
SerialName <<Interface>> PropertySet (f rom CF) configure() query() <<CORBATypedef>> Properties (from... FrequencyProp... <<Interface>> PortSupplier (f rom CF) getport() << Interface>> Resource (from... identifi er : stri ng start() stop() Encoder <<Interface>> TestableObject (from CF) runtest() <<Interface>> Li fecyc le (from CF) initialize() releaseobject() <<Interface>> Port (from CF) connectport() disconnectport() <<Interface>> DTPort (from C++ Reverse Engineered) <<Interface>> DT (from C++ Reverse Engineered)...) myfunc1() myfunc2() myfunc3() POA_DTPort (from C++ Reverse Engineer ed) POA_DTPort() POA_DTPort() <<virtual>> ~POA_DTPort() _this() <<stati c>> myfunc1_skel() <<stati c>> myfunc2_skel() <<stati c>> myfunc3_skel() <<stati c>> connectport_skel() <<stati c>> disconnectport_skel( ) DTUsesPort (f rom C++ Reverse Engineered) m_provi desrefs : std::map<std::string, DT_var> m_name : std::string m_howmanyconnectionsallowed : unsigned long m_howmanyconnectionsmade : unsigned long DTUsesPort() connectport() disconnectport() name() numofconnectionsmade() myfunc1() myfunc2() myfunc3() POA_DT (from C++ R ev erse Engineered) POA_DT() POA_DT() <<virtual>> ~POA_DT() <<virtual>> _is_a() _this() <<abstract>> myfunc1() <<static>> myfunc1_skel() <<abstract>> myfunc2() <<static>> myfunc2_skel() <<abstract>> myfunc3() <<static>> myfunc3_skel() DTProvidesPort (from C+ + Reverse Engineered) m_presource : ResourceNameIt* DTProvidesPort() myfunc1() myfunc2() myfunc3() Levels of Abstraction Programming Platform Less Flexible More Productive Frameworks Flexibility Higher Order Languages Assembly Middleware Operating Systems Productivity Opcodes More Flexible Custom Hardware Less Productive Slide 4 Copyright PrismTech 2006
SerialName <<Interface>> PropertySet (f rom CF) configure() query() <<CORBATypedef>> Properties (from... FrequencyProp... <<Interface>> PortSupplier (f rom CF) getport() << Interface>> Resource (from... identifi er : stri ng start() stop() Encoder <<Interface>> TestableObject (from CF) runtest() <<Interface>> Li fecyc le (from CF) initialize() releaseobject() <<Interface>> Port (from CF) connectport() disconnectport() <<Interface>> DTPort (from C++ Reverse Engineered) <<Interface>> DT (from C++ Reverse Engineered)...) myfunc1() myfunc2() myfunc3() POA_DTPort (from C++ Reverse Engineer ed) POA_DTPort() POA_DTPort() <<virtual>> ~POA_DTPort() _this() <<stati c>> myfunc1_skel() <<stati c>> myfunc2_skel() <<stati c>> myfunc3_skel() <<stati c>> connectport_skel() <<stati c>> disconnectport_skel( ) DTUsesPort (f rom C++ Reverse Engineered) m_provi desrefs : std::map<std::string, DT_var> m_name : std::string m_howmanyconnectionsallowed : unsigned long m_howmanyconnectionsmade : unsigned long DTUsesPort() connectport() disconnectport() name() numofconnectionsmade() myfunc1() myfunc2() myfunc3() POA_DT (from C++ R ev erse Engineered) POA_DT() POA_DT() <<virtual>> ~POA_DT() <<virtual>> _is_a() _this() <<abstract>> myfunc1() <<static>> myfunc1_skel() <<abstract>> myfunc2() <<static>> myfunc2_skel() <<abstract>> myfunc3() <<static>> myfunc3_skel() DTProvidesPort (from C+ + Reverse Engineered) m_presource : ResourceNameIt* DTProvidesPort() myfunc1() myfunc2() myfunc3() Levels of Abstraction more accurate Programming Platform Less Flexible Frameworks More Productive Flexibility Middleware Libraries Productivity More Flexible Higher Order Languages Assembly Opcodes Custom Hardware Operating Systems Less Productive Slide 5 Copyright PrismTech 2006
The Problem General Purpose programming languages have not kept pace with the growth of platform complexity 1 Families of systems are the order of the day Systems and requirements have become more complex 1 Model Driven Engineering, Douglas C Schmidt IEEE Computer Feb 2006 Slide 6 Copyright PrismTech 2006
Families of Systems http://www.army.mil/fcs/ Slide 7 Copyright PrismTech 2006
More Complex Systems and Requirements Slide 8 Copyright PrismTech 2006
Insufficient tools to do the job C++ UML Slide 9 Copyright PrismTech 2006
Traditional tools UML Insufficiently domain specific Some say not semantically precise enough to be machine processed Not much different than programming with OO languages 3GL C++, Java, Ada etc. Insufficiently domain specific Not at a sufficient level of abstraction Frameworks, libraries and components So many Complicated Manipulated via 3GL languages DDS-tools IDL pre-processing: Insufficiently domain specific Slide 10 Copyright PrismTech 2006
Traditionally a separation modeling Programming Slide 11 Copyright PrismTech 2006
Traditionally a separation Systems Engineering Software Engineering Slide 12 Copyright PrismTech 2006
Critical Innovations Technologies that enable systematic vs. ad hoc reuse and enable the systematic development of families of systems Component technologies Domain Specific Languages 1 1 Software Factories, Greenfield et. al Wiley 2005 Slide 13 Copyright PrismTech 2006
Model Driven Development Bringing modeling and programming together modeling Programming Instead of forcing a separation of the high-level engineering/modeling work from the low-level implementation programming. It brings them together as two well-integrated parts of the same job 1 Eclipse modeling Framework, Budinsky et.al Addison Wesley 2004 Slide 14 Copyright PrismTech 2006
Some ramifications modeling and programming blend into one activity Models become development artifacts as well not just design artifacts Domain Specific Models can be machine processed and thus integrate well with generators Developers can program in terms of their design intent rather than the underlying, computing environment 3 3 IEEE Computer Magazine, February 2006 Model Driven Engineering, Douglas C. Schmidt Slide 15 Copyright PrismTech 2006
Model Driven Development Bringing Systems and Software together Systems Engineering Software Engineering Instead of forcing a separation of the high-level engineering/modeling work from the low-level implementation programming. It brings them together as two well-integrated parts of the same job 1 Eclipse modeling Framework, Budinsky et.al Addison Wesley 2004 Slide 16 Copyright PrismTech 2006
Some ramifications Increased cross discipline collaboration Speaking the same language Flattens learning curves 3 IEEE Computer Magazine, February 2006 Model Driven Engineering, Douglas C. Schmidt Slide 17 Copyright PrismTech 2006
Providing sufficient tools to do the job DSML Tool C/C++/Java UML DSML Tool Slide 18 Copyright PrismTech 2006
How is this done? Domain Specific modeling Languages 2 Domain Specific Editors Transformation engines and generators Combine the above three Called Model Driven Development (a.k.a Model Driven Engineering, or Model Integrated Computing) 2 IEEE Computer Magazine, February 2006 Model Driven Engineering, Douglas C. Schmidt Slide 19 Copyright PrismTech 2006
Domain Specificity Domain Independent Domain Specific - Tools The task at hand Slide 20 Copyright PrismTech 2006
The steps In general Isolate the abstractions and how they work together Create a formalized grammar for these - DSL Create a graphical representation of the grammar GDSL Provide domain-specific constraints GDSCL, DSCL Attach generators for necessary transformations In our domain The DDS specification Create a formalize DDS meta-model Create a DDS specific graphical tool Program into the tool the constraints C++, C and Java generators Slide 21 Copyright PrismTech 2006
Applying MDD to the DDS Domain OpenSplice DDS Products
Contents DDS An Information Centric Approach Introducing the Example Information modeling Application modeling Deployment modeling Slide 23 Copyright PrismTech 2006
DDS: An Information Centric Approach Information MEANING «Entity» SystemTrack + systemtracknumber : integer - _StateVector MODEL 1 «Entity» StateVector 1 - _CCSStateVector «Entity» OwnShipTrack «Entity» CCSStateVector + timevalidity : real + position : CCSPositionType + velocity : CCSVelocityType Analysis Server BEHAVIOR Data AVAILABILITY Client CORBA Server Design App App OMG - DDS App Slide 24 Copyright PrismTech 2006
MDD-aspects in Coalition Based Development Design Authority Common Information Model Information modeling Company a Company b Company c Application modeling A B C D E F G H I J K L DDS Information Backbone Deployment modeling Slide 25 Copyright PrismTech 2006
Introducing The Example SENSOR PROCESS CLASSIFICATION PROCESS DISPLAY PROCESS Optical sensor Scans the environment Produces Tracks Position of objects Reports pointtrack Classifies tracks Determines their identity Analyses the trajectories Determines hostility Reports trackstate Displays track info Both position & identity Raises alerts Requires pointtrack Requires trackstate Slide 26 Copyright PrismTech 2006
MDD and the Example PointTrack PointTrack pos pos Track Track trackid trackid Information- Model TrackState TrackState identity identity Information modeling MDD Tool suite Display Process Identification Process Remote- Sensor Process Application modeling Config Config (XML) (XML) Computing-Node s App-1 App-2 App-3 Library Library Library Shared Data Storage Soap- Library Library Soap- Library Library Durability- Durability- Library Library Config- Config- Library Library Network- Network- Disk Disk -XML -XML -Binary -Binary - RDBMS - RDBMS App-1 App-2 App-3 App-1 6/28/2006 Pge no. 27 network App-2 App-3 Deployment modeling
(1) Information modeling Track Track trackid trackid Information- Model PointTrack PointTrack pos pos TrackState TrackState identity identity Information modeling 6/28/2006 Pge no. 28
Information modeling: Scope & Purpose Language Define the spoken language in the system Requirements phase: to talk with the customer Development phase: to talk between components DDS-Domain specific Topics (Type + QoS) Editor Semantics: UML ( annotated ) Syntax: IDL (optional MDD-input if predefined) Behavior: QoS (reliability, urgency, durability) Generator Types (IDL) from UML (or direct IDL-import) Topics from Types DDS-entities Topic-creation, QoS-setup, typed readers/writers Slide 29 Copyright PrismTech 2006
Information modeling: The Example Topic Sensor PointTrack { long trackid; Display Position pos; } Key: trackid QoS: best-effort, volatile Track PointTrack Publisher PointTrack pos trackid TrackState identity PointTrack Subscriber SPLICE-DDS Real-time Information Backbone Task: Information modeling Model the PointTrack and TrackState topics Model the system-wide behaviour of topics Model the relationships between the Topics Separate these concerns from applications MDD: Features / Advantages Graphical modeling of structure and QoS (intuitive, fast) DDS-entity code generation (topics, interfaces) Allowing for direct utilization (by applications or tool) Documented packages of re-usable topic-sets Slide 30 Copyright PrismTech 2006
(2) Application modeling Display Process Identification Process Remote- Sensor Process Application modeling 6/28/2006 Pge no. 31
Application modeling: Scope & Purpose Language Processing-language DDS keywords Editor publishers/writers, subscribers/readers,.. Content-filters, queries, waitsets, listeners, Templates & Patterns (loop, MVC, ) Application-level QoS modeling (history, filters) Process modeling (waitsets, listeners) Generator Application-framework from templates DDS entities from (graphical) model Annotated application- and test-code Simple DDS-Loop Pattern Register with DDS Declare publications Declare subscriptions Define queries (read_conditions) Select input data Set query parameters Process data Publish output data Wait for input data Slide 32 Copyright PrismTech 2006
Application modeling: The Example Track trackid Display PointTrack pos TrackState identity Content Filtered Multi-Topics datareader (MyTrack) datareader (MyTrack) topic topic PointTrack { PointTrack { long source; datawriter long long trackid; source; (sensor) datawriter long trackid; (sensor) Position pos; } Position pos; } Key: source,trackid QoS: Key: best-effort, source,trackid QoS: volatile best-effort, volatile topic topic TrackState { TrackState { datawriter long source; datawriter long long trackid; source; (classification) long trackid; (classification) long environment; long long identity; environment; } long identity; } Key: source,trackid QoS: Key: reliable, source,trackid QoS: transient reliable, transient read read take take Multi-topic Multi-topic aggregation aggregation Query-condition Query-condition Sample-state Query-condition Lifecycle-state Query-condition Selection Sample-state Selection Lifecycle-state MyTrack { Selection Selection MyTrack { long Id; Any Any long Id; Any Any Position p; long Position env; p; Not_Read New Modified } long env; Not_Read New Modified } Read No_Writers Disposed Read No_Writers Disposed Multi-topic Multi-topic Multi-Topic projection Multi-Topic projection Content- Filters Content- Timed-waitset Filters Timed-waitset or Call-backs or Call-backs PointTrack - PointTrack TrackState SQL-query - TrackState Parameterized- SQL-query - Parameterized- SQL-query Query- Conditions Query- Local data-cache Conditions Local data-cache Content-filtered Multi-topic Subscriber Slide 32 Copyright PrismTech 2005 Slide 32 Copyright PrismTech 2005 SPLICE-DDS Real-time Information Backbone Task: Display Process modeling Model aggregate interest multi-topic or DLRL-object with local QoS Model display process (periodic loop) Handle first-appearances of hostile tracks with prio MDD: Features / Advantages Import information-model Provide Application-framework (from loop template) Model DLRL-objects, Multi-Topics, Queries, Waitsets, Developer can concentrate on business-logic (GUI) Slide 33 Copyright PrismTech 2006
THE CONTENT-SUBSCRIPTION PROFILE (2) Content Filtered Multi-Topics datareader (MyTrack) read Query-condition Sample-state Selection Query-condition Lifecycle-state Selection MyTrack { datawriter (sensor) topic PointTrack { long trackid; Position pos; } Key: trackid QoS: best-effort, volatile take Multi-topic Not_Read Any Read Multi-Topic New Any No_Writers Modified Disposed long Id; Position p; long env; } Multi-topic projection topic aggregation Content- Filters Timed-waitset or Call-backs datawriter (classification) TrackState { long trackid; long identity; } Key: trackid QoS: reliable, transient PointTrack TrackState Local data-cache - SQL-query - Parameterized- SQL-query Query- Conditions Slide 34 Copyright PrismTech 2006
Application modeling: MDD-Tool Sneak-Peak Slide 35 Copyright PrismTech 2006
(3) Deployment modeling Computing-Node s App-1 App-2 App-3 Library Library Library Shared Data Storage App-1 App-2 App-3 App-1 App-2 App-3 Config Config (XML) (XML) Soap- Library Library Soap- Library Library Durability- Durability- Library Library Config- Config- Library Library Network- Network- Disk Disk -XML -XML -Binary -Binary - RDBMS - RDBMS network Deployment modeling 6/28/2006 Pge no. 36
Deployment modeling: Scope & Purpose Language Deployment-language DDS keywords Participants, Partitions, Resource limits,.. Latency-budget, Transport-priority, Editor Configure physical DDS system Networking, Durability, Resource-limits, Map DDS (QoS) properties to Deployment properties DDS partitions to Network-partitions (multicast groups) transport-priority to Network-channels (prio/diffserv) latency-budget to Network-dispatcher (efficiency) Generator (Control & Monitoring) (remote) set-up, configure and monitor DDS-system Deploy information-models (create readers/writers) Deploy applications (monitor, QoS-tuning) Deploy systems (logging/replay, QoS tuning, ) Config Config (XML) (XML) Computing-Node s App-1 Library Library Library App-2 Library Shared Data Storage Library Library Durability- Durability- Soap- Soap- Library Library App-3 Library Library Library Config- Config- Network- Network- Disk Disk -XML -XML -Binary -Binary - RDBMS - RDBMS Slide 37 Copyright PrismTech 2006
Deployment modeling: The Example MDD-suite Display Process Identification Process Remote- Sensor Process roundtrip-support Computing-Node s App-1 App-2 App-3 Library Library Library Shared Data Storage App-1 App-2 App-3 App-1 App-2 App-3 Config Config (XML) (XML) Soap- Library Library Soap- Library Library Durability- Durability- Library Library Config- Config- Library Library Network- Network- Disk Disk -XML -XML -Binary -Binary - RDBMS - RDBMS network Task: Deployment modeling ( Control & Monitoring ) MDD: Features / Advantages Configure Durability-service (transient TrackState topic) Round-trip engineering Configure Network-channels (priority, reactivity) Deploy & tune models (info & application) Configure Resources (resource-limits) Control & Monitor deployed system Remote control & Monitoring of deployed system Using the domain specific DDS-language 6/28/2006 Pge no. 38
Deployment modeling: MDD-tool sneak-peak Slide 39 Copyright PrismTech 2006
MDD For DDS QUESTIONS? Slide 40 Copyright PrismTech 2006