100 likes | 119 Views
UniMod helps design state machines using UML tools, offering state validation, event handling, and code generation for faster application development.
E N D
Development of Tools for Object Oriented Programs with Explicit StateEmphasis EngineeringMaxim MazineMarch 31st, 2004
Problem Statement(1) • In UML there are means to model both static program structure (class diagrams) and dynamic (state diagrams, collaboration diagrams, sequence diagrams). • A number of methodologies for static program structure modeling and automated code creation. • Description of behavioral is generally informal • No semantic link with code. • Diagrams are used only for object domain disclosing. • No methodology to design complex logic • Collaboration and sequence diagrams are useless in this case. • State diagrams as proposed by UML authors could hardly be used because of identifiers flood on diagrams. Moreover there are limits on state machines nesting.
+ + + OO Design Methodology Framework25% Product Framework25% Tool + + 50% 25% Manual Programming 65% Auto Generation10% Model Problem Statement(2) design development
Approach • Analyze problem domain, create conceptual model. • Extract controlled objects and state machines. • Design class diagram using free UML modeling tool ArgoUML. • Put controlled objects on the right hand. • Put state machines on the left. • Assign names to links between state machines and controlled objects using identifiers like Oi. • Define methods of two main types for every controlled object: • Incoming effects (Xj). • Outcoming effects (Zk). • Implement incoming effects and outcoming effects manually. • Create state-transition (Moore-Mealy) graphs on state diagrams. • Specify events on transitions (Em) in addition. • Automatically convert class diagram and state-transition graphs to XML state-machine description or target language code.
UniMod consists of • Core • State machine meta-model. • Algorithms for parsing and translation of guard conditions. • Algorithms for state machines validation. • Framework for runtime XML description interpreting. • Target language code creating tools. • Plug-in • Common module for all UML design tools. • Module for UniMod integration with ArgoUML.
Design (UniMod plug-in) • UniMod helps to design state machines using UML design tools. • Gives comfortable state machine tree view. • Validates state-machine on the fly and highlights errors. • State attainability check. • Consistency of transition set. • Completeness of transition set. • Generates state machine code • State Machine XML description for further interpreting or • Code for target programming language to compile. State machine structure State-transition graph State machine structure Validation messages Logs
Development (runtime) • There are two approaches for runtime state machine execution • Interpreting • Java XML interpreting framework. • XML description is converted into internal object presentation once and completely. Resulting system consists of runtime environment and object representation of state machine. • To handle event this system: • Analyzes the event and incoming effects to chooses the transition; • Executes outcoming effects; • Invokes internal state machines. • The system is able to produce logs: • verbose (reflects state machine activities); • non-verbose (only dumps effects invokes). • Compilation • State machines are hard coded. • Events handling accomplished using SWITCH technology.
Benefits • Based on proven standards (UML) • Removes gap between design and implementation • Consistent and valid model based on finite-state machine theory • Leads to consistent code • Accelerates application development • Supports the methodology with the tool • Errors on diagrams highlighting • Use forward engineering for • XML State Machine Description (interpreting) • Target language code (compiling) • Mandatory documentation • Redundant artifacts are removed because diagrams are project documents and part of programs simultaneously.
Hosting • The project is supported by eVelopers Corp.http://www.evelopers.com/ • UniMod is an open source project located at SourceForge • http://unimod.sourceforge.net/ • Foundation for Open Project Documentationhttp://is.ifmo.ru/