osate / osate2

Open Source AADL2 Tool Environment
http://osate.org
Eclipse Public License 2.0
36 stars 8 forks source link

Enhancement Request: Property Reference Search Path #760

Closed smithdtyler closed 6 years ago

smithdtyler commented 7 years ago

OSATE currently generates AADL instance files that contain absolute paths to referenced .aadl sources, e.g.,

<componentInstance name="p1" category="process">
    <ownedPropertyAssociation xsi:type="instance:PropertyAssociationInstance">
      <property href="../../Plugin_Resources/Predeclared_Property_Sets/Deployment_Properties.aadl#Deployment_Properties.Actual_Processor_Binding"/>

This hinders the portability of the instance files and makes the workspace much more brittle, especially in circumstances where custom properties have been added.

A preferable approach would be to follow the conventions of Java and Python by allowing a "search path" analogous to Java's classpath or Python's PYTHON_PATH that is searched for referenced content.

There are several cases where this approach is useful:

  1. Preventing Analysis Errors. If the user has a custom property set, instantiates a model using that set, then renames a directory containing their custom property set, their instance file will become invalid and tools that operation on it will not function as expected (properties will be missing). A managed search path would allow workspace re-organization without the need to re-create instance files.

  2. Sharing instance files. In cases where instantiating a model is a costly operation (e.g., a model with multiple modes), users will be able to share an instance file without ensuring that their systems are organized in an identical manner.

  3. Overloading and Overriding properties. In Java, tools like Spring and Java EE allow injection of properties without recompiling. By making property references dynamic (via a search path) OSATE will be able to support swapping one property set or referenced file for another.

lwrage commented 7 years ago

We use EMF to create and write out the xml files. EMF does not support a search path to resolve cross references. Adding such a feature to EMF would likely take significant effort.

lwrage commented 7 years ago

We may revisit this issue when we develop command line tools to instantiate and analyze AADL models.