Published Sep 3, 2019

Episode 16: MDSD Pt. 3, Hands-On

Explore the cutting-edge techniques of model-driven software development in Episode 16, where Marcus Blankenship and Priyanka Raghavan delve into polymorphism in templates, state machine implementation, and the complexities of code generation to enhance scalability and performance.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • State Machines

    State machines are a fundamental concept in programming, offering a structured way to manage states and transitions in systems. explains that state machines can be implemented using various methods, such as polymorphism or arrays, but the simplest is a big switch statement 1. This approach is exemplified in a telephone call processing system, where states like start, stop, standby, idle, and active are managed through constants and nested switch statements 2. highlights the importance of defining a metamodel with states and transitions, using EMF tooling for implementation 3.

       

    Switch Approach

    The switch-based approach to state machines is a straightforward method that uses switch statements to handle state transitions. notes that this method involves iterating over states and creating constants for each, which simplifies the code generation process 4. This approach allows for flexibility, as different implementation strategies can be applied, such as generating code for various programming languages without altering the metamodel 5. emphasizes the importance of externalizing platform-specific extensions to keep the metamodel clean and adaptable 4.

       

    Constraints & Performance

    Performance and constraints are crucial in state machine modeling to ensure efficiency and correctness. discusses constraints like ensuring a single start state and no incoming transitions for start states, which help maintain model integrity 6. The use of declarative languages like OCL for defining constraints allows for clear error messages and model validation 7. Additionally, scalable model development is achieved by adding platform-specific logic through extensions, avoiding clutter in the metamodel and facilitating modularization 8.

Related Episodes