Agent classes irrelevant

From CSSEMediaWiki
Jump to: navigation, search
Agent classes are often placed in the analysis model of an application. During design time, many agents are found to be irrelevant and should be removed.. --Riel's Heuristic 3.10, Arthur Riel 1996

The goal of this heuristic is to keep the data and meaningful behavior within the object that the agent class would interact with and to reduce the number of classes in a system. According to Riel, creating a librarian agent class to sort books and other book related functions would strip meaningful behavior from the bookshelf class and turn it into a class that only had data. Riel suggests that one should just not have the agent class and keep the book sorting (and other book related functions) within the bookshelf class. Additionally, Riel states that agent classes are created to satisfy our real world understand of objects, which is why the thought of books arranging themselves in shelves seems disturbing.

Personal tools