<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 3, 2013 at 3:41 PM, Summers Pittman <span dir="ltr">&lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed 03 Jul 2013 09:15:24 AM EDT, Sebastien Blanc wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Speaking more about implementation details , do you think this is a<br>
good approach (don&#39;t like very much the code duplication between the<br>
builder and the object but like the result)<br>
<a href="http://javarevisited.blogspot.fr/2012/06/builder-design-pattern-in-java-example.html" target="_blank">http://javarevisited.blogspot.<u></u>fr/2012/06/builder-design-<u></u>pattern-in-java-example.html</a><br>
?<br>
</blockquote></div>
Just a script to generate the builder and constructor from the fields in the class.  I wouldn&#39;t worry about code duplication (IN THIS ONE NARROW INSTANCE) too much.<br></blockquote><div style>A groovy Script ?Sure ;) </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><span style="color:rgb(34,34,34)"> </span><br></div></blockquote></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
On Wed, Jul 3, 2013 at 10:10 AM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a><br></div><div class="im">
&lt;mailto:<a href="mailto:scm.blanc@gmail.com" target="_blank">scm.blanc@gmail.com</a>&gt;&gt; wrote:<br>
<br>
    Ok,<br>
    Progress will be tracked here<br>
    <a href="https://issues.jboss.org/browse/AGPUSH-135" target="_blank">https://issues.jboss.org/<u></u>browse/AGPUSH-135</a><br>
<br>
<br>
    On Tue, Jul 2, 2013 at 6:14 PM, Matthias Wessendorf<br></div><div class="im">
    &lt;<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a> &lt;mailto:<a href="mailto:matzew@apache.org" target="_blank">matzew@apache.org</a>&gt;&gt; wrote:<br>
<br>
<br>
<br>
<br>
        On Tue, Jul 2, 2013 at 5:57 PM, Summers Pittman<br></div><div><div class="h5">
        &lt;<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a> &lt;mailto:<a href="mailto:supittma@redhat.com" target="_blank">supittma@redhat.com</a>&gt;&gt; wrote:<br>
<br>
            On 07/02/2013 09:13 AM, Sebastien Blanc wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            Hi Folks,<br>
            As you know we have a Java Sender Library that can be<br>
            used by any backend application that want to send<br>
            messages to the Unified Message Push Server<br>
            (<a href="https://github.com/aerogear/aerogear-unified-push-java-client" target="_blank">https://github.com/aerogear/<u></u>aerogear-unified-push-java-<u></u>client</a>).<br>
            The format is quite open and flexible as<br>
            Matthias described it here :<br>
            <a href="https://gist.github.com/matzew/b21c1404cc093825f0fb" target="_blank">https://gist.github.com/<u></u>matzew/b21c1404cc093825f0fb</a><br>
            We can divide the creation of a message in 2 main parts :<br>
<br>
            - The  &quot;signalling&quot; part : list of client identifiers /<br>
            specific devices etc ...<br>
            - The &quot;core&quot; message containing actually the information<br>
            we want to push<br>
<br>
            Both are passed as Map and are finally converted into JSON.<br>
            Here an example of how a &quot;core&quot; message is build :<br>
<br>
            |Map categories = new HashMap();<br>
            categories.put(&quot;lead&quot;, &quot;version=&quot;+leadVersion++);<br>
            Map json = new HashMap();<br>
            json.put(&quot;id&quot;, lead.getId());<br>
            json.put(&quot;messageType&quot;, &quot;pushed_lead&quot;);<br>
            json.put(&quot;name&quot;, lead.getName());<br>
            json.put(&quot;location&quot;, lead.getLocation());<br>
            json.put(&quot;phone&quot;, lead.getPhoneNumber());<br>
            json.put(&quot;simple-push&quot;, categories);<br>
            json.put(&quot;sound&quot; ,&quot;default&quot;);<br>
            json.put(&quot;alert&quot; ,&quot;A new lead has been created&quot;);|<br>
<br>
            Even the format is open, we could &quot;assist&quot; a bit<br>
            the developer in building the message. For that we have<br>
            different options :<br>
            - Propose a simple Message object containing the message<br>
            &quot;API&quot; :<br>
<br>
            |Message message = new Message();<br>
            message.setClientIdentifiers(&quot;<u></u>jake&quot;,&quot;maria&quot;);<br>
            message.enableSound();//by default use &quot;default&quot; or we could do message.enableSound(&quot;boing&quot;)<br>
            message.setAlert(&quot;Watch out!);<br>
            message.setAttribute(&quot;<u></u>customAttribute&quot;,&quot;yo&quot;); // custom simple strings<br>
            message.setAttribute(&quot;<u></u>customStructure&quot;,myObject); // passing objects|<br>
<br>
            - Propose a Message Builder (following the Builder<br>
            Pattern) to propose a more fluent API :<br>
<br>
            |Message message = new Message().builder()<br>
               .clientIdentifiers(&quot;jake&quot;,&quot;<u></u>maria&quot;)<br>
               .enableSound()<br>
               .alert(&quot;AAAAHHH!&quot;)<br>
               .attribute(&quot;customAttribute&quot;,&quot;<u></u>yo&quot;)<br>
               .attribute(&quot;customStructure&quot;,<u></u>myObject)<br>
               .build()|<br>
<br>
            - Same as above but more DSL focused (not sure about this<br>
            one ;) )<br>
            |Message message = MessageDSL.to(&quot;jake&quot;,&quot;maria&quot;).<u></u>withSound() //etc ...<br>
