[omniORB] Interface design best practice, as I'm tempted to use any

Jim Bell Jim at JC-Bell.com
Fri Jun 5 16:46:11 UTC 2020


All,

I'm designing a new interface that will conceptually deal with system 
state events. A state changes and you send it around, or you query 
something for its states and it tells you their current values, with a 
single mechanism doing things like aggregation, logging and such.

So a State Event is:

  * Address -- which system state
  * Time occurred
  * New value, whose type depends on the particular Address.

The Address is complex:

  * Identifier (a numeric ID or enum would suffice)
  * Parameter(s), whose type depends on the particular identifier.


The temptation is to use *any* for both the /Address Parameter/ and 
/State Event //New Value. /But that bypasses type safety.

Defining a different event message for each different Parameter/New 
Value type keeps interface type safety, but doesn't seem optimized for 
uniform handling of events.

And being able to define new Addresses, with minimal impact on the 
mechanisms that handle all this, is pretty important too.

Anyone have any best practices?

Thanks in advance,

-Jim


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.omniorb-support.com/pipermail/omniorb-list/attachments/20200605/a2fbdb8e/attachment.html>


More information about the omniORB-list mailing list