Box 8. Support of reusable associations in the existing OO languages.
The important question is what features we would have to add to the existing OO languages
in order to support reusable associations. This is one of the issues also discussed in document
Soukup J., Soukup M.: Reusable Associations .
It seems to us that the following features would be required:
(a) In addition to types or integers, to allow templates (or generics) to parametrize member names. For example:
template<class A, name abc> class MyClass {
A abc;
...
};
(b) To introduce new keywords association and participants. Keyword association would declare an association, retrieve its
pieces from the library and insert them transparently into the association classes:
class Student;
class Course;
class Takes {
int mark;
int attendance;
};
association ManyToMany<Student,Takes,Course> studentCourse;
Keyword participants would describe the role of classes which implement the association
inside the library.
The obvious way to implement part (b) would be to add our code generator to an
existing C++ or Java compiler, but there may be some better way. We have been
contemplating about this, but have not done any work and are looking for people
interested in this part of the project.
Box 9. Impact on MDA and existing UML tools.
Since there would be a one-to-one correspondence between associations in
the UML diagram and their declarations in the code, the currently used code and UML generators
would be reduced to trivial programs matching the two sets.
The declarations of associations, especially if placed together as a block of
of code, could be used as a textual form of the UML diagram, eliminating altogether the need
for using the UML class diagram, at least on small and medium sized projects.
Jiri has been comfortably working in this mode for over a decade.
Using the database terminology, you can think about this block of declarations as being
a schema of the data organization. This schema would control the implementation and, at the same
time, would give us a compact information about it, in a form we can easily find and read.
For those who still want to see a graphical
representation, with every compilation, we can easily generate the UML class diagram
from this schema as it is done in the IN_CODE libraries.
This is really turning the existing MDA inside out. Instead of controlling the data
structure by the UML diagram, the data structure is controlled from within the code
-- by the schema. The UML diagram is automatically generated and is
only an auxilliary entity, a help for the programmer. It is never edited in the
graphical environment -- the only way you can change is is to add, remove, or
modify the declarations of the associations (or the inheritance among classes).
This is not only faster and safer, but may lead to a superior graphical representation.
As explained in the postion paper for the ATEM workshop 2007
Soukup M., Soukup J.: Graphical Tools and Language Evolution, model driven design isn't really about pictures but
about using models in programming.
All these ideas may appear rather strange to those who are used to the existing MDD
-- it is indeed a change of paradigm, and we anticipate
a lively discussion on this topic.
Box 10. Will we go back to textual programming?
This is the main subject of this workshop, and the answer will depend on our discussion
of boxes 4,8,9, and 13.
Box 11. Does this apply to distributed computing?
This is another important area which we would like to explore.
Box 12. UML isn't just class diagrams.
Beside the most commonly used static view (class diagram), UML provides many other views
of the design: Use Case View, State Machine View, Activity View, Interaction View, Physical View,
and Model Management View. Even if the new paradigm would eliminate the need for class diagrams,
the management of other views could be a sufficient reason for
using the UML in its present style. Or is it?
Box 13. Can you imagine textual representation for other UML diagrams?
We should discuss, specifically for each of the UML views
(1) what would be the impact (or improvement)
if associations become first class entities and are available in a reusable form
(2) what additional members and/or methods representing the associations would
have to include in order to substitute for (or replace) that particular UML view.
|