-
Notifications
You must be signed in to change notification settings - Fork 168
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
🚧 Model, structs, branches and the world #775
Comments
MoM: Please read/discuss, to be further discussed after AMM |
If you want to dig in the old branch discussion you can find quite a lot on subpages at https://github.com/COVESA/vehicle_signal_specification/wiki, see also https://covesa.github.io/vehicle_signal_specification/rule_set/data_entry/data_types_struct/index.html Some background VSS as of today has no real good mechanism to handle "struct-like data", data that always shall be handled as an atomic unit, like Lat/Lon for GPS position and possibly obstacle information (distance + direction + ...). We support arrays but only of primitive types, and we support instances for branches. I.e you can put Lat+Lon in a branch and hope that people shall update them as a pair, but it is difficult to represent something like "TenLastPositions" (array of 10 Lat/Lon pairs). Struct then came up as an alternative to offer reusable types. This is somewhat similar to reusable branches with
Concerning instance addressing like That you somewhere should have deployment info that says that you define an instance of |
Erik points to what I think is the main argument arguments for using structs, that it provides a solution to handle complex data as an atomic unit. This should in my view also be the only usage of it, it should not be used to define a group of assorted signals. As a general comment I think that when it comes to changes in the model (rule set) this is more likely to have a significant impact on downstream users than changes to the content of the tree. |
MoM: close it |
I was thinking recently a lot about structs and branches.
Especially about how they differ. In general I would say that structs are pretty much the same as branches but just a different tree entry point (Types). If we exchange
struct
withbranch
andproperty
with just a normal child having a datatype then we have the same as modelling it in the initial tree. Only difference like I said is having a separate Tree for it.Also in context of COVESA/vss-tools#405 I noticed that in terms of types there is no difference in modelling it as a struct or as a branch.
Essentially it leads to the fact that we could model everything using structs and multiple root elements in one or several yaml files. It then is just someting similar to a class diagram. In the same run we would get rid of needing for includes as well as instances. Two features that are often discussed. I did not think this completely until then end but I wanted to share my thoughts.
Here is an example model of some elements that just came into my mind.
The only downside I can see for now is that you cannot directly reference list elements (
Vehicle.Cabin.Door.Row1.PassengerSide
)Maybe this is the crucial point where VSS shines but I am not sure how much we gain with that.
Example:
Like I said, all definitions could be sharded across different files and all you need to know is the entrypoint. So an example cli call for this imaginary construct would be:
vspec export foo --model main.vspec --model cabin.vspec --model door.vspec --entry Vehicle
Of course the cli call could get quite long doing it like that but we could have just a config file for instance.
The question is if yaml is then still the right tool for the job. I think it goes into the same direction that has been discussed already a bit regarding modelling vss with GraphQL.
This would align quite well with programming languages where you can have roughly a file for each class. What we would have in the end is a language agnostic model of something. This would not be at all limited to Vehicle anymore (I know, the current solution also would work just fine with other root node names).
Anyway, I just wanted to share that thought as I myself struggled a bit with the struct/branch difference and when to apply what.
🥂
The text was updated successfully, but these errors were encountered: