This is my interpretation of the specs:
The custom definitions must be extensions of the definitions in the spec. I.e. no breaking changes. So a client that can handle the specifications should be able to handle your specific payloads, as far as generic behaviour goes, without knowing your definition.
TMF630 says that an extended definition should include a link to the definition, see TMF630 part 2, which gives the example:
"@type": "Equipment",
"@baseType": "PhysicalResource",
"@schemaLocation": "//server:port/resourceInventoryManagement/schema/Equipment.yml", <-- I think your definition goes here
I would think the client has some definition resolver that will lookup the schemaLocation to down load the definition if not already cached.
That is your hook into customised behaviour. How that behaviour is realised is an exercise for the (virtual) whiteboard and water cooler.
------------------------------
Alasdair MacLeod
BT Group plc
------------------------------
Original Message:
Sent: Feb 09, 2021 08:12
From: Paul Stanek
Subject: Extension Pattern - changing schema during runtime
Hi,
Thanks, Jonathan for your interest. I will try to be more specific.
Let's say that we have an Equipment entity from TMF SID specification. And we using Resource Inventory Management API for maintaining this entity. Equipment inherits from Physical Resource. Next, this Physical Resource inherits from Resource. All this hierarchy and Entities are all known so we hardcode this in our systems and exposed it via API schema definitions (YAML file). But during using our Resource Inventory Application we are giving user possibility to crate own entities. So for example he creates a new Entity: Equipment Type1 which inherit from the entity Equipment. And new attributes are added to Equipment Type 1. How we should expose this new entity during runtime. Should we change the schema definition? And can we assume that client who uses our API is obligated to refresh schema on every request?
------------------------------
Paul Stanek
TO BE VERIFIED
Original Message:
Sent: Feb 08, 2021 07:50
From: Jonathan Goldberg
Subject: Extension Pattern - changing schema during runtime
Hi Paul
A bit difficult to answer this question without more details. If you can do so without exposing sensitive IP, perhaps you could give the community a concrete example of the problem area you are dealing with (ideally with real business names and not ClassA, EntityB, etc.). That way you've a better chance of getting some advice and feedback.
------------------------------
Jonathan Goldberg
Amdocs Management Limited
Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
Original Message:
Sent: Feb 08, 2021 04:41
From: Paul Stanek
Subject: Extension Pattern - changing schema during runtime
Hello,
I have a question about changing schema during runtime. In our system, we have the possibility of adding new classes and attributes (and extending existing classes as well). According to this, we assume that we should change schema during runtime. So we can assume that the API client should always grab schema definition on every request before he processes returned object data?
------------------------------
Paul Stanek
TO BE VERIFIED
------------------------------