Extending Imported Classes

JADE does not permit you to subclass imported classes.

Where two class hierarchies require a tightly coupled, modular, subclassed relationship, use schema inheritance (allowing subclass relationships) instead of imported packages and take advantage of global instance visibility. Subschema copy methods, schema inheritance, and global instance visibility may be more appropriate for schema entity reuse than imported packages in some instances.

If you are a developer of importing schemas and you want to extend the state of imported classes, you can do so by using aggregation. This might involve creating a local class that references an imported class and defines additional state or if persistent instances of an imported class are not permitted, implement a local class that copies and makes imported class instances persistent in the importing schema.

This enables developers of exported packages control over the persistence of their classes, as follows.

You can add methods and constants to imported classes in the importing schema.