5.2 POWERTYPE-BASED METAMODELLING

A second alternative solution to the challenges of metamodelling discussed in Chapter 4 is the use of a powertype pattern [7; 10]. First introduced into object-oriented modelling by Odell [15], powertypes have often been considered as an advanced modelling technique. A powertype is defined as a type the instances of which are subtypes of another type (called the partitioned type). The relationship between these two types, from an intuitive point of view, can be described as being of a classificatory nature, although it can be argued that it carries instantiation semantics to a certain degree. In other words, powertype and partitioned type are related indirectly through the entities that are instances of the powertype and, at the same time, subtypes of the partitioned type (Figure 5.1), which means that these instances are, at the same time, both objects and classes, i.e. clabjects. Although UML mentions powertypes, it does not offer any notational support for the concept of an entity that is both an object and a class (a clabject). Consequently, here we represent such entities as an individual object and an individual class inside an ellipse (Figure 5.1). Such a visualization is not intended as a formal notational proposal but as a visual reminder that (within the ellipse) we have an entity that has both class (OakTree) and object (oaktree:TreeSpecies) characteristics. The actual instance (ot1:OakTree) is then an instance created directly from ...

Get Metamodelling for Software Engineering now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.