Hi, I'm looking for best practices in driver development. I have heard several opinions about whether in a new protocol I should add a "retrieved" column to a SNMP table (maybe saving some memory and computational power), or whether the SNMP table should be copied to an all "retrieved" table making it more "future proof" (in terms of version control) at the cost of memory.
What is your opinion regarding to this?
Retrieved columns are only required in SNMP tables when some of the data polled via SNMP needs to be parsed or processed in a QAction. As long as this is not the case, you should not add any retrieved columns.
Having a fully "retrieved" table based on SNMP data can be done if you for example want to combine multiple SNMP tables in a single table in your protocol.
I don’t see any reason why we would still not go for the first option in this case by adding retrieved column(s) directly to the SNMP table. Interested to know though what the benefit would be of creating a completely retrieved table for this.
For an initial development of the table the way to go is to have the snmp table with the retrieved column added to it. If you ever need to add extra snmp columns to the table then you could have problems if you leave it like that (retrieved columns between snmp columns) and moving the retrieved column with one position breaks the range version compatibility, in that case the snmp table needs to be polled as a hidden table, the old table needs to be changed into a full retrieved table (so PIDs don’t change) and then the snmp columns need to be copied over there.
To summarize:
-Adding new snmp table = display snmp table with retieved column
-Adding extra snmp column(s) afterwards = displayed table becomes fully retrieved, snmp table is now polled hidden and values need to be copied to the displayed table, this to keep version range compatibility but will come at a performance cost
The question is not if the snmp table needs or not the retrieved column, that’s a fact, it needs.
The question is:
– Is better to add a retrieved column the snmp table or if it’s better duplicate the entire table into a retrieved one (all snmp columns plus the new column).
Before we used to go for the first option, but apparently now there’s some different approaches.