by kastephens · 14y ago · 0 comments
Complex logic interacts with complex object graphs, not individual models. Therefore, complex logic does not belong in models or controllers (or views). Complex logic belongs in instantated objects (not modules) that represent complex logic. This style may also be known as the "Strategy" Design Pattern.
Strategy objects can have state during their activities, this is why they should be instantiated.
Strategy objects simplify testing because they can be connected with any object graph that presents the same interfaces as the target object graphs.
This leads to interchangable Strategy objects that represent generic behavior which can be applied to actual, simulated or speculative object graphs.
No comments yet.