AEROGEAR-593 - Builder pattern isn't consistent
by Bruno Oliveira
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
12 years, 1 month