New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Superfluous multiple inheritance in Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape #845
Comments
Comment by otter on 9 Dec 2012 15:57 UTC
I agree that this multiple inheritance is not nice and might give complications to tools. It is fine for me to remove this, and make the approach a bit less safe, but simpler. The Modelica language group should decide. Changed the owner to Hans. |
Comment by hansolsson on 7 Jan 2013 08:47 UTC ModelicaServices can be implemented in other ways - one possibility is to make ModelicaServices self-contained (by duplicating - not inherting PartialModelicaServices). That allows e.g. MSL 3.2.1 to use ModelicaServices 3.2.2. The multiple inheritance will detect if there is any error in this duplication. Thus I think it is fine to keep it as it is. |
Comment by hansolsson on 7 Jan 2013 09:33 UTC If a tool really needs simplifications it seems it could be done using a tool-specific implementation of ModelicaServices. Closing since it will not be possible to discuss at a design meeting before the dead-line (since the first one is in march). |
Comment by anonymous on 7 Jan 2013 16:00 UTC Actually, if |
Comment by hansolsson on 8 Jan 2013 16:02 UTC The Modelica Specification does (in 3.3 this is in section 7.1) state that an element may be inherited twice without any problem: "Be exactly identical to any element of the flattened enclosing class with the same name and the same level of protection (public or protected) and same contents. In this case, the first element in order (can be either inherited or local) is kept. It is recommended to give a warning for this case; unless it can be guaranteed that the identical contents will behave in the same way." So the semantics are given; except for the possible warning - and the tool should be able to avoid that for their own ModelicaServices implementation. |
Comment by anonymous on 9 Jan 2013 10:37 UTC |
Comment by sjoelund.se on 9 Jan 2013 11:04 UTC |
Comment by hansolsson on 9 Jan 2013 11:07 UTC
As Sjoelund wrote: All of them; "be exactly identical" gives a clear idea of the intent. However, I believe there have been other trac-tickets on this though, the problem is that two declarations that are character-by-character-identical may behave differently semantically. That's the reason for the recommended warning; but a tool should be able to control that for their own libraries. |
Reported by anonymous on 1 Oct 2012 12:04 UTC
Model
Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape
extends bothModelicaServices.Animation.Shape
andModelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape
whereModelicaServices.Animation.Shape
itself extendsModelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape
(in the default or Dymola implementation of Modelica Services). In this case there is no need thatModelica.Mechanics.MultiBody.Visualizers.Advanced.Shape
extendsModelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape
. It is all done inModelicaServices.Animation.Shape
.Migrated-From: https://trac.modelica.org/Modelica/ticket/845
The text was updated successfully, but these errors were encountered: