Creating tasks without a user-provided ID is a must for usability. The generated ID will
be the database ID converted to string.
As for task creation, I concur with Joram that (ab-)using the setters for a fluent
interface goes against the JavaBeans design principles. Introducing a set of methods
called withXXX to the Task interface is also a no-go because they mostly duplicate the
setXXX methods.
I propose introducing a TaskBuilder buildTask() method to the TaskService, and move the
withXXX methods to TaskBuilder. Actually I'd prefer to drop the "with"
prefix, as follows.
Task task = taskService.buildTask()
| .name("test")
| .dueDate(today)
| .asignee(me)
| .done();
TaskBuilder does not even have to be an interface, because it simply delegates to methods
in the Task interface.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4195136#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...