[jbpm-dev] [Design of JBoss jBPM] - Re: task component interface comments

alex.guizar@jboss.com do-not-reply at jboss.com
Mon Dec 8 14:00:17 EST 2008


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#4195136

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4195136



More information about the jbpm-dev mailing list