<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:11pt;font-family:Sans Serif">
<p><span style="color:#008000">&gt; and what's an &quot;AbstractEngine&quot;? shouldn't that be &quot;AbstractSensor&quot;? &quot;plasma</span></p>
<p><span style="color:#008000">&gt; engine&quot; is broader in concept that just Sensors. for instance, while we</span></p>
<p><span style="color:#008000">&gt; could provide a Sensor driven model for libtaskmanager, it would really be</span></p>
<p><span style="color:#008000">&gt; a &quot;round peg, square hole&quot; sort of deal.</span></p>
<p></p>
<p>Well, I think I should review it before send it :). I was playing with the diagram after the meetup, and I changed that for myself, but it wasn't meant to have the meaning of an Engine. Sorry for that.</p>
<p></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#007000">&gt; &gt; In this case, the only difference would be how Meters and Sensors are</span></p>
<p><span style="color:#007000">&gt; &gt; connected. Instead of calling a method in the Sensor for creating the</span></p>
<p><span style="color:#007000">&gt; &gt; connection, the Meter itself would create it.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; that would work, but IMHO not as well.the code path would be:</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt;         Sensor emits a signal</span></p>
<p><span style="color:#008000">&gt;         Meter requests the value for the Sensor</span></p>
<p><span style="color:#008000">&gt;         Sensor returns the requested value</span></p>
<p><span style="color:#008000">&gt;         Meter displays it</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; with visitor, you'd just get:</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt;         Sensor emits a signal with the value(s)</span></p>
<p><span style="color:#008000">&gt;         Meter displays it</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; if you wanted to keep the class dependency down to just &quot;Meter knows of</span></p>
<p><span style="color:#008000">&gt; Sensor&quot; then have Meter do the connecting of the Sensor signal to itself.</span></p>
<p><span style="color:#008000">&gt; or have a third class that does the connecting. i just don't see the need</span></p>
<p><span style="color:#008000">&gt; for the extra code paths that will be executed on _every update_ when we</span></p>
<p><span style="color:#008000">&gt; could simply do the &quot;right connection&quot; once per sensor/meter pair.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; furthermore, but letting the Sensor do the connecting, one doesn't have to</span></p>
<p><span style="color:#008000">&gt; expose any Sensor-specific API to Meter allowing for each Sensor to be as</span></p>
<p><span style="color:#008000">&gt; specialized as it feels the need for. and i suspect that Sensors will need</span></p>
<p><span style="color:#008000">&gt; more specialization than Meters will as Meters have a fairly well define</span></p>
<p><span style="color:#008000">&gt; purpose (show values to the user) while Sensors are far broader in scope.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p></p>
<p>Well, Observer pattern has two forms of implementation. That one, and other that is more similar to the &quot;Visitor's way&quot;, wich with every update sends all data. Choose what you prefer, I think that isn't the problem. The problem is more related with &quot;who connects with who&quot;, and that's what I tried to suggest, a different way for doing the connections. If you think the connections creator should be the Sensor, then I agree :)</p>
<p></p>
<p><span style="color:#007000">&gt; &gt; This way Sensors could be used</span></p>
<p><span style="color:#007000">&gt; &gt; with other elements different from Meters.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; sensors could still be used with elements other than meters. it would just</span></p>
<p><span style="color:#008000">&gt; be EASIER to use them with meters. however, one has to ask: how often will</span></p>
<p><span style="color:#008000">&gt; any sensor be used with something that isn't a meter? the answer will</span></p>
<p><span style="color:#008000">&gt; dictate how much that should influence the design. i'd look at superkaramba</span></p>
<p><span style="color:#008000">&gt; widgets, kicker applets, mac dashboard widgets, gdesklets and konfabulators</span></p>
<p><span style="color:#008000">&gt; for the answer.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; i really don't see the issue with saying &quot;meters and sensors know about</span></p>
<p><span style="color:#008000">&gt; each other&quot; and keeping the base classes for each very basic and simple. in</span></p>
<p><span style="color:#008000">&gt; fact, Sensor should be a QObject, Meter a QWidget. Sensor should only</span></p>
<p><span style="color:#008000">&gt; define the signal which carries a QVariant and perhaps the necessary</span></p>
<p><span style="color:#008000">&gt; infrastructure for the pattern used to connect Sensors and Meters; Meters</span></p>
<p><span style="color:#008000">&gt; should only have the means necessary to connect with Sensors and a standard</span></p>
<p><span style="color:#008000">&gt; (set of?) slots to accept the Sensor new value(s) signal.</span></p>
<p><span style="color:#008000">&gt;</span></p>
<p><span style="color:#008000">&gt; hell if you _really_ wanted to you could make Meter an interface only and</span></p>
<p><span style="color:#008000">&gt; require multiple inheritance (e.g. MyMeter : public QWidget, public</span></p>
<p><span style="color:#008000">&gt; Plasma:Meter) at which point a sensor could be used with &quot;anything&quot;.</span></p>
<p><span style="color:#008000">&gt; granted MI isn't the prettiest thing, but it may be just what the doc</span></p>
<p><span style="color:#008000">&gt; ordered here. my primary concern is scripting languages that don't allow</span></p>
<p><span style="color:#008000">&gt; for MI, such as Ruby. though Ruby could probably use mix ins instead to</span></p>
<p><span style="color:#008000">&gt; include the MyMeter interface. still, i'd be a bit concerned about</span></p>
<p><span style="color:#008000">&gt; requiring some sort of multiple inheritence / implementation scheme and not</span></p>
<p><span style="color:#008000">&gt; bother.</span></p>
<p></p>
<p>We thought meters as we know them in SK would disappear. For instance, in SK a text label is a Meter, and this could change in the future. That's why we decided to abstract that. </p>
<p></p>
<p>But anyway, you are right, it could be done using a sort of MI depending on the language.</p>
<p></p>
<p></p>
</body></html>