Allows multiple objects to be notified and updated when another object's
state changes. An alternate Observer profile
is also available.
More info
Profile download (Rational Rose model)
context Observer inv: self.treeTop implies (self.isAbstract and self.sOO->size() = 1 and self.oSO->size() = 0 and self.observerState->size() = 0) inv: self.isAbstract implies (self.specialization->size() > 0 and self.specialization->forAll (c | c.child.oclIsKindOf (Observer))) inv: not self.isAbstract implies (self.oSO->size() = 1 and self.sOO->size() = 0 and self.observerState->size() > 0) context ObservedSubject inv: self.treeTop implies (self.isAbstract and self.sOS->size() = 1 and self.oSS->size() = 0 and self.attachOp->size() > 0 and self.detachOp->size() > 0 and self.notifyOp->size() > 0 and self.subjectState->size() = 0) inv: not self.treeTop implies (self.getStateOp->size() > 0 and self.setStateOp->size() > 0) inv: self.isAbstract implies (self.specialization->size() > 0 and self.specialization->forAll (c | c.child.oclIsKindOf (ObservedSubject))) inv: not self.isAbstract implies (self.oSS->size() > 0 and self.sOS->size() = 0 and self.subjectState->size() > 0) context aSubjectObserver inv: self.sOO.isNavigable and not self.sOS.isNavigable context aObserverSubject inv: self.oSS.isNavigable and not self.oSO.isNavigable
The incorrect instance is the correct instance diagram for the alternate Observer profile which does not have a class hierarchy for Observer. Each class has a 'B' appended to the names to avoid namespace conflicts. Since the tool terminates on graphical constraint errors without checking OCL constraints, the tool will report that the tag value treeTop for DigitalClockB is missing because in the alternate profile, the tag definition is not necessary and hence not present. Therefore, we provide an arbitrary tag value ("false" in this case) so we can see which OCL constraints are violated by this instance class diagram.