|
Re: How to count number in time of initialization of a document [message #231971 is a reply to message #231844] |
Tue, 02 June 2009 07:40 |
Eclipse User |
|
|
|
Originally posted by: tobk42.gmx.de
Hello Filip,
if I understand you corrently the purpose of the variable is only to
show how many of these child elements are contained in this node, and
the variable itself is unsettable (or only indirectly by adding or
removing child elements). In this case it would be better to use a
"derived" attribute instead, or even an eOperation, returning that
value. In this case the value is computed each time the getter (or the
eOperation) is called (should be no problem assuming that determining
the children is not overly complex).
Regards,
Tobias
Filip Sebesta schrieb:
> Hi,
>
> I have got a problem. One entity (node) in my model contains a variable
> which value is the count of another entity (subnode) which the node
> contains and the value is counted by a method. When I work with a new
> document, it is OK because new nodes starts with a default value and
> counting is triggered by making changes, but when I open an existing
> document, a default value is initialized. I think it is becuase the
> counting method is called in time when other entities does not exist. So
> the method counts a wrong number.
>
> Where should I call the method or what should I do for setting a
> variable on a proper value?;
>
>
> Thanks!
>
|
|
|
Powered by
FUDForum. Page generated in 0.02582 seconds