In the examples provided for all state task types, the injection of a service is shown.  It is easy for state tasks to get large and complicated in ways such as:

  • Complex branching logic around decision making in the task.
  • A large number of dependencies being injected

Both of these conditions tend to point to the idea that the object is losing it’s focus.  Remember that instead of complex branching logic, you can also have many smaller objects which just results in a more descriptive fluent configuration.  The upside is that there are fewer seemingly “magic” components in lieu of many well described components.

As for large dependency counts, this often times points to your task taking on coordination responsibilities that are often times best refactored into other objects.

Last edited Dec 31, 2010 at 8:19 PM by sdhebert, version 1


No comments yet.