<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Comments inline,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thomas<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> rules-dev-bounces@lists.jboss.org [mailto:rules-dev-bounces@lists.jboss.org]
<b>On Behalf Of </b>Mario Fusco<br>
<b>Sent:</b> 18 January 2012 12:37<br>
<b>To:</b> Rules Dev List<br>
<b>Subject:</b> Re: [rules-dev] Fine Grained Property Change Listeners (Slot Specific)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks to everybody for the very useful and constructive feedback. I'll reply to all the points opened in your emails in no particular order:<br>
<br>
1. I changed @PropSpecific in @PropertySpecific (with a lower case p in the type declarations for the reason already explained by Mark)<br>
<b><i><span style="color:#1F497D">[Swindells, Thomas] </span></i></b><span style="font-family:Wingdings;color:#1F497D">J</span><span style="color:#1F497D"> Though I still wonder if the name is a bit vague and meaningless if you don’t know about the feature
 and what it is called – What about naming it Watchable – this links far better with the language syntax it is supporting?</span><br>
2. At the moment there is no way to enable this feature as a PackageBuilder option. Personally I am not convinced that this will be a good idea, but, if we'll decide to allow it, I suppose it won't be a big effort. Let me know what you think about it.<br>
<b><i><span style="color:#1F497D">[Swindells, Thomas] </span></i></b><span style="color:#1F497D">I’m more concerned that there should be an option to switch it off&nbsp; - among other things this would allow the model to be updated and released without necessarily
 having to change all the different rules files in a project in one go.</span><br>
3. I changed the @Modifies annotation to have a String[] as value so, for instance you'll have to write @Modifies( { &quot;name&quot; } ) and @Modifies( { &quot;firstName&quot;, &quot;lastName&quot; } )<br>
<br>
4. I didn't implement transitivity in @Modifies. I honestly didn't think about it, but I believe it is something that needs to be done, so I agreed with Mark I will implement this feature (taking care of circular references) after the beta2 will be out.<br>
<br>
5. Usage of @Modifies is not allowed on fields at the moment. I am not sure it could be really useful though. The most common scenario where I can think that the @Modifies will be used is for methods that are not related with a class field (the Person.setName()
 in my former example or even more commonly a clear() method), but if you think that there can be use cases where it can be useful also let me know.<span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">[Swindells, Thomas] Person.setName could equally validly be implemented such that Name is the ‘true’ representation that is persisted in the database,
 and firstName and lastName are (read only) utility properties to simplify rules writing.
<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><br>
6. The duplicated usage of the same property in @watch (like in the Wolfgang's example @watch( firstName, ! firstName ) ) will end up in a compilation error.<br>
<br>
7. En empty @watch() will have no effect and so the listened properties will be only the ones inferred in the pattern.<br>
<b><i><span style="color:#1F497D">[Swindells, Thomas] </span></i></b><span style="color:#1F497D">I’m concerned that this could be confusing, you could assume that it means watch nothing, though this does match the other behaviours that watch is additive and
 only explicitly subtractive so perhaps it just needs to be clearly documented that @watch adds additional watches and doesn’t
</span><br>
8. At the moment the usage of @watch on a type not annotated as @PropertySpecific will raise a compilation error. The same doesn't apply if you use @Modifies on a method of a class not annotated with @PropertySpecific, but I took this decision only for performance
 reasons: if a class is not PropertySpecific I can avoid to read the annotations on all its methods at all. Anyway if you think this last check should be done just let me know: even in this case should be a quite trivial modification.<br>
<b><i><span style="color:#1F497D">[Swindells, Thomas] </span></i></b><span style="color:#1F497D">I’m happy with this, Modifies actually provides a nice piece of metadata about a method even if drools weren’t being used!<o:p></o:p></span></p>
<p class="MsoNormal">9. To ask if a rule with a LHS like:<br>
<br>
&nbsp; when<br>
&nbsp;&nbsp;&nbsp; Person(&nbsp; $name: name == &quot;Smith&quot;) @watch( ! name )<br>
<br>
will ever fire, is not the right question. This property specific feature actually blocks (useless and unwanted) evaluations (or better re-evaluations) when the &quot;name&quot; property of the Person in Wolfgang's example is modified, but nothing prevents the rule to
 fire when a newly Person with name == &quot;Smith&quot; is inserted.<span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">[Swindells, Thomas] I think it is a question lots of people will ask and wonder, the behavior is actually quite useful and makes sense now you have explained
 it -we just need to make sure that there is a clear example and explanation in the documentation describing this<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><br>
<br>
10. It will be possible to flag a JavaBean as PropertySpecific without modifying its source code by adding a type declaration in the DRL like in:<br>
<br>
declare Bean<br>
&nbsp;&nbsp;&nbsp; @propSpecific<br>
end&nbsp;&nbsp;&nbsp; <br>
<br>
<span style="color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">[Swindells, Thomas] Excellent
</span></i></b><b><i><span style="font-size:11.0pt;font-family:Wingdings;color:#1F497D">J</span></i></b><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">One additional question (I was going to say final but then I’d probably be lying) how does this feature interact with type hierarchies?<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">If a parent class is annotated @PropertySpecific then presumably this must be inherited down by the children.
<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">What is the behavior of: Parent() @watch(*)? Does this react to all property changes of Child or only the properties declared in Parent?<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Thomas<o:p></o:p></span></i></b></p>
<p class="MsoNormal"><br>
Thanks again for your help,<br>
Mario<o:p></o:p></p>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
**************************************************************************************<br>
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postmaster@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data
 may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br>
<br>
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>
**************************************************************************************<br>
</font>
</body>
</html>