Thank you very much.<br>I think simple POJOs will answer our needs.<br><br>-- <br>Guillaume<br><br><div><span class="gmail_quote">2007/9/12, Todd Wright <<a href="mailto:twright@bbn.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
twright@bbn.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Guillaume Liegard wrote:<br>> Hello,<br>><br>> I am making a tool to monitor process activities of a host. So I want to<br>> publish a representation of each process on the blackboard and update<br>> them on a regular basis.
<br>><br>> My problem is to choose the best kind of objet to represent each process<br>> on the blackboard.<br>><br>> 1. Can I use assets as they don't seem to be modifiable and I don't want<br>> to create new objects everytime (garbage collector)?
<br><br>The PropertyGroups attached to an asset are modifiable; you don't have to<br>create a new object every time you modify an asset.<br><br>Assets are likely more complicated than what you require.<br><br>><br>
> 2. What exactly are Change Reports? Can I use them in this case?<br><br>When a plugin calls "publishChange", it can optionally specify a set of<br>ChangeReports to note what has changed (e.g. "changed field X"). Other plugins
<br>will see these ChangeReports in their subscription change lists. These<br>ChangeReports are transient -- they are discarded once all plugin subscriptions<br>have been notified. For details, see Cougaar Developers' Guide section
<a href="http://3.2.4.4" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">3.2.4.4</a>.<br><br>You can't use ChangeReports by themselves to implement your blackboard objects.<br> However, you might want to use ChangeReports with your blackboard objects to
<br>indicate what has changed, assuming that a subscriber plugin is interested in
<br>these details. You can use ChangeReports with any type of blackboard object.<br><br>><br>> I have seen the method blackboard.publishChange(Object, Collection); but<br>> I don't know how to get back the change reports (when other plugins have
<br>> suscribed to this object).<br><br>Use "subscription.getChangeReports(Object)", e.g.:<br> for (Object o : sub.getChangedCollection()) {<br> Set s = sub.getChangeReports(o);<br> ...<br> }<br>
<br>><br>> 3. Are FrameSets a good way to deal with simple problems like that?<br>> Following a previous mail, I had a look at FrameSets. The mechanism<br>> seems very complex for such a simple problem.<br><br>
FrameSets are intended for this type of "system" data representation. However,<br>I agree that they are difficult to use. We need a simple FrameSet tutorial.<br><br>For your simple example, you don't need to use FrameSets. It might be nice
<br>someday.<br><br>><br>> 4. Aren't POJOs a good solution for this simple problem?<br><br>Yes.<br><br>Make sure that the "equals" and "hashCode" methods are correctly defined and<br>not based on modifiable fields. The Java default Object-based "equals" and
<br>"hashCode" methods are fine.<br><br>Or, consider implementing UniqueObject by subclassing:<br><a href="http://cougaar.org/cgi-bin/viewcvs.cgi/core/src/org/cougaar/core/util/UniqueObjectBase.java?rev=1.2&cvsroot=core&content-type=text/vnd.viewcvs-markup" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://cougaar.org/cgi-bin/viewcvs.cgi/core/src/org/cougaar/core/util/UniqueObjectBase.java?rev=1.2&cvsroot=core&content-type=text/vnd.viewcvs-markup</a><br>Get the UID from the UIDService "nextUID()" method. The benefit of
<br>implementing UniqueObject is that this will make your objects visible in the<br>"/tasks" servlet.<br><br>> What are the<br>> drawbacks?<br><br>You'll miss out on some of the more complex features supported by Assets and
<br>FrameSets.<br><br>Todd<br><br>><br>> Thanks you very much for your advises.<br>><br>> Best regards.<br>><br>> --<br>> Guillaume Liégard<br>><br>><br>> ------------------------------------------------------------------------
<br>><br>> _______________________________________________<br>> Cougaar-developers mailing list<br>> <a href="mailto:Cougaar-developers@cougaar.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Cougaar-developers@cougaar.org</a><br>> <a href="http://cougaar.org/mailman/listinfo/cougaar-developers" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://cougaar.org/mailman/listinfo/cougaar-developers</a><br></blockquote></div><br>