We’re using Visual Paradigm with java language.
In our model, every object has a base class and implements interfaces (which also have base interface as well).
So the model looks like this:
BaseInterface —> InterfaceA ----> ClassA (realisation)
BaseClass ----> ClassA (generalisation) (class ClassA extends BaseClass implements InterfaceA)
1. Problem and Question
Right now I can only implement this model this way: BaseClass is part of the diagram, and every new Class in the model has a generalisation connection to the BaseClass. This gives a graphically ugly diagram, where every model object has a connection line to the Base class.
If I remove the BaseClass from the diagram, the connection lines dissapear, and the generalisation can be seen in the relation table correctly.
Questin: is it possible, to add Classes to the model, where a Class has generalisation to a base class, but that base class is NOT part of the specific diagram?
2. Problem and Question
With the model described above, I would like to define new pattern.
If I define a pattern where a class extends a base class I have two options:
Including the base class in the pattern definition:
This way when I create new classes based on this pattern, the pattern creates new base class every time.
(for examle BaseClass becomes BaseClass, BaseClass1, BaseClass2 etc.)
Excluding the base class from the pattern definition:
This way when I create new classes based on this pattern, the new classes doesn’t have generalisation relations at all.
Question: How can I define such a pattern, telling that every new class has to extend a (specific well defined) base class, and implement an interface which extends a (specific well defined) base interface?
Thank you in advance: