Latest issue: June

Sister website

Sister website

Features

Leveraging the Power of Modelling, Simulation and Code Development
for Optimal Results

Written by Rick Boldt, Senior Director, Rhapsody Product Marketing & Automotive Industry Marketing

Figure 1: An example of a Model-Drive Development environment embedded within the Eclipse IDE.

Open source development evokes a great deal of interest and attention from engineers looking for a low-cost, intuitive and universally accepted means to develop new software projects. With the emergence of the Eclipse open source community, developers are naturally interested in using a standard framework to develop embedded and/or real-time applications. But leveraging the power of the Eclipse framework within a UML 2.0 Model-Driven Development (MDD) environment has, until now, been a tremendous challenge for engineers. There have been major hurdles for engineers in transitioning to a complete MDD environment, such as giving up control over the structure of the code and learning to design at the model level. Telelogic’s Rhapsody environment, allows engineers to leverage Eclipse CDT/JDT to work at the code level and in a proven MDD environment to obtain the benefits of abstraction and automation provided by a modeling, simulation and code generation solution with C, C++ and Java development capabilities, essentially allowing users to get the best of both worlds.

In the past, MDD environments and IDE’s forced users to work in one environment or the other with no substantive interaction between the two “worlds”. In cases where the developer wanted to work with models, the users faced the difficult task of writing the code themselves in an IDE, like one would with a CASE tool, and then the developers would have to maintain both the models and the code since they would easily lapse out of synch with each other. Early MDD solutions that generated code produced black box code, which is unreadable and offers very little code level control. Getting the black box code to look right and operate as intended was nearly a “black art”, and if the user could change the code, it was a given that the model and the code would be out of synch, leading to a major maintenance issue. Writing the code from scratch was even worse, as inevitably the model and code link would be broken and both were nearly impossible to understand.

The power of the combined Eclipse IDE and Rhapsody MDD environment is that this integration allows users to work at the both the code level in the same natural workflow as before, and at the model level, with a host of benefits derived from working in a MDD framework. These benefits include transitioning to a MDD environment at the user’s own pace, with reduced risks from changing to a MDD framework. Since developers can continue to work at the code level, there is a short learning curve with the solution and almost zero ramp-up time. As an additional benefit, Rhapsody automatically produces code documentation and test scenarios, easily streamlining this process.

Four key technologies make the combination between an Eclipse based code centric workflow and an MDD model centric workflow a reality; reverse engineering of existing code into a graphical model, round-tripping of changes made to the code being developed back into the model, automatic generation of new code from the model and dynamic model code associativity (DMCA) that ensures changes to either the code or the model are kept in sync. One key item that needs to be insured is code respect. That is when code is reverse engineered or round-tripped and then re-generated the user needs to have the option to maintain the original file structure and naming of the files while also not changing the internal flow, structure and naming of the code itself.

This combination is particularly effective when challenges arise in meeting the project requirements for the code. By working in the Eclipse IDE to write or modify the code and having the changes automatically appear in the MDD environment, users can ensure that algorithms meet special characteristics including timing, safety, and security. This also is a benefit in situations where the size of the code is of concern, or direct interaction with the hardware is required. Additionally, a scenario where the existing code must be included in the project, such as a wish to reuse legacy code or a need to integrate third-party code, the combined Eclipse IDE and Rhapsody MDD environment is a powerful solution.

Graphically modeling the project allows engineers and developers to abstract away from the code, to clearly see how all the elements of the project operate together. With the ability to simulate the model and the code on the host computer during the development process, rooting out problems is done quickly at the beginning of the process, when the costs and time needed to fix these issues is at a minimum. Additionally, this allows development and testing to begin before the target hardware is available. By automatically generating the code for a majority of the new capabilities and reverse engineering any existing code into the model engineers can shorten the development time through automation. Perhaps the most valuable feature is the self-documenting workflow. The ability to generate designs of the code being developed makes design intent much clearer to all.

By allowing users to maintain their current workflows and processes while adopting an MDD process, users have the ability to perform configuration management working with the same solutions and on the code exactly the way it is done today with an extension that provides differencing and merging of multiple branches at the graphical model level. By allowing Eclipse to maintain and manage the source code with base-award graphical differencing and merging, the Rhapsody and Eclipse combination provides the ability to maintain the traditional code centric configuration management process while gaining the advantages of abstraction achieved by working at the model level.

Obtaining maximum productivity benefits requires that the navigation from the code to the model and the model to the code is seamless and automated. The Rhapsody and Eclipse integration achieves this by allowing users to select some code in Eclipse and automatically finds and opens the corresponding model element, or by simply selecting a model element and the corresponding code is then located.

www.telelogic.com