Hi Ken, no worries. It took a while to get the API&#39;s worked out ;) See my responses inline.<br><br><div class="gmail_quote">On Fri, May 28, 2010 at 3:11 AM, Ken Finnigan <span dir="ltr">&lt;<a href="mailto:ken.finnigan@sorstech.com">ken.finnigan@sorstech.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;"><div bgcolor="#FFFFFF"><div></div><div><span style="font-size: 15px; color: rgb(0, 35, 163);">Hi Lincoln,<br>
<br>Sorry for taking so long to respond to your email!<br><br>I&#39;ve taken a look at the Messages code you committed the other day and I had a few questions about some areas that I didn&#39;t quite understand in reading the code:<br>
<br><ol><li>I noticed that Bundles contained @Named and was wondering what your thoughts were about the bundles being directly EL accessible?</li></ol></span></div></div></blockquote><div>This is to provide i18n support directly in EL-like use-cases, such as Facelets:<br>
<br>&lt;h1&gt;#{bundles.headers.loginHeader}&lt;/h1&gt; -- Dan could highlight that use case a bit more. Dan?<br>�</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);"><ol><li>With BundleMessage I wasn&#39;t sure if it was purely the Builder pattern that dictated that the BundleKey was set through a method call as opposed to on the constructor or whether there was another reason?</li>
</ol></span></div></div></blockquote><div><br>Yeah, since we&#39;re using the Builder pattern, everything gets set through a setter. It makes the usage consistent, otherwise you&#39;d have 50 constructors ;) I went with the builder pattern because I didn&#39;t want method explosion.<br>
�</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);"><ol>
<li>What are the benefits to MessageFactory returning concrete implementations as opposed to the MessageBuilder interface?</li></ol></span></div></div></blockquote><div>Well, MessageBuilder interface only defines the &quot;public Message build()&quot; method, which is how builders actually produce the Message to be stored - so in order to expose the APIs for building a TemplateMessage or a BundleTemplateMessage, the actual Impls needed to be returned. Now.. one option is to convert TemplateMessage and BundleTemplateMessage into interfaces, and move the Impls to the impl module. That&#39;s not a bad idea, actually. Then we wouldn&#39;t need to use Class.forName() in order to get the MessageImpl.<br>
�</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);"><ol>
<li>What are the benefits to Messages containing the same methods as MessageFactory, without them saving the result in the Messages map?</li></ol></span></div></div></blockquote><div>Just to avoid confusion, but this API has actually changed slightly so that the messages are indeed added :)<br>
<br><a href="http://messages.info">messages.info</a>(&quot;This message gets added now!&quot;).targets(&quot;someComponent&quot;);<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);"><ol><li>Should Messages be @ConversationScoped to support parallel requests from the UI?</li></ol></span></div></div></blockquote><div>Actually, I think @RequestScoped is the best option. It should be up to the consumer of the Messages to make sure that they are propagated to whatever framework is necessary. That&#39;s an interesting question though... since @ConversationScoped is @RequestScoped unless marked as long running. It could provide an interesting feature, but perhaps one that is confusing. I&#39;m open to discussion on the use-cases... but at the moment, @ConversationScoped only works in JSF, so I think @RequestScoped is the right choice.<br>
<br>I just wrote a new JSF scope that lasts &quot;Until the next Render&quot;, so the MessagesAdapter in the Faces Module would be responsible for transferring messages into that scope. Several potential names for this scope: @FlashScoped, @InteractionScoped, @LogicalRequestScoped.<br>
�</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);"><ol>
<li>If I&#39;ve understood the code any message bundles that contain properties need to be specified as strings in code.� Was there any thought of using XML Config to read them in, as this was something Dan and I had discussed in the past?</li>
</ol></span></div></div></blockquote><div>I&#39;m not sure I&#39;m following you here. Could you explain? I don&#39;t think I&#39;ve heard this :)<br>�</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);">If I understood the usage scenarios correctly they would include:<br><br>Messages.add(<a href="http://MessageFactory.info" target="_blank">MessageFactory.info</a>(new BundleKey(&quot;bundle&quot;, &quot;key&quot;), 2).build());<br>
</span></div></div></blockquote><div><br>Now:<br>Messages.info(new BundleKey(&quot;bundle&quot;, &quot;key&quot;), 2); <br></div><div>�</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);">OR<br><br>Messages.add(<a href="http://MessageFactory.info/" target="_blank"></a><a href="http://MessageFactory.info" target="_blank">MessageFactory.info</a>(new BundleKey(&quot;bundle&quot;, &quot;key&quot;), 2));<br>
<br>OR<br><br>Creating an instance of MessageImpl directly and set the values before passing it to Messages.add();<br><br>Could just be me, but these seem quite wordy just to add a message to the UI?<br></span></div></div>
</blockquote><div><br>Still wordy? :)<br>�</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);"><br>
What I am planning is to prototype what I have been thinking of doing, using what you&#39;ve already done as inspiration.<br><br>What are your thoughts on other features that should be in an Alpha 1 of i18n?� I&#39;ve got no problem with releasing Alpha 1 with the Messages API you and Dan came up with to give me more time to think of possible alternatives.<br>
</span></div></div></blockquote><div><br>I think we&#39;re ready for an Alpha after a little housekeeping. We just need the documentation / reference guide. We can steal the Faces Reference guide as a starting point. <br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div bgcolor="#FFFFFF"><div><span style="font-size: 15px; color: rgb(0, 35, 163);"><font color="#888888"><br>
Ken</font></span><br><br>Sent from my iPhone</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>
&quot;Keep it Simple&quot;<br>