Hi all,<br><br>I just finished going through the 2009-01-16 draft.&nbsp; Here&#39;s what I&#39;ve got:<br><br><br>-p 5 I suggest we include @Inherited in @InterceptorBindingType example, since we recommend it later on <br><br>-p 13&nbsp; same as above, but with ScopeType<br>
<br>-p 18 Should it be a DefinitionException to define a Stereotype with @Target{Type,Field} ? @Target(Parameter)? etc<br><br>-p 20 Should it be a DefinitionException to have a stereotype with transitive stereotypes with conflicting supportedScopes or requiredTypes?<br>
<br>-p 22 &quot;implementing the Bean interface&quot; should be extending the Bean abstract class<br><br>-p 43 doesn&#39;t specify whether @Named is @inherited or not.&nbsp; Seems to me like it should.<br><br>-p 43 It may be worth including a note that bindings/stereotypes/etc cannot be inherited from Interfaces <br>
<br>-p 44 extra space: &quot; lower-priority bean , in the case&quot;<br><br>-p 49 outdated Context api terminology: &quot; and true as the value of the create parameter, and&quot; <br><br>-p 56 I think Instance.get() should throw an exception if no such bean exists, not return null, since some beans are nullable, and some apps may use null to mean something special.<br>
<br>-p 59 &quot;The container performs perform&quot; has an extra &quot;perform&quot; in there.&nbsp; Twice on page.<br><br>-p 63 Is there a reason for tying IllegalProductExceptions for null producer results to non-@Dependent scopes instead of normal scopes?&nbsp; Other pseudo-scopes may want to support null objects...<br>
<br><br>-p 85 Should the observer search algorithm mention the caveat of @NonBinding?&nbsp; <br><br>-p 89 &quot;Suppose beans A, B and Z &quot;&nbsp; I&#39;d make z upper-cased, like A and B.&nbsp; Not a biggie.<br><br>-p 89 referring to old Context api (true/false for create)<br>
<br>-p 92 Application context should probably be active during Asynchronous observer method invocations. <br>Side question (and sorry if this has already been asked): Why can&#39;t the application context always be active?&nbsp; I anticipate creating threads time to time, and it&#39;d be obnoxious to not be able to access the application context from them.<br>
<br><br>Other things:<br><br><br>I noticed that we don&#39;t define what happens if an application tries to invoke a method on a not-fully-constructed bean yet.<br>Say for example:<br><br>@RequestScoped<br>class Foo<br>{<br>
&nbsp;&nbsp; @Current Bar bar;<br><br>&nbsp;&nbsp; @PostConstruct void init() <br>&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bar.doSomething();<br>&nbsp;&nbsp; }<br><br>&nbsp;&nbsp; ...<br>}<br><br>@RequestScoped<br>class Bar<br>{<br>&nbsp;&nbsp; @Current Foo foo;<br><br>&nbsp;&nbsp; @PostConstruct void init() <br>
&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foo.doSomethingElse();<br>&nbsp;&nbsp; }<br><br>&nbsp;&nbsp; ...<br>}<br><br>Someone here has to lose.&nbsp; Same type of thing can happen with @Initializer methods and constructors, I believe.<br>Perhaps this needs to be specified for Context objects.&nbsp; If the two-param get() method is invoked for a bean that is currently being created by a different two-param get() invocation, then throw a BeanNotConstructed exception? Though, that doesn&#39;t quite work, because sometimes you need to hand out references to unconstructed objects.&nbsp; So maybe introduce a getFullyConstructed() method on Context that potentially throws a BeanNotConstructed exception, and client proxies call this method?&nbsp; It&#39;s late; maybe I&#39;m speaking nonsense.&nbsp; :-)<br>
<br>It struck me that ejb 3.1 @Singleton session beans might have this problem, too, but it didn&#39;t look to me like the ejb 3.1 PR spec deals with this.&nbsp; I was hoping we could behave the same way that spec behaves.&nbsp; Oh well.&nbsp; How do most ejb impls behave?<br>
<br><br><br>@Destructor is still mentioned in a couple places throughout the spec<br><br><br><br>re: Open issue: what restrictions exist upon invoking dependencies from @PreDestroy? <br>Can we say that that beans within a Context are destroyed in the opposite sequence of their construction?&nbsp; This would help deter (though not prevent) beans from invoking destroyed beans.&nbsp; <br>
If we had more time, I wonder if it&#39;d be worth adding a @FullyConstructed annotation to specify a dependency must be constructed before, and destroyed after, this bean<br><br><br>re: Open issue: is the request context (and application context) active during servlet filter execution? <br>
Can we now say Request/Session/Application contexts available in servlet filters, since pluggability has been dropped?<br><br><br><br>If someone has a @Obtains Instance&lt;Calculator&gt; field, where Calculator is a @Dependent bean, they may feel confused when they try to invoke instance.get() in a business method and get a ContextNotActiveException.&nbsp; How would you feel about letting the @Dependent context be active during Instance.get() invocations?&nbsp; <br>
<br><br><br>I should have brought this up much earlier, but I&#39;d love to have something like this:<br><br>&lt;myapp:Config&gt; <br>&nbsp;&lt;myapp:administrators&gt; <br>&nbsp; &lt;value&gt;<br>&nbsp;&nbsp; &lt;myapp:Admin&gt; <br>&nbsp;&nbsp;&nbsp; &lt;myapp:name&gt;Matt Drees&lt;/myapp:firstName&gt; <br>
&nbsp;&nbsp;&nbsp; &lt;myapp:email&gt;<a href="mailto:matt.drees@gmail.com">matt.drees@gmail.com</a>&lt;/myapp:lastName&gt; <br>&nbsp;&nbsp; &lt;/myapp:Admin&gt;<br>&nbsp; &lt;/value&gt;<br>&nbsp; &lt;value&gt;<br>&nbsp;&nbsp; &lt;myapp:Admin&gt; <br>&nbsp;&nbsp;&nbsp; &lt;myapp:name&gt;Gavin King&lt;/myapp:firstName&gt; <br>
&nbsp;&nbsp;&nbsp; &lt;myapp:email&gt;<a href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>&lt;/myapp:lastName&gt; <br>&nbsp;&nbsp; &lt;/myapp:Admin&gt;<br>&nbsp; &lt;/value&gt;<br>&nbsp;&lt;/myapp:administrators&gt;<br>&lt;/myapp:Config&gt; <br><br>
(basically, combining List-type initial values and inline bean declarations)<br><br>I&#39;m sure it&#39;s too late for this version now, but this seems doable, and I hope we at least implement this in the RI.&nbsp; I don&#39;t see anything in the spec that explicitly forbids this sort of thing, right?<br>
<br><br><br>The Resource stuff and the Asynchronous events stuff look fine to me.<br><br><br>-Matt<br>