<div class="gmail_quote">On Tue, May 5, 2009 at 1:25 PM, Clint Popetz <span dir="ltr">&lt;<a href="mailto:cpopetz@gmail.com">cpopetz@gmail.com</a>&gt;</span> wrote:<br><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 class="h5">On Tue, May 5, 2009 at 12:20 PM, Dan Allen &lt;<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Tue, May 5, 2009 at 11:30 AM, Clint Popetz &lt;<a href="mailto:cpopetz@gmail.com">cpopetz@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Tue, May 5, 2009 at 10:21 AM, Dan Allen &lt;<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, May 5, 2009 at 10:31 AM, Clint Popetz &lt;<a href="mailto:cpopetz@gmail.com">cpopetz@gmail.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; On Tue, May 5, 2009 at 9:21 AM, Dan Allen &lt;<a href="mailto:dan.j.allen@gmail.com">dan.j.allen@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On Tue, May 5, 2009 at 7:59 AM, Clint Popetz &lt;<a href="mailto:cpopetz@gmail.com">cpopetz@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; On Tue, May 5, 2009 at 6:26 AM, Pete Muir &lt;<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt; On 29 Apr 2009, at 07:10, Dan Allen wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; Instead of thinking of replacing the class 1-for-1, think if<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; perhaps<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; there<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; is base functionality that would be relevant for any environment<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; and<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; specific functionality for a framework like JSF. Then, you can<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; create a<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; generic class and then specialize it using a deployment type and<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; @Specializes. Two examples of this so far are<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; StatusMessages/FacesStatusMessages and<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; Expressions/FacesExpressions.<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; I<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; believe that Selector is another candidate for this. There is<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; nothing<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; specific to JSF about a selector, but it just happens to be in<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; JSF<br>
&gt;&gt; &gt;&gt; &gt;&gt; &gt;&gt; package in Seam 2.1.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I&#39;m glad to see that this type of consideration is being given to<br>
&gt;&gt; &gt;&gt; &gt;&gt; making Seam3 independent of view layer choice.  However, I want to<br>
&gt;&gt; &gt;&gt; &gt;&gt; point out that using a deployment type and @Specializes would seem<br>
&gt;&gt; &gt;&gt; &gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt; place us in the same situation as Seam 2.x with respect to the view<br>
&gt;&gt; &gt;&gt; &gt;&gt; layers co-existing in the same deployment, which<br>
&gt;&gt; &gt;&gt; &gt;&gt; <a href="https://jira.jboss.org/jira/browse/JBSEAM-3645" target="_blank">https://jira.jboss.org/jira/browse/JBSEAM-3645</a> was meant to address.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; In other words, I&#39;d rather that the choice of the StatusMessages<br>
&gt;&gt; &gt;&gt; &gt;&gt; bean<br>
&gt;&gt; &gt;&gt; &gt;&gt; that will be activated isn&#39;t based on deployment type, but rather is<br>
&gt;&gt; &gt;&gt; &gt;&gt; chosen at runtime based on the type of request, using the pattern in<br>
&gt;&gt; &gt;&gt; &gt;&gt; the patch for the above jira issue.  Deployment types would of<br>
&gt;&gt; &gt;&gt; &gt;&gt; course<br>
&gt;&gt; &gt;&gt; &gt;&gt; still be used to choose which implementations of things like<br>
&gt;&gt; &gt;&gt; &gt;&gt; StatusMessages are available.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I&#39;d be willing to do the work to make that happen, if it can be<br>
&gt;&gt; &gt;&gt; &gt;&gt; coordinated in such a way that I&#39;m not getting in your way.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Ah, good thinking. I was thinking too narrowly. I&#39;m always open to<br>
&gt;&gt; &gt;&gt; &gt; collaboration, and I work well with diff and patch...so if there is a<br>
&gt;&gt; &gt;&gt; &gt; patch<br>
&gt;&gt; &gt;&gt; &gt; you would like to share with me (pre-commit) I would be glad to test<br>
&gt;&gt; &gt;&gt; &gt; it<br>
&gt;&gt; &gt;&gt; &gt; out<br>
&gt;&gt; &gt;&gt; &gt; and discuss with you possible next steps.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I haven&#39;t yet seen the work you&#39;re doing, so can&#39;t patch it easily :P<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; I&#39;d say that you could go ahead and commit it and I can look<br>
&gt;&gt; &gt;&gt; immediately at patching and committing changes to add the runtime<br>
&gt;&gt; &gt;&gt; flexibility.  Alternatively the above jira has a patch to the previous<br>
&gt;&gt; &gt;&gt; seam trunk (pre-cleanup) that is well documented.  Or you can send me<br>
&gt;&gt; &gt;&gt; your source in patch form pre-commit.   The first option is probably<br>
&gt;&gt; &gt;&gt; the easiest for both of us.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Everything I have so far is checked in to seam/modules/trunk. But yes, I<br>
&gt;&gt; &gt; will review what was proposed for Seam 2 and see if I can work out a<br>
&gt;&gt; &gt; solution. I think one way is to change the deployment type to a binding<br>
&gt;&gt; &gt; type. That way you do:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; @Faces StatusMessages statusMessages;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I was think I had to completely disable the generic messages, but you<br>
&gt;&gt; &gt; have<br>
&gt;&gt; &gt; clued me into the fact that they can exist simultaneously. That is the<br>
&gt;&gt; &gt; purpose of a binding type. In fact, I know this is the right solution.<br>
&gt;&gt; &gt; When<br>
&gt;&gt; &gt; the messages are transferred before render, only the @Faces<br>
&gt;&gt; &gt; StatusMessages<br>
&gt;&gt; &gt; will be transfer to the JSF context whereas the @Wicket StatusMessages<br>
&gt;&gt; &gt; will<br>
&gt;&gt; &gt; be transferred to the wicket context (since you can only render one or<br>
&gt;&gt; &gt; the<br>
&gt;&gt; &gt; other for any given request).<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; True, but some things need to be able to instantiate a generic<br>
&gt;&gt; Messages component to collect messages regardless of the actual bound<br>
&gt;&gt; component.  So, for example, when the security layer logs someone in<br>
&gt;&gt; and adds &quot;Welcome #{username}&quot; to the messages, it needs a way to add<br>
&gt;&gt; this to the view-specific component without knowing what that is.<br>
&gt;&gt; Ditto the SMPC code with regard to transaction messages.<br>
&gt;<br>
&gt; True. The more a think about it, the more I wonder whether the<br>
&gt; StatusMessages should be specialized at all. Really it&#39;s the translator to<br>
&gt; the native message format that matters.<br>
&gt;<br>
&gt; So for instance, let&#39;s say in JSF I am listening for the preRenderViewEvent<br>
&gt; or before-redirect event (which is not actually an event, but I know how to<br>
&gt; get my fingers in there). Then, we have a translator which can be strongly<br>
&gt; typed based on @Faces or @Wicket...and in this case I want the @Faces one.<br>
&gt; The translator always consumes the one and only StatusMessages bean.<br>
&gt;<br>
&gt; In short, at the point of the translation, you know which translator you<br>
&gt; want. But the StatusMessages are always generic. Even if we specialized<br>
&gt; StatusMessages into FacesMessages, the rest of the system would still work<br>
&gt; with the StatusMessages interface...so that would be something seperate.<br>
&gt; Nevermind it anyway. The point being, the translator should be our<br>
&gt; specialized interface, not StatusMessages.<br>
<br>
<br>
</div></div>Agreed, that was my preference in 2.X too, but I couldn&#39;t do that and<br>
preserve backward compatibility with everything that referenced the<br>
messages components.  I think StatusMessages is view-independent and<br>
there are separate components that use its contents to do<br>
view-dependent things.</blockquote><div><br>Excellent. I will give it go. I&#39;m also going to introduce an early wicket module for Seam that hosts this translator so I can test having the two. That&#39;s all the module will have at this point...then we can think about where to go with it next.<br>
<br>-Dan </div></div><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br><br>NOTE: While I make a strong effort to keep up with my email on a daily<br>basis, personal or other work matters can sometimes keep me away<br>
from my email. If you contact me, but don&#39;t hear back for more than a week,<br>it is very likely that I am excessively backlogged or the message was<br>caught in the spam filters.  Please don&#39;t hesitate to resend a message if<br>
you feel that it did not reach my attention.<br>