Closed AlexProudfoot closed 3 years ago
This is easily avoided by reconsidering the naming of the child classes, in this case I renamed Off_Duty_Controller to On_Break_Controller. On the other hand, an implementation restriction on the naming of classes in an “Analysis Model” seems wrong.
A problem is that the abbreviations are visible in the generated code. You’ve seen the problem in generalizations. Also, in the Library
example, the association Authorship
(generated in Library.Authorship
) contains
function Wrote
(BK : Book.Handle)
return Borrower.Handle;
function Was_Written_By
(A_Borrower : Borrower.Handle)
return Book.Vectors.Vector;
where BK
is the abbreviation for Book
(an undocumented demo of «abbreviation»), A_Borrower
is the "abbreviation" for Borrower
.
Thinking about generalizations, I’m not at all sure that the named components in the _Child
record are needed. Maybe something to do with multiple inheritance?
Anyway, I’ll see whether I can at least warn that there’s a potential abbreviation conflict in the model.
Not sure that "analysis model" is an apt description of the sort of model we have here! There’s a lot of translation-related decoration needed ...
Code in development (not yet committed/pushed) would give, with your model,
Processing /Users/simon/coldframe/coldframeout/Air_Traffic_Control.rr
checking domain Air_Traffic_Control
Warning: duplicate abbreviation "ODC"
... class "Off_Duty_Controller"
... class "On_Duty_Controller"
One warning.
I think that would be helpful. In the meantime, I've reverted to the original naming with an abbreviation tag on Off Duty Controller. Air_Traffic_Control.uml.zip
On naming the type of model, would "ColdFrame Specification Model" be nearer the mark? Have you settled on a name?
Have you settled on a name?
Never really thought I needed one!
Invalid Ada is generated for the following model.
The problematic output is as follows.
So, the undocumented restriction is that we can't have child class names that abbreviate to the same text, ODC in this case.