[aerogear-dev] AEROGEAR-593 - Builder pattern isn't consistent

Bruno Oliveira bruno at abstractj.org
Thu Nov 1 07:03:01 EDT 2012


Good morning everyone! Lay out your costumes from halloween and let's talk about this jira (https://issues.jboss.org/browse/AEROGEAR-593).

Passos did a great work creating a builder for Pipes and of course we can improve it more and more, it's all about software. Currently to create a Pipe we must do it:

Pipeline pipeline  = new Pipeline(ROOT_URL);
pipeline.pipe().name("tasks").useClass(Task.class).buildAndAdd();
pipeline.pipe().name("tags").useClass(Tag.class).buildAndAdd();


Chatting with Matthias we agreed that would be better 2 alternatives:

Pipeline pipeline  = new Pipeline(ROOT_URL);
pipeline.add(Project.class).build();


Doing just this implicitly means that the name of the pipe will be "Project" and if you need 'extras':

Pipeline pipeline  = new Pipeline(ROOT_URL);
pipeline.add(Project.class).endpoint("foo").name("bar").auth(myAuthMod).build();

What do you guys think?


-- 
"The measure of a man is what he does with power" - Plato
-
@abstractj
-
Volenti Nihil Difficile


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-dev/attachments/20121101/c0ccd4d9/attachment.html 


More information about the aerogear-dev mailing list