<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>All,</p>
<p>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.<br>
</p>
<p>So a State Event is:<br>
</p>
<ul>
<li>Address -- which system state</li>
<li>Time occurred</li>
<li>New value, whose type depends on the particular Address.<br>
</li>
</ul>
<p>The Address is complex:</p>
<ul>
<li>Identifier (a numeric ID or enum would suffice)<br>
</li>
<li>Parameter(s), whose type depends on the particular identifier.<br>
</li>
</ul>
<p><br>
</p>
<p>The temptation is to use <b>any</b> for both the <i>Address
Parameter</i> and <i>State Event </i><i>New Value. </i>But
that bypasses type safety.</p>
<p>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.<br>
</p>
<p>And being able to define new Addresses, with minimal impact on
the mechanisms that handle all this, is pretty important too.<br>
</p>
<p>Anyone have any best practices?<br>
</p>
<p>Thanks in advance,</p>
<p>-Jim</p>
<p><br>
</p>
</body>
</html>