Explicit Propagation to Parent Types
It is possible to propagate notification to a parent type just as it is propagated to a relation. To examplify this point, let’s assume —though it is not very realistic— that a manager object has a n-ary relation managed whose targets are the set of employees it manages.
Let us also assume a view on the manager represents each employee as a row in a table associated with the manager:
view ManagerView :
subscribe origin Manager:
represent TableR table:...
propagate managed;
subscribe Employee:
represent RowR row:...
This specification works unless some other manager objects appear in the managed relation. In that case, those “managed Managers” will be represented by a table and not by a row. This is not the expected result!
To overcome this potential problem, all you have to do is to modify the specification as follows:
view ManagerView :
subscribe origin Manager:
represent TableR table when (view.origin==this):...
propagate managed when (view.origin==this);
propagate Employee when (view.origin!=this);
subscribe Employee:
represent RowR row:...
Now, the notification to a Manager object depends on whether this object is the view origin or not. If not, the notification is propagated to the parent class Employee, so that the Manager object itself is represented as a row.
Version 6.3
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.