<div>Sorry Guys,</div><div><br></div><div>I did not pay attention to that. Actually when I said +1 I wanted to say +1 to pipeline.pipe(Class) and not to pipeline.add(Class) </div><div><br></div><div>using pipeline.pipe(Project.class).buildAndAdd() you don&#39;t need to specify mandatory &quot;name&quot; and &quot;class&quot; to call buildAndAdd() </div>
<div><br></div><div>The way I see, it&#39;s less effort to do, so wdyt?</div><div><br></div><div><a href="https://gist.github.com/3973193">https://gist.github.com/3973193</a></div><br><div class="gmail_quote">On Thu, Nov 1, 2012 at 10:48 AM, 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">-1 to Pipeline.add<br>
+1 to Pipline.pipe w/ buildAndAdd() (or overloading build to also add)<br>
<br>
I don&#39;t like pipeline.add(Class) because it implies that the adding is happening then and you don&#39;t have to do more work.  I like buildAndAdd or overloading the builder Pipeline provides because it is either more explicit or more automatic respectivly.<br>

<div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
From: &quot;Matthias Wessendorf&quot; &lt;<a href="mailto:matzew@apache.org">matzew@apache.org</a>&gt;<br>
To: &quot;AeroGear Developer Mailing List&quot; &lt;<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a>&gt;<br>
Sent: Thursday, November 1, 2012 7:49:11 AM<br>
Subject: Re: [aerogear-dev] AEROGEAR-593 - Builder pattern isn&#39;t consistent<br>
<br>
On Thu, Nov 1, 2012 at 12:15 PM, Daniel Passos &lt;<a href="mailto:daniel@passos.me">daniel@passos.me</a>&gt; wrote:<br>
&gt; +1 to pipeline.add(Project.class)<br>
<br>
One more thing.. &#39;pipeline.add(Type.class);&#39; will reflect to the following URL:<br>
<a href="http://BASE_URL/types" target="_blank">http://BASE_URL/types</a> &lt;&lt;&lt;== note the &#39;s&#39; for plural ....<br>
<br>
Fluent API:<br>
the combination of &#39;add()&#39; and a followed/ending &#39;build()&#39; makes sense<br>
in terms of a fluent API:<br>
- here you add something (-&gt; pipe) that is created (build) at the end<br>
of the statement...<br>
<br>
A little note aside...<br>
<br>
Pipeline pipeline  = new Pipeline(ROOT_URL);<br>
pipeline.pipe(Project.class).endpoint(&quot;foo&quot;).name(&quot;bar&quot;).auth(myAuthMod).buildAndAdd();<br>
<br>
Is fine for me too:<br>
-pipe =&gt; indicates you create a pipe object;<br>
-buildAndAdd =&gt; you build the object and add it to the pipeline.<br>
<br>
Not sure if the &#39;buildAndAdd&#39; is a bit too verbose.<br>
<br>
I am fine with the suggestion from Bruno<br>
(pipeline.add(class).build();), but wanted to share the notes on the<br>
pipe().buildAndAdd() as well<br>
<br>
<br>
-M<br>
<br>
<br>
&gt;<br>
&gt; On Thu, Nov 1, 2012 at 9:03 AM, Bruno Oliveira &lt;<a href="mailto:bruno@abstractj.org">bruno@abstractj.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Good morning everyone! Lay out your costumes from halloween and let&#39;s talk<br>
&gt;&gt; about this jira (<a href="https://issues.jboss.org/browse/AEROGEAR-593" target="_blank">https://issues.jboss.org/browse/AEROGEAR-593</a>).<br>
&gt;&gt;<br>
&gt;&gt; Passos did a great work creating a builder for Pipes and of course we can<br>
&gt;&gt; improve it more and more, it&#39;s all about software. Currently to create a<br>
&gt;&gt; Pipe we must do it:<br>
&gt;&gt;<br>
&gt;&gt; Pipeline pipeline  = new Pipeline(ROOT_URL);<br>
&gt;&gt; pipeline.pipe().name(&quot;tasks&quot;).useClass(Task.class).buildAndAdd();<br>
&gt;&gt; pipeline.pipe().name(&quot;tags&quot;).useClass(Tag.class).buildAndAdd();<br>
&gt;&gt;<br>
&gt;&gt; Chatting with Matthias we agreed that would be better 2 alternatives:<br>
&gt;&gt;<br>
&gt;&gt; Pipeline pipeline  = new Pipeline(ROOT_URL);<br>
&gt;&gt; pipeline.add(Project.class).build();<br>
&gt;&gt;<br>
&gt;&gt; Doing just this implicitly means that the name of the pipe will be<br>
&gt;&gt; &quot;Project&quot; and if you need &#39;extras&#39;:<br>
&gt;&gt;<br>
&gt;&gt; Pipeline pipeline  = new Pipeline(ROOT_URL);<br>
&gt;&gt;<br>
&gt;&gt; pipeline.add(Project.class).endpoint(&quot;foo&quot;).name(&quot;bar&quot;).auth(myAuthMod).build();<br>
&gt;&gt;<br>
&gt;&gt; What do you guys think?<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; &quot;The measure of a man is what he does with power&quot; - Plato<br>
&gt;&gt; -<br>
&gt;&gt; @abstractj<br>
&gt;&gt; -<br>
&gt;&gt; Volenti Nihil Difficile<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; aerogear-dev mailing list<br>
&gt;&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; aerogear-dev mailing list<br>
&gt; <a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Matthias Wessendorf<br>
<br>
blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>
sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a><br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</div></div></blockquote></div><br>