-
Notifications
You must be signed in to change notification settings - Fork 1
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
Suggestion to employ HATEOAS for relationships if REST is the chosen API style #5
Comments
The OPC UA address space is like this. The relationships are metadata that is independent of the values. There is a separate Browse service that allows a client to request the relationships on a Element/Node. OPC UA also provides all of the mechanisms needed to model complex systems. Many of the implementers of this API will also have knowledge of OPC UA so I think it makes sense to borrow from OPC UA when it comes down to a choice between using something else that provides the same features but is different enough to create headaches for developers. |
@germanandy the Working Group would like to hear from a SME on this topic. Would you care to join us for a meeting, or can you recommend someone we could learn more from? |
Yes of course, happy to help. Let me know how we can connect and arrange
…On Tuesday, 11 February 2025, Jonathan Wise ***@***.***> wrote:
@germanandy <https://github.com/germanandy> the Working Group would like
to hear from a SME on this topic. Would you care to join us for a meeting,
or can you recommend someone we could learn more from?
—
Reply to this email directly, view it on GitHub
<#5 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATUNY4FOK5FGYCFZPB7AHS32PJ2Y5AVCNFSM6AAAAABRN5KT2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJSGIYDQNRVGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
____________________________________
Andy German
|
@germanandy sent you a message on LinkedIn, thanks! |
@germanandy and Niels Andersen from LNS invited for March 11 WG meeting as SMEs. |
The RFC visits the topic of Objects and their Relationships to each other in a number of places.
In the payload Metadata, the field 'ParentId' appears.
The inclusion of 'ParentId' in the metadata for the object payload indicates that the API design assumes it can arrive at a finite set of ideal relationships - parent/child in hierarchies and then ad-hoc relationships, etc.
This is a more involved problem than it first appears.
In a non-trivial object model, the relationships can become quite complex and hard to represent.
Hierarchies come in several different flavours:
There are more types but these are typical.
As the system grows in complexity the schema could be repeatedly modified to accommodate new relationships, resulting in overloading or misusing existing fields.
SUGGESTION IF USING REST AS THE API ARCHITECTURAL STYLE - Embed the relationships in the HATEOAS links.
HATEOAS Principle
This principle first appeared in Roy Fielding's original REST dissertation and it is underutilised but quite a neat fit here
https://en.wikipedia.org/wiki/REST
https://en.wikipedia.org/wiki/HATEOAS
Put the relationships in the links section via HATEOAS
Put the relationships in the links section and leave it dynamic, establish a few conventions about what kind of relationships could appear there. Note the MQTT subscribe link in the example below.
In this way you shift the responsibility of conveying relationships from the payload to the hypermedia controls within the RESTful response. This means that instead of embedding relationship identifiers directly in the data, you provide links that define how the current resource is related to others. This decouples the core data schema from its relationships, allowing each to evolve independently.
There are some downsides to this, mainly in the flexibility of the way the schema is expressed, but there may be more danger in trying to define relationships of objects inside the data model.
The text was updated successfully, but these errors were encountered: