Thursday, June 4, 2009

Putting Methods on Classes

This is the essence of interaction modeling. It's also hard. A cow needs milking. Does the cow object milk itself, or does the Milk object "de-cow" itself? Convert controllers from robustness diagrams to sets of methods and messages that embody the desired behavior. An object should have a single "personality". Avoid schizophrenic objects. If you have objects with split personalities you should use aggregation.

Use CRC cards to help. Behavior allocation is of critical importance. Don't show message parameters on your sequence diagrams. Which Methods Belong With Objects Reusability - the more general, the more reusable? Does this method make the class more or less re usable? Applicability - is there a good fit between the object and method Complexity - is it easier to build a method in another object? Implementation knowledge - does the implementation.

The behavior depends on details internal to the associated method? Completing Interaction Modeling Drawn all needed sequence diagrams. Updated your static model. Last stop before you start coding; Critical Design Review is essential. Model additional aspects of your system. Most useful in real-time system design. Collaboration diagrams are similar to sequence diagrams.

No comments:

Post a Comment