Here&#39;s some detail from Sotty:-<br><ul><li>It is indeed necessary to declare a legacy class if you want another to extend it.</li></ul><ul><li>The classFieldAccessor constructor requires both getter and setter to be present for each field, so there&#39;s indeed a bug. A field must be inherited if and only if it has both getter and setter (right now, only the getter is checked). I have put an additional condition in the PackageBuilder: this will allow to extend non-bean &quot;legacy&quot; classes.</li>
</ul><ul><li>Currently, when you redeclare a field, it is overridden. On a second and third thought, I do not &quot;like&quot; this behaviour, so I have changed the PB to prevent fields from being overridden :)</li></ul> <ul>
<li>It is still possible to redeclare a field with the same name if the type is the same</li></ul><ul><li>Declared metadata is already inherited by extenders</li></ul>Thanks for the insights Sotty.<br><br>Mike<br><br><div class="gmail_quote">
On 13 July 2011 13:00, Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Wolfgang, still no news as to the expected behaviour :(<br><br>Sotty, I appreciate you are probably busy with other activities, however any your thoughts on the following would be most welcome:-<br><ul><li>For POJOs is a field only added to the declared type if it has a getter and setter (something laune said he&#39;d seen; email earlier in this thread)?</li>

<li>Are fact-level annotations inherited?</li><li>Are field-level annotations inherited?</li><li>Type erasure on subclasses, if type A declares &quot;myVar : String&quot; and type B extends A and declaring &quot;myVar : Integer&quot;, what should happen?</li>

</ul>For others interested, here&#39;s some answers already received:<br><ul><li>Can declarative types extend Java POJOs and other declared types?<br></li></ul><div style="margin-left: 40px;">&lt;sotty&gt; yes</div><ul><li>

For
 POJO&#39;s do I need to include an &quot;empty&quot; declaration? So &quot;declare 
java.util.ArrayList end&quot; if I want to &quot;declare MyList extends ArrayList&quot;
 in a java.util package? <br></li></ul><div style="margin-left: 40px;">&lt;sotty&gt; no, it should be enough to import
 the fqn or use it in the &quot;extends&quot;.<br><b>&lt;manstis&gt; note this is different to what is documented in the Drools Expert user-guide<br></b><br></div>Thanks,<br><br>Mike<div><div></div><div class="h5"><br><br>
<div class="gmail_quote">On 12 July 2011 13:12, Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><a href="https://issues.jboss.org/browse/JBRULES-3133" target="_blank">https://issues.jboss.org/browse/JBRULES-3133</a> created.<div>

<div></div><div><br><br><div class="gmail_quote">On 12 July 2011 13:08, Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">There&#39;s also a quirk regarding the class resolution:-<br><br>Given Person class:-<br>
<br>
<span style="font-family: courier new,monospace;">package com.guvnor.domain;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">import java.math.BigDecimal;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">public class Person {</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">    private BigDecimal salary;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">    public BigDecimal getSalary() {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        return salary;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    }</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    public void setSalary(BigDecimal salary) {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">        this.salary = salary;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;">
<br><br>The following compiles OK:-<br><br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">package com.sample</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">



<span style="font-family: courier new,monospace;">import com.guvnor.domain.Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;">



<span style="font-family: courier new,monospace;">declare Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br></div><br>However the following does not (without explicitly importing <span style="font-family: courier new,monospace;">java.math.BigDecimal</span> - which is a field type in Person):-<br>



<br><div style="margin-left: 40px;"><span style="font-family: courier new,monospace;">package com.sample</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> </span><br style="font-family: courier new,monospace;">



<span style="font-family: courier new,monospace;">import com.guvnor.domain.Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">import com.guvnor.domain.Address</span><br style="font-family: courier new,monospace;">



<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">declare Person</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">end</span><br style="font-family: courier new,monospace;">



<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace; color: rgb(255, 0, 0);">declare Person2 extends Person</span><br style="font-family: courier new,monospace; color: rgb(255, 0, 0);">



<span style="font-family: courier new,monospace; color: rgb(255, 0, 0);">    flange : String</span><br style="font-family: courier new,monospace; color: rgb(255, 0, 0);"><span style="font-family: courier new,monospace; color: rgb(255, 0, 0);">end</span><br>



</div><br>Error being &quot;Unknown DroolsError class org.drools.compiler.TypeDeclarationError: Unable to find class &#39;BigDecimal&#39; &quot;.<br><br>With kind regards,<br><br>Mike<div><div></div><div><br><br>
<div class="gmail_quote">On 11 July 2011 08:41, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Subsection 5.7.7 discusses &#39;extends&#39; and describes how it is done for types declared in Java.<br>



<br>One finesse is apparently not documented: Java types must be proper JavaBeans; otherwise the construction of the accessors will fail. (Try, for instance, a property with a getter but no matching setter.) <br>
<br>HTH<br>-W<br><br><br><div class="gmail_quote"><div><div></div><div>On 10 July 2011 22:29, Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;</span> wrote:<br>



</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div>
What&#39;s the rules around declared types extending another (declared) type?<br><br>I&#39;ve been asked to provide for declared type extension in Guvnor (by Prakash) but the Expert user-guide doesn&#39;t say it exists at the engine level.<br>





<br>I tried &quot;declare MyType extends java.util.ArrayList&quot; and received a parser\compiler error stating &quot;java.util.ArrayList was not a declared type&quot; (or words to that effect) so some form of extension appears possible.<br>





<br>Thanks,<br><br>Mike<br>
<br></div></div>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a 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>_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">rules-dev@lists.jboss.org</a><br>
<a 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>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>
</div></div></blockquote></div><br>