<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 17/01/2012 21:00, Edson Tirelli wrote:
    <blockquote
cite="mid:CAD7AJnd6zxkQcN2+QkiEMv=1ttWVFfxAX-TXXcbESxzuh+qb3w@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      &nbsp; &nbsp;Nicely done sir! :)
      <div><br>
      </div>
      <div>&nbsp; &nbsp;My only comments are very minor...&nbsp;</div>
      <div><br>
      </div>
      <div>* I think we should keep the property names consistent
        between the java and the declare element, so I suggest you use
        uppercase for both (@PropSpecific). <br>
      </div>
    </blockquote>
    it's kept with how we have the other annotations on type
    declarations, all of which allow lower case at the moment.<br>
    @role<br>
    @format<br>
    @position<br>
    <blockquote
cite="mid:CAD7AJnd6zxkQcN2+QkiEMv=1ttWVFfxAX-TXXcbESxzuh+qb3w@mail.gmail.com"
      type="cite">
      <div>* I think @onChange is more meaningful to me than @watch, but
        that is just my opinion.</div>
      <div><br>
      </div>
    </blockquote>
    we can have a wider vote. I was bit uncomfortable with onChange,
    because it could mean other things. Watch was shorter and I think
    more accurate. "Just watch these properties". onChange sounds like
    we should be attaching some callback, for an event that has
    happened.<br>
    <br>
    <blockquote
cite="mid:CAD7AJnd6zxkQcN2+QkiEMv=1ttWVFfxAX-TXXcbESxzuh+qb3w@mail.gmail.com"
      type="cite">
      <div>&nbsp; &nbsp;On the pattern annotation, how is the EBNF now?</div>
      <div><br>
      </div>
      <div>lhsPattern := QUESTION? qualifiedIdentifier&nbsp;LEFT_PAREN
        positionalConstraints? constraints? RIGHT_PAREN
        annotation*&nbsp;(OVER patternFilter)? (FROM patternSource)?</div>
      <div>
        <div><br>
        </div>
        <div>&nbsp; &nbsp;Thanks,</div>
        <div>&nbsp; &nbsp; &nbsp; &nbsp;Edson</div>
        <br>
        <div class="gmail_quote">On Tue, Jan 17, 2012 at 2:20 PM, Mario
          Fusco <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:mario.fusco@gmail.com">mario.fusco@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
            <br>
            just a quick recap of what I did until now to check if we
            are all on the same page and also agree with the naming
            convention I used.<br>
            <br>
            The property specific feature is off by default in order to
            make the behavior of the rule engine backward compatible
            with the former releases. If you want to activate it on a
            specific bean you have to annotate it with @propSpecific.
            This annotation works both on drl type declarations:<br>
            <br>
            declare Person<br>
            &nbsp;&nbsp;&nbsp; @propSpecific<br>
            &nbsp;&nbsp;&nbsp; firstName : String<br>
            &nbsp;&nbsp;&nbsp; lastName : String<br>
            end<br>
            <br>
            and on Java classes:<br>
            <br>
            @PropSpecific<br>
            public static class Person {<br>
            &nbsp;&nbsp;&nbsp; private String firstName;<br>
            &nbsp;&nbsp;&nbsp; private String lastName;<br>
            }<br>
            <br>
            Moreover on Java classes you can also annotate any method to
            say that its invocation actually modifies other properties.
            For instance in the former Person class you could have a
            method like:<br>
            <br>
            @Modifies( "firstName, lastName" )<br>
            public void setName(String name) {<br>
            &nbsp;&nbsp;&nbsp; String[] names = name.split("\\s");<br>
            &nbsp;&nbsp;&nbsp; this.firstName = names[0];<br>
            &nbsp;&nbsp;&nbsp; this.lastName = names[1];<br>
            }<br>
            <br>
            That means that if a rule has a RHS like the following:<br>
            <br>
            modify($person) { setName("Mario Fusco") }<br>
            <br>
            it will correctly recognize that both the firstName and
            lastName have been modified and act accordingly. Of course
            the @Modifies annotation on a method has no effect if the
            declaring class isn't&nbsp; annotated with @PropSpecific. <br>
            <br>
            The third annotation I have introduced is on patterns and
            allows you to modify the inferred set of properties
            "listened" by it. So, for example, you can annotate a
            pattern in the LHS of a rule like:<br>
            <br>
            Person( firstName == $expectedFirstName ) @watch( lastName )
            // --&gt; listens for changes on both firstName (inferred)
            and lastName<br>
            Person( firstName == $expectedFirstName ) @watch( * ) //
            --&gt; listens for all the properties of the Person bean<br>
            Person( firstName == $expectedFirstName ) @watch( lastName,
            !firstName ) // --&gt; listens for changes on lastName and
            explicitly exclude firstName<br>
            Person( firstName == $expectedFirstName ) @watch( *, !age )
            // --&gt; listens for changes on all the properties except
            the age one<br>
            <br>
            Once again this annotation has no effect if the
            corresponding pattern's type hasn't been annotated with
            @PropSpecific.<br>
            <br>
            I've almost finished with the development of this feature
            (at the moment I am missing the compile-time check of the
            properties named in the @watch annotation together with some
            more exhaustive tests), so if you think that I misunderstood
            something or there is room for any improvement (or you just
            don't like the annotation's names I chose) please let me
            know as soon as possible.<span class="HOEnZb"><font
                color="#888888"><br>
                <br>
                Mario<br>
              </font></span><br>
            _______________________________________________<br>
            rules-dev mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
            <a moz-do-not-send="true"
              href="https://lists.jboss.org/mailman/listinfo/rules-dev"
              target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        &nbsp; Edson Tirelli<br>
        &nbsp; JBoss Drools Core Development<br>
        &nbsp; JBoss by Red Hat @ <a moz-do-not-send="true"
          href="http://www.jboss.com">www.jboss.com</a><br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>