Aspect Oriented Programming vs List<IAction> To execute methods based on conditions
Posted
by David Robbins
on Stack Overflow
See other posts from Stack Overflow
or by David Robbins
Published on 2010-03-31T14:34:29Z
Indexed on
2010/03/31
17:03 UTC
Read the original article
Hit count: 244
I'm new to AOP so bear with me. Consider the following scenario:
A state machine is used in a workflow engine, and after the state of the application is changed, a series of commands are executed. Depending on the state, different types of commands should be executed.
As I see it, one implementation is to create List<IAction>
and have each individual action determine whether it should execute.
Would a Aspect Oriented process work as well? That is, could you create an aspect that notifies a class when a property changes, and execute the appropriate processes from that class? Would this help centralize the state specific rules?
© Stack Overflow or respective owner