<br>
<br>
            |<br>
<br>
            So, beside that we have to discuss what we want allow to<br>
            pass to the message API : only Strings and simple Maps ?<br>
            Full Objects that will be JSONified ?<br>
</blockquote>
            +1 to Strings and Simple Maps.<br>
<br>
<br>
        +1 on that too.<br>
<br>
        See here too :)<br>
        <a href="http://developer.android.com/reference/com/google/android/gcm/server/Message.Builder.html#addData(java.lang.String" target="_blank">http://developer.android.com/<u></u>reference/com/google/android/<u></u>gcm/server/Message.Builder.<u></u>html#addData(java.lang.String</a>,<br>

        java.lang.String)<br>
<br>
            JSONIfying full objects can be error prone/tricky<br>
            sometimes so -.5 to that.<br>
            I don&#39;t hate it would rather just not give people that gun<br>
            to shoot themselves with so soon ;)<br>
<br>
<br>
        I am for Strings and Simple Maps as well<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
            Do we want also to separate the &quot;signalling&quot; part from<br>
            the &quot;core&quot; part when building a message ?<br>
<br>
            Inputs and comments more than welcome !<br>
</blockquote>
            I like the Builder.  It is very simple, very neutral, and<br>
            very exact.<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<br>
            Seb<br>
<br>
<br>
<br>
            ______________________________<u></u>_________________<br>
            aerogear-dev mailing list<br></div></div>
            <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a>  &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>&gt;<br>

            <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/aerogear-dev</a><br>
</blockquote><div class="im">
<br>
<br>
            ______________________________<u></u>_________________<br>
            aerogear-dev mailing list<br>
            <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br></div>
            &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>&gt;<div class="im"><br>
            <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/aerogear-dev</a><br>
<br>
<br>
<br>
<br>
        --<br>
        Matthias Wessendorf<br>
<br>
        blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.<u></u>wordpress.com/</a><br>
        sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/<u></u>mwessendorf</a><br>
        twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
<br>
        ______________________________<u></u>_________________<br>
        aerogear-dev mailing list<br></div>
        <a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a> &lt;mailto:<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.<u></u>jboss.org</a>&gt;<div class="im">
<br>
        <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/aerogear-dev</a><br>
<br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/<u></u>mailman/listinfo/aerogear-dev</a><br>
</div></blockquote>
<br>
<br>
</blockquote></div><br></div></div>