F.A.Q. » F.A.Q. » How to create static object with multiplicity


How to create static object with multiplicity

2603 Betrachtungen
Seite: 1
MichaelKamsties
avatar
Administrator
75 Beiträge

How to create static object with multiplicity

Motivation

In most cases embedded developer will use static objects and no malloc, so what is the way in Rhapsody to create static objects if there is multiplicity used

Example

There are two classes A and B with a directed association and the multiplicity 8 for class B designed in an object model diagram.

Solution

There are two possible solutions

  • First Solution:

    create a second object model diagram, create instances (objects) of class A and B and draw a link between them (you will see that this is an directed link). Than change the multiplicity of the itsB object to 8. To see what the code generator do have a look in the init function of the package which contain the classes.

  • Second Solution:

    Create a second object model diagram and create one instance of class A and eight instances of class B, then draw links from itsA to each instance of B. In the image we use C and D.

If you want to see a little demonstration have a look at this Rhapsody model:

ExampleModel

Seite: 1

Currently Online:

There is nobody online.

Welcome to our latest member: lammils