CocoaModeler

Eclipse Cocoa Modeler

Content

About Eclipse Cocoa Modeler

Extended UML 2 Case tool based on environment EMF Eclipse making it possible to build information systems using parametrizable models also called aspectual templates described in the thesis of Alexis Muller. For further details, please refer to Alexis Muller's Thesis and ECMDA'05

Eclipse Cocoa Modeler is a set of Eclipse plugins that provides the following capacities~:

  • Edition of umlAssembly models (a UML extension) which allow to specify

aspectual templates and their assembly via the apply operator

  • The validation of the created models
  • The use of model library (import, save).
  • The use of a Design pattern Library
  • Application of aspectual templates (merge mode)

Requirements

You'll need :

  • Eclipse (Helios or Indigo, version Eclipse Modeling Tools) with both Acceleo and OCL Tools plugins
  • Graphviz (http://www.graphviz.org/)
  • Eclipse Graphviz plugin (jars are included in the following jars)

Screenshot of the case tool

Download and Installation

  • Download the following zip archive : Cocoa Modeler plugins
  • unzip the downloaded file into the 'plugins' directory of Eclipse

Library of design pattern

A library of well-known design patterns is implemented by using aspectual templates. In order to use it :

  • download this file : libraryPatternGOF.zip
  • Import the library : select "File/import" in the Eclipse menu, then select "General/Existing Projects into Workspace", click "Next", select the downloaded archive file "Select archive file" and, last, click "Finish".
  • There is now a new Eclipse project that includes the different design patterns

Graphical view of Aspectual templates

This tool provides a graphical view of a model. If this view do not appear automatically, you have to load it by selecting "Window/Show View/Other..." then "Cocoa Modeler/Diagram"

If you have the following error message «Unexpected exception executing Graphviz java.io.IOException : Cannot run program « chemin d'accès à dot.exe » », you have to specify the path of the Graphviz application : select "Window/Preferences", then select the tabbed pane "CocoaModeler", then specify the path for the "dot" application (graphviz).

Modeling Errors

In case of modeling errors, The plugin detects them and provides error codes. The following table enumerates the error codes and their meanings

Error Codemeaning
FeatureParameterOwning classes of parameter features must also be parameters
AssociationParameterEnding classes of a parameter association must also be parameters
PropertyTypeThe type of a parameter property must also be a parameter
OperationTypesTypes involved in a parameter operation must also be parameters
ModelFeatureOwning relationships between formal parameters must be preserved in their corresponding actual values
ModelAssociationMember ends of a formal parameter association must be substituted by member ends of its actual value
ModelPropertyThe substituted type of a formal parameter property must be the type of its actual value
ModelOperationThe substituted types of operation parameters must be substituted by the corresponding types of the actual operation
FeatureSubstitutionOwning class of a substituted feature must also be substituted
AssociationEndsSubstitutionEnding classes of a substituted association must also be substituted
PropertyTypeSubstitutionThe type of a substituted property must also be substituted
OperationMemberTypesSubstitutionTypes involved in a substituted operation must also be substituted
PartialApplyingTargetIn case of partial applying, the target package must be an aspectual template
PartialApplyingFeatureIf a parameter class c is substituted by a class c' and one parameter feature of c is not substituted then c' must be a parameter of the target package
PartialApplyingPropertyTypeIf a parameter class c is substituted by a class c' and c is the type of a parameter property which is not substituted then c' must be a parameter of the target package
PartialApplyingOperationTypesIf a parameter class c is substituted by a class c' and c is one of a parameter type of a parameter operation which is not substituted then c' must be a parameter of the target package
PartialApplyingAssociationIf a parameter class c is substituted by a class c' and c is one of a member end of an parameter association of c which is not substituted then c' must a parameter of the target model
ParameteredElementParameters of a template must only be model elements of it
FormalParametersformal parameters must be elements of the signature of the TemplateApplying
SetFormalParametersa parametered element appears at most once as a formal parameter
ActualParametersactual parameters must be elements of the target package
MetaTypea formal parameter must have the same metatype than their corresponding actual parameter

Basic Tutorial

A typical use of this tool includes the following steps:

  • creation of an "Assembly Model"
  • importation of an existing model from a library
  • creation of a "Template Applying" in order to apply the imported model to the base model
  • Checking the assembly model
  • Execution of the apply (fusion mode)

Example

We illustrate this tool by the application of the well-known Observer pattern to an existing system : the "HeatFlowRegulation" model.

The "HeatFlowRegulation package models a part of a home heating system. This package has its own content which is composed of "RoomSensor", "HeatFlowRegulator" and "Furnace" classes.

First Step : create your model

  • In Eclipse instance create a new project "demo" and a new folder "models".

Select this folder, right click on it, select New-> Other-> Cocoa Modeler Assembly Model Creation -> Assembly Model.

  • Name it "MyModel.umlassembly", press "Next"
  • Select as the Model Object "Assembly Model" and press "Finish".

Second Step : Edit your model

  • You should now see a editor for your model.Right click on "Model Assembly" and create

new elements (New Child).

  • To edit the elements use the "Properties View" which can be found

under Window -> Show View -> Properties. The following figure show the created elements for our example :

Thanks to the graphical view, the tool provides the following diagram for this model :

Third Step : import model from library

It is possible to load models stored in libraries. For our example, we import the Observer Pattern model. The process is the following :

  • Select UMLAssembly Editor -> import a model...
  • Select the required model

Fourth Step : model composition

In this example, the TemplateApplying relationship is used to connect the Observer pattern to the HeatFlowRegulation model. This is specified by associating "RoomSensor" to "Subject", "HeatFlowRegulator" to "Observer" and their respective "value" and "value_view" attributes to "currentTemperature" and "measuredTemperature".

The process is the following :

  • creation of the template applying :
  • set the properties for the templateAppying :
  • set the substitutions for the template parameters of the templateApplying :

The Diagram view shows now the resulting Assembly model :

Fifth Step : Applying the pattern (merge mode)

  • Select the created Template Applying
  • in the menu, select UMLAssembly Editor -> Apply

The generated model is the following :

As a result of this applying, "RoomSensor" and "HeatFlowRegulator" have respectively the same elements (operations and association) than "Subject" and "Observer". Note that actual classes may have contents in addition to those specified for the formal parameters.

Additional Step

For each step of the process, the model or a part of it can be checked by selecting Assembly Model Editor -> validate

Acknowledgement

© 2011 the COCOA group

Special thanks to GIS Students who contributed to this project :Carine Locquet and Romain Vandierdonck