User Tools

Site Tools


how_do_i_code_recursive_system_operations_in_dci

How do I code recursive system operations in DCI?

There is nothing special about recursion in general in DCI, it can be done where it's deemed useful. It's important to remember however, that Roles cannot be rebound during a System operation and its following Interaction.

If you do a recursion on a whole System operation though, it's common that you want to rebind Roles at the recursion point. There are a few ways of doing that:

  1. Instantiate another Context at the recursion point, and call its System Operation
  2. Call the atomic “Bind Roles” method right before calling the System Operation again.

The choice is implementation- and convention-based. If you bind Roles only in the constructor, the first option could be more convenient.

Multiple calls to the “Bind Roles” method may not be a good idea. See: Can I rebind roles to objects multiple times over the lifetime of a Context object?

how_do_i_code_recursive_system_operations_in_dci.txt · Last modified: 2014/12/05 14:04 by jcoplien