Changing the Metaclass of Subclasses

When you change the metaclass of a class, all of its subclasses will retain their previous metaclass. This ensures that you do not propagate changes when you do not want to. However, often you will want existing subclasses to have the same metaclass as their parents. Protégé provides an option to quickly change the metaclasses of all the classes subordinate to a given class. Note that you only have to do this once; by default, new classes use the metaclass of their direct superclass.

You can only change the metaclasses to match the metaclass of the selected class. If the selected class has :STANDARD-CLASS as its metaclass, all subclasses will lose any additional metaclass st

To do work with metaclasses, you must have added one or more metaclasses to your project, either by creating them directly, or by including a project that already has metaclasses. The screenshots in this section use the newspaper_extended project, which includes metaclass structure. You can use these structures in your own projects. See the tutorial for more information.  

To change the metaclass of all existing subclasses of a given class:

  1. In the Class Relationship Pane, find the class whose sublcasses you want to change. 
  2. Click the right mouse button and select "Change metaclass of subclasses." 
  3. A dialog box pops up for verification. Click OK to continue.
     
  4. The change is made and all subordinate classes now have the metaclass of the selected class.

Next: Slots Table of Contents

Classes Table of Contents