-
Notifications
You must be signed in to change notification settings - Fork 2
Official definitions of common terms #7
Comments
Attribute needs not only the property, but the API "tree" to get there. For example, Not sure I like the term "Component" for the POJO container. While the interfaces can be names of (physical) components, I am leaning toward (in OSHI 4) the POJO containers being called *Data. The Interfaces will be the API and should be the simple component names, rather than the "Index". |
I stumbled over this issue myself while trying to give the explanation of how layers should work in #2 and #3 Just like in those issues, I have a more nuanced structure for the components in my head. I'll draw a quick diagram and share it later today.
|
This chart would correspond to the higher level API I was proposing. If we also want a lower level API closer to the drivers, we can have a second set of Components that may, or not, have a caching layer, and work in a straight coupling with the Strategies |
This comment has been minimized.
This comment has been minimized.
In that case, we're talking about building a whole second API. And no, the drivers don't have to implement anything you don't need them to implement. Their job is only to fetch the values. If you want timestamps, that would go wherever you're handling caching of the values. Those are all high level concerns that should never fall in the lower layers. For example, change events require some kind of threading model that will keep a constant/periodical check on the values of the system to allow you to know if something's changed. This means implementing at least a single thread that goes through a full list of every single value of interest, requesting the drivers for the latest value (irregardless of the cache state), and comparing it to the cached values to see if an event must be triggered. Timestamps are a bit easier: the caching solution already implements timestamps for the cached values, so you just need to keep the full cache record when requesting values, instead of just the value itself Finally, OSHI, in general, doesn't work that way. The correct thing for such a use case would be for the user to write some |
Not saying the use cases aren't there, or interesting, just that we should focus on designing and implementing OSHI here, and leaving any high level functionalities to a separate module. The problem with adding extra functionalities is that we start clashing with the try to be more performant part of the OSHI design. What we can do, is build each layer of the library as a separate module (or set of modules). For example, a module with the Win Drivers, one for the Mac Drivers, one for Components, etc. That way, adding a module with the functionality you want would be as easy as adding another module to the OSHI catalog, that depends on the Strategy/Driver level modules, and works as a standalone from the standard OSHI library |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sorry for completely derailing this. I'll make an issue for the driver state thing and hide the tangential comments to get back on track since this is a very important issue. I'm curious as to what @dbwiddis thinks about your terms. The only two that bother me are strategy and entity. Strategy is just a specialized driver, so that's why I've been saying driver and generic driver. Also, strategy doesn't really suit the concept in my opinion. |
No problem. We're here to design all this, so any issue is welcome, I guess. I used Entity and Strategy because they're the more common pattern names for what I was thinking. I'll welcome any name that might be better. In the case of Strategies, my idea would be that on OSHI3 we have multiple ways of recovering a value from the system, and we need to be able to use them. For example, recovering some random system detail from Windows might trigger a request to WMIC, if that fails, we'll ask another Windows API, if that fails, we'll check the Register, and if that fails, we'll ask some file in the system folder. For such a case, we'd actually have 4 different drivers involved there:
As such, the Strategy object would handle the flow between drivers depending on their priority, raise/throw the errors as needed, check the config for disabled drivers, etc |
Don't give me any special consideration! You're the professionals! That said... Result -- Agreed, we need Value (or null/NaN/flag for failure), Error details, and also a Timestamp. Entity/Endpoint -- don't understand the example Strategy -- ok. I prefer "Fallback Logic" Driver -- ok. Should think about a generic "text column parsing" utility that we can use for a lot of the command line stuff that returns outputs in delimited columns, which is essentially like a "database query" equivalent. Value -- not sure I like Enum, just return the string name for it. We expect Values to be eventually represented in JSON so generally need to follow that spec (numeric, string, arrays). Need a way to represent unsigned long (BigInteger). |
Since we're being all official with definitions let me make sure this one's clear. Windows Management Instrumentation (WMI) is the infrastructure that gives us access to a lot of data on Windows. Component Object Model (COM) is the API available to us in C (or Java via JNA) to query WMI via WMI Query Language (SQL). WMI command-line (WMIC) is a command line utility with its own syntax similar to, but unique from WQL. Early versions of OSHI used the |
We need to agree on some common definitions to make it easier to discuss design and write documentation. I propose the following initial set:
guid
,vendor
,name
Cpu
,Gpu
, ...CpuIndex
,GpuIndexWindows
The text was updated successfully, but these errors were encountered: