Add support for constructors

Issue #132 resolved
Matthias Schoettle created an issue

In order to properly identify constructors and destructors when creating messages it is important to have this information in the metamodel.

As per discussion from our meeting on May 5th:

  • a type enum is added to the operation (normal, constructor, destructor)
  • constructors will be named create and destructors destroy
  • we add an extra button to be able to add constructors and destructors

Comments (15)

  1. Matthias Schoettle reporter

    References issue #132: Changed operation type to constructor for operations with name "create" and to destructor for "destroy" of all models in the reusable model library.

    → <<cset 41d0f756471f>>

  2. Matthias Schoettle reporter

    References issue #132: Updated copying of operations. EcoreUtil is used and only the non-containment references then need to be updated. This makes sure that new attributes are always copied as well.

    → <<cset f757082cf129>>

  3. Matthias Schoettle reporter

    References issue #132: Displaying operation type for constructor and destructor instead of return type. A pretty printer changes the visualization to a stereotype (<<construct>> or <<destruct>>).

    → <<cset f08bed4a2248>>

  4. Matthias Schoettle reporter

    References issue #132: Fixed problem with class cast exception. For some reason the Object[] cannot be cast into OperationFeaturesp[].

    → <<cset ebee1341f4cc>>

  5. Matthias Schoettle reporter

    Resolved issue #132: Finalized constructor/destructor support:

    • the class view has an additional buttons for more options, that now allows to add a constructor or destructor
    • constructors are added at the beginning, after existing constructors
    • destructors are added after constructors, after existing destructors
    • a default constructor/destructor is added and the user can then adjust visibility and parameters

    Note: It is possible that adding a constructor/destructor makes the model invalid, because there is already one with the same signature.

    → <<cset 9234ead19f46>>

  6. Matthias Schoettle reporter

    References issue #132: Updated models: All constructors and destructors of the model library are now ordered properly.

    Improved code for finding positioning to stop as soon as a normal operation was found.

    → <<cset a3d3930595f7>>

  7. Matthias Schoettle reporter

    References issue #132: Added support to properly draw create messages and allow creation of additional messages to define the creation.

    → <<cset 3fb4bcebb8a3>>

  8. Matthias Schoettle reporter

    References issue #132: Added support to properly draw create messages and allow creation of additional messages to define the creation.

    → <<cset 01b46821d4ed>>

  9. Matthias Schoettle reporter

    References #132: Adds the filtering of constructors that are from a super class and not of the current/actual class (call receiver).

    When creating an instance of a specific class, only the constructors of that class should be selectable.

    → <<cset dd3fe6501cac>>

  10. Log in to comment