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
API, Components, and Interfaces - better definition required #114
Comments
Today our components do not use the concept of API, and we do not plan to move towards it because it would require to split all our components between .h and .c and it will be too many components in our opinion. So, based on this assumption, I think I need a way at component level to indicate the provided interface. Regarding the way to define an interface, my first thinking was to maybe split it in 2 parts:
If I take an example based on ST drivers. So, at the end we can offer "Synchronous_HAL" or "Synchronous_LL" and even "Syncrhonous_LL+Asynchronous_LL". These are only some "early" thinking to contribute to the spec, it needs to be refined. @mdortel-stm: I know we are still having internal discussions about it at ST so please feel free to disagree if needed :-) |
@fred-r I have slightly revised the text. For a component there are two options:
My intention was to make the relationship clearer. For
|
It is still very confusing to me... even when reading: https://github.com/Open-CMSIS-Pack/devtools/blob/main/tools/projmgr/docs/Manual/YML-Input-Format.md#interface To me, what is called interface here is "only" a service. So, to me, the only way to "require" such a service is to "consume" the very same string. Hence, I think it is confusing when we say that a require can be satisfied by 3 elements (very different string formats):
I also have a problem with the "scope" of the interfaces. To me, it is very likely that we will have some situation like: NXP board layerinterface: ST board layerinterface: But the APIs won't be the same though the strings are the same. To me we are not defining interfaces here but services. To me, an interface is an element that different entities will use to interact. Also, what is very confusing to me is this: ==> to me, this is not an interface. It does not allow two elements to interact, it is a system configuration parameter. The key/value pair is also unclear to me.
And this sounds not realistic to me: Typically, say that you declare FOTA support as a layer. But, maybe the application will maintain only 1 TLS link at a time, so no reason to add extra heap... |
@fred-r I agree that are still many things to solve, but we have to start somewhere. To an certain extend it only makes sense when we agree on compatible APIs. We have proposed IoT_Socket, PSA, and CMSIS-Driver APIs. Once they are consistently implemented, we would need to define the interface strings that describe them (and replace the user-defined with additional information). |
To be discussed with @iomint : if we stick to CMSIS-Driver APIs, I am not sure we can really leverage it as we will promote our ST APIs. |
If CMSIS-Driver APIs are not fit for purpose, we should discuss changing it. However without alignment on APIs code reuse from different SIPs will not work. But you could enable the system within ST and just use names like "ST UART" in the interface descriptions. |
Hi all, I am used to model application as dependency tree like this: From this model we can recognize only two entity types:
In my opinion, it is possible to define single data type (node) which would allow description of any node type currently recognized. Alternative approach would require modification of existing cmsis pack component and API data types and also migration of this data types into yml format (components can be only referenced, but cannot be defined in ymls currently). In theory it is possible to define just single data type, but it is not doable with backward compatibility and resource limitations in mind. I like the idea of single dependency space, where any kind of entity can require any kind of other existing data. On the other hand explicit types might help with communication of its role in the ecosystem. Type specific entities can be implemented as syntactic sugar on top of universal node entity which would be used by core engine. There is overlap between API, interface, and layer.
Note about explicit API in NXP: Note about system libraries: |
Hi @DavidJurajdaNXP, @ReinhardKeil , @jkrech and all. I agree with the concept presented by David: we do have "nodes" and "links" to materialize functional elements and their relations. Objective and Context I think the "interface" concept makes sense with the introduction of the new "nodes": layers.
Now, I think Reinhard's objective is to expose a "service" provided by these blocks, so that these blocks can be interconnected easily : this is the "link" in David's view. So to me:
Subdividing the interface concept I think the concept introduced by Reinhard may be sub-divided to be easier to understand. Basically, the "compound node" a.k.a. "layer" (or maybe a cproject also ?) can provide or consume services. Top level: layer name (the compound node)
Example If I think about a board "layer" it may be defined like this: ST Evaluation Board XXX
And another layer like this: IoT Middleware YYY Is it what you had in mind @ReinhardKeil ? |
I believe this is outdated. I leave it open until we demo'ed the layers. |
Closing as there is no further activity. |
During the discussion yesterday, I got the impression that we need a better definition of the differences between API, Components, and Interfaces as somewhat they related to each other. An Interface is actually more a SW interface (yes ultimately these connect to hardware peripherals at some point). Here is my first attempt of a definition:
API
An API is an interface template provided as header file. In a Pack an API is identified with the format
[Cvendor::] Cclass : Cgroup
that refers to header files. In a Pack the API itself does not have an implementation, but one or more Components can implement this functionality.Component
A Component is a set of files that implement a functionality. The component name serves also as interface descriptor. The component has these naming conventions.
A Component may be based on an API. In this case the API element provides the header files that defines the compnent interface.
For a Component that is not based on an API, the component the sharing of the API definition is not defined by the Open-CMSIS-Pack system, but implementation defined. It is recommended that the API header file is part of the component.
Interface
An Interface identifies an implementation of a functionality that is defined by an API (header files).
An Interface is referenced by:
An Interface is defined by:
The text was updated successfully, but these errors were encountered: