Show
Ignore:
Timestamp:
07/02/02 02:15:32 (6 years ago)
Author:
arjanmol
Message:

*** empty log message ***

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gaphor/doc/model.txt

    r6 r101  
    1515but we should check the object that is added to the list for its type.  
    1616 
     17 
     18Signals 
     19~~~~~~~ 
     20UML elements should emit signals if their state changes. This can be done 
     21by means of the misc.signal.Signal class. All what's left is to define a 
     22protocol (the arguments that the UML element supplies). 
     23 
     24The following cases can occur: 
     251. Unidirectional relationships or attributes: 
     26   a. Set data 
     27   b. Set data and overwrite old data 
     28   c. Remove the attribute 
     292. Bidirectional relationships 
     30   a. multiplicity of '1' 
     31   b. multiplicity of '*' 
     32 
     33For non-sequence attributes we can do something like this 
     34 
     35        def signal_handler(attribute_name, old_value, new_value, *custom_args): 
     36            pass 
     37 
     38where old_value and new_value is None (or the default value) in case no value 
     39was set before. 
     40 
     41For sequences we can only add and remove values. We can do this with the 
     42same amount of attributes, only old_value will be one of 'add' or 'remove' and 
     43new_value will contain the value that is added or removed. 
     44 
     45 
     46