Topic
  • 3 replies
  • Latest Post - ‏2009-11-03T09:22:40Z by SystemAdmin
SystemAdmin
SystemAdmin
147 Posts

Pinned topic Why the signal can not be sent to the second instance of one class?

‏2009-11-02T11:23:50Z |
In verifying, I set a class with "multiplicity" attribute, and generate 2 instances including obj[1] and obj[2], but in running,the second instance( obj[2])can't receive the signal from other class, even in the same state just as the first instance( obj[1]).
How to deal with the situation?
Updated on 2009-11-03T09:22:40Z at 2009-11-03T09:22:40Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    147 Posts

    Re: Why the signal can not be sent to the second instance of one class?

    ‏2009-11-02T14:30:56Z  
    There are a couple of samples provided with Tau, with relevant examples.

    umlVerificationPointersAndParts shows object creation.

    umlVerificationDynamicCreation shows creation of new instances of active classes.

    Have a look at these examples.
  • SystemAdmin
    SystemAdmin
    147 Posts

    Re: Why the signal can not be sent to the second instance of one class?

    ‏2009-11-02T14:31:10Z  
    There are a couple of samples provided with Tau, with relevant examples.

    umlVerificationPointersAndParts shows object creation.

    umlVerificationDynamicCreation shows creation of new instances of active classes.

    Have a look at these examples.
  • SystemAdmin
    SystemAdmin
    147 Posts

    Re: Why the signal can not be sent to the second instance of one class?

    ‏2009-11-03T09:22:40Z  
    Also, if you're using multiple instances with dynamic creation, you would usually have a 'manager' (which is a part on the same composite structure diagram as the part which is going to have multiple instances) which a) does the creation, b) maintains a list of them so references can be passed to other classes, and c) when it comes to time to destroy them, it either sends them a message to terminate, or the instance sends the manager a message that it is terminating, so the manager can keep a completely up-to-date list of the active instances.

    Or, if there is a static number of instances, e.g. 2, the design could be that when each instance starts it sends its own identity to the manager, and the manager can respond to a query from one instance asking for references to the other instance(s).