views:

287

answers:

2

It's not a real programming (coding) problem, sorry for that (but design comes first). But anyway I don't understand whats the difference between disjoint and overlapping, it occured in several books, has a relation to OCL which is considered to be part of UML but the lastest OCL specification by OMG does no longer mention these terms, therefore it appears somewhat diffuse to me. I would greatly appreciate if someone could clearify whats behind this. Is it simply multiple inherintance of the same superclass?

+1  A: 

It is covered in the current 2.2 superstructure specification, on page 76 (printed page), section 7.3.21, quotes below. It has to do with rules of generalization and set theory. You can search the web for sub-type and disjoint and read non-UML examples, they should apply. Although Figure 7.4 8 looks helpful and is in the examples starting on page 78. Ok, I read the examples in the spec, they nail it down, but with pictures so I cannot easily copy those.

Text from one example: {complete, disjoint}

Because this GeneralizationSet is partitioned (i.e., is constrained to be complete and disjoint), each instance of Person must either be a Female Person or a Male Person; that is, it must be one or the other and not both.

http://www.omg.org/spec/UML/2.2/Superstructure/PDF/

The spec lays out all the combinations.

Ted Johnson
+1  A: 

Imagine that a superclass A has two subclasses B and C.

We say that the inheritance relationship between A, B and C is disjoint when A instances cannot be at the same time B instances and C instances (i.e. instances of a supertype only appear at most in a subclass). Otherwise, we say the inheritance set is overlapping

By default, implementation of inheritance in OO languages is disjoint.

Jordi Cabot

related questions