Home   Info   DevZone   Wiki  
UsersWeb  |  MainWeb  |  InfoWeb  |  DevZoneWeb  |  SupportWeb
ClassResponsibiltiesAndCollaboration ] [ not logged in ] [ Web: Imported ] goto:  options
[ get info on or edit ] login or new user ] [ list of topics, hubs & nodes, or recent changes ]

CRC cards are used to easily create the template for coding a class. During the partitioning of a program into classes, you should use CRC cards (and write on them with a pencil) to construct the members and methods that a class has. You should denote only public interfaces on the card since you are not implementing the class yet.

The responsibilities of a class are the things that are most important to helping you decide if you have the right object model. As collaborations increase, the resulting coupling of classes will tell you that perhaps your object models is not quite right. Typically one uses 5x3 index cards (or 4x6 if your writing is large) for such an exercise.

Later when you have a preliminary set of responsibilities and members, you can perform some walkthoughs of execution senarios to give you further insight into what class will be doing what in the object model.

When you are done, put the cards up on a wall and draw lines between them depecting all interactions between classes (collaborations where one class uses another). When you finish this task, look for cases where a class proxies a task, and for classes that are highly interactive with the others. Make sure this is what you want. You may often see the ModelViewController pattern/model fall in your lap.

This is not a bad thing, but you should make sure that this is what you want.

-GreggWonderly




Content of these pages are owned and copyrighted by the poster.
Hosted by: