-
Notifications
You must be signed in to change notification settings - Fork 122
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
[Accepted] SDL 0073 - Adding Metadata Types #208
Comments
The idea of this change is small, but I believe its impact to be pretty large. The proposed method of adding metadata to a text field through a new struct is ok, but changing the parameter type in an RPC is something none of the projects have handled before. This would introduce a decent amount of workload creating the logic to ensure backwards compatibility and all the testing around it. This would be a breaking change so the RPC spec would have to be increased a major version. This goes back to the same discussion we had on #189. Our decision for that was as followed:
Using that decision as precedent I believe this proposal would fall under the same decision as #189 and we should have a clear proposal on how to handle breaking RPC changes before we accept any proposals that do so.
Reading through the alternatives there was another solution (5) of introducing a root level param for each text field, eg
Of all the alternatives I believe introducing a new RPC (3) might be the closest to acceptable for this feature. It would allow OEMs to control which apps can "broadcast" this type of data in the background. It would introduce a challenge of mapping the Overall, while the the initial changes look small, the impact is large. I don't believe this proposal adequately addresses the problem it's setting out to solve. The proposal itself would need to be revamped to reflect one of the other alternative solutions or wait until a new proposal is entered and accepted on breaking RPC changes. However, even then I don't believe any of the proposed methods are robust or complete enough; the proposal seems to be a compromise on how to solve a problem for a short term gain and not the long term solution. (Out of the container) I talked about adding "subscribable services" during the discussion around this feature at our first workshop that I still believe is the best way to solve this for the long term. Therefore, I don't believe we should accept this feature as-is or any other feature that isn't robust or complete enough for a long-term strategy. |
@joeygrover Thanks for the feedback. We had quite a bit of discussion ourselves on the exact points you mentioned before we arrived on the current proposal. There were a few reasons we arrived here:
Can you please clarify why this would be a decent amount of workload?
Please note this is not the "out of the container" proposal and is not intended to fully solve the problem of sharing information between apps or outside of the current behavior.
An HMI should not need "subscribable services" to get this type of data from the app but I agree that other apps should. Overall, we feel there are many ways to do this and if the SDLC agrees on a different or preferred method we will be happy to revise the proposal. |
Can you clarify if this is adding new parameters, or changing the existing ones? Both Joey and I read it as altering existing parameters. Adding new parametersIf it's adding new ones, it would be using the same names as the old ones. Not only do some languages (such as Objective-C) not support property (or method) overloading, but these messages are using JSON, and we can't have two keys with the same name! They would absolutely have to be named differently than the existing methods if you are adding new ones. Changing existing onesAny change to an existing parameter is, by definition, a major change. |
@joeljfischer Thank you for the information. I think the change we are suggesting is both.
We would only be adding a new optional parameter to the JSON element between SDL proxy and SDL Core. Currently, my understanding is the proxy is already translating the input string into the JSON format for text fields before sending to SDL Core: "showStrings" : [
{
"fieldName" : "mainField1",
"fieldText" : "Some text"
} Adding a new optional element "fieldType" : "none" to the above JSON structure should not be a major change and does not duplicate key names.
I assume you're referring to the semantic versioning definition from http://semver.org/. A minor change is defined as a "MINOR version when you add functionality in a backwards-compatible manner" and we would adhere to this.
This is obviously just one simple solution and there are many other more robust solutions like utilizing protocols. To be honest, we do not understand why the mobile API was designed differently in the first place and feel this is one step towards correcting this mistake and having a robust and expandable function. |
To build on Scott's comment, Objective-C does offer a fairly elegant solution to migrating this interface via Protocol/Functional Oriented Programming. Please find a simple implementation below. SDLMainFieldProtocol.h
NSString+SDLMainField.h
NSString+SDLMainField.m
SDLMainField.h
SDLMainField.m
ViewController.h
ViewController.m
Additionally we would want to tag the string compatibility interface (NSString+SDLMainField in this example) with XCode's deprecated tag, with an explanation to implementers that it will be phased out in the next major release (or whenever we decide to deprecate it completely). I believe this is a sane way to begin migration of the interface without introducing a breaking change. The app developer's would not notice any difference in the interface, besides our deprecation warning. I believe Android could support a similar or equivalent solution. I can provide the entire XCode project I used to rough this out, if Livio would like to further review it. |
I will be the first to grant that the mobile API was designed poorly to begin with, but we have to now work with what we have and we can't break backward compatibility without doing so intentionally. I'm convinced that this proposal does make major version changes, unless I'm fundamentally misreading or misunderstanding something. I'm not sure what this is meant to convey:
There does not seem to be any such field as If we're talking about the The existing JSON would look like this: {
"mainField1": "Some string",
"mainField2": "Some other string"
} Your proposal would change it to this: {
"mainField1": {
"fieldName": "mainField1",
"fieldText": "Some String",
"fieldType": "mediaTitle"
}
} Let me know if I'm misreading this, but this is absolutely a breaking change. We are modifying an API, which is a backward incompatible change. Even if we work around it in the libraries for older head units, that would break people's code, and be a major change in the libraries. Plus then we also have to account for head units connecting to older libraries. You provide the following pseudocode:
However I'm failing to see the parallels here. @Toyota-BSalahat |
@joeljfischer The code I posted was an example of how this could be done specifically without breaking the Proxy API (which is what integrations care about). SDLMainField is not currently in the proxy, but is an example of what could be added. As I stated, I can send you the XCode project for you to review if it is not clear from reading the code snippets in my previous comment. |
@toyota-bsalahat I think I'd need a slightly larger example with real types to understand what you're trying to do here. I get the code, but I'm not sure how it fits with what we're talking about. In any case, the API isn't in the library, it's in the XML. Versioning an API is pretty easy: if you remove or alter an existing API (outside of adding optional parameters), it's a major change. If you add a new API, alter an existing API by adding optional parameters, or deprecate an existing API, it's a minor change. This alters the type of existing APIs, therefore it is a major version change. Whether or not we can find hacks and workarounds in the libraries is immaterial to that discussion. Now, if we can find workarounds in the libraries, that is helpful, but I haven't seen how that could happen without some serious abstractions. We have never fundamentally altered the type of an existing API, and we'd need some hard guidelines of how that's to be done. |
@joeljfischer can I email you the existing example? I think it will make sense to you if you look at it. It is a basic implementation utilizing protocol oriented programming and iOS categories. I could carry these changes into the iOS proxy to show you, but I do not think it will aid in your understanding of the example, and would take some time. I think we have two threads going about the XML changes, and the actual Proxy changes to support it. My example is a demonstration of how we could migrate the Proxy interface without breaking it, or affecting current implementations. Additionally, I could schedule a call today and we could talk through my example if that would be helpful. |
@toyota-bsalahat I sent you a slack message. |
@joeljfischer I'm sorry, I think maybe there is some misunderstanding of my comment.
That's because this is the field received by SDL Core and passed to the HMI and is not the mobile API. {
"id" : 147,
"jsonrpc" : "2.0",
"method" : "UI.Show",
"params" : {
"appID" : 123456789,
"graphic" : {
"imageType" : "DYNAMIC",
"value" : "/000000002_a52c74c247dbae82164a73117e278a5f2b91fbe9b7caeed4429f120f81da686f/possibilities.jpg"
},
"showStrings" : [
{
"fieldName" : "mainField1",
"fieldText" : "Some text"
},
{
"fieldName" : "mainField2",
"fieldText" : "Some text"
},
{
"fieldName" : "mainField3",
"fieldText" : "Some text"
},
{
"fieldName" : "mainField4",
"fieldText" : "Some text"
},
{
"fieldName" : "mediaTrack",
"fieldText" : "Some text"
}
], Therefore, the only new parameter we are suggesting to add is to the text field struct which would turn each of those elements to the following: {
"fieldName" : "mainField1",
"fieldText" : "Some text",
"fieldType" : "none"
} So, at some point the "string" get translated to this proper textfield type.
We have seen multiple proposals deferred for similar reasons (Joey mentioned #189). |
@Toyota-Sbetts I don't think the HMI_API alterations concern us too much unless @joeygrover has any feedback on that. It's the MOBILE_API changes that concern us. I believe the proposal you referenced is the only one which was discussed in this capacity until now. I believe the SDLC as a group would have to define these guidelines. Livio would be willing to help do so. The reason we haven't yet defined such guidelines is that there have not been any proposals that have been desired enough by the SDLC to make a breaking change. |
@joeljfischer I think I understand where there is misunderstanding. Currently SDL Core is translating the Mobile API to the HMI API. Our understanding was that Mobile API defined the app to proxy interface and not the proxy to core interface.
And translates it to the HMI API:
I feel this leaves us with some options:
Overall, it's likely that we will need to revise the implementation details in this proposal but overall we still think the purpose of this proposal and it's general solution is valid.
I'm not sure this is how we should go about this. Edit: Updated comment based on misunderstanding of Mobile API. |
I think option 3 is doable, it's...inelegant, but finding an elegant solution may not be possible.
The proxy is the application to proxy interface. Or, more precisely, the proxy is an abstracted interface for the application to commuicate with Core. |
@joeljfischer Thanks for you feedback, I think we're more or less getting on the same page now. We agree option 3 is not the most elegant solution but without making a breaking change it may be the best way. As I mentioned, we expected discussion on which is the best way to handle adding these parameters because there is no one clear answer and we'll revise the proposal as necessary based on the SDLC's preferred method.
What I mean is does a defined specification for the abstracted interface exist or should this interface match the MOBILE_API 1:1 or is it up to each individual proxy? |
Given the discussion that has taken place on this issue, the Steering Committee has voted to defer this proposal and hold a separate workshop to determine appropriate revisions. The workshop will take place on July 10, 2017 (2017-07-10), so voting on this issue will take place after that date. |
This proposal has been revised to include the feedback received during the July 10, 2017 workshop. It is now in review until July 18, 2017 (2017-07-18). |
I believe this proposal should be accepted. |
Now that the requested revisions have been incorporated, the Steering Committee has agreed to accept this proposal. |
Hello SDL community,
The review of the revised proposal "SDL 0073 - Adding Metadata Types" begins now and runs through July 18, 2017. The original review of "Adding Metadata Types" occurred June 27 through July 5, 2017. The proposal is available here:
https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0073-Adding-Metadata-Types.md
Reviews are an important part of the SDL evolution process. All reviews should be sent to the associated Github issue at:
#208
What goes into a review?
The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of SDL. When writing your review, here are some questions you might want to answer in your review:
Please state explicitly whether you believe that the proposal should be accepted into SDL.
More information about the SDL evolution process is available at
https://github.com/smartdevicelink/sdl_evolution/blob/master/process.md
Thank you,
Theresa Lech
Program Manager - Livio
[email protected]
The text was updated successfully, but these errors were encountered: