Level Of Hierarchy

This is not PatternNormalForm? yet, but here goes.

Context: You have a lot of records. The client says "organize these records by A, then B, then C, then D." You are to provide some kind of navigation or reporting among the possibilites for A, then for B, then C, and finally D, after which you access individual records.

How to use: The core concept here is one of grouping. You have four (or however many) layers of grouping all feeding into each other. So you want a component that handles grouping in the general case. You parameterize these components with whatever it is that they group by. You connect them in a row, and at the end is a component that provides individial records instead of groups.

Trade-offs: It's much easier to reconfigure (or dynamically configure) the components above than it is to re-write special-case code for when the client wants to see the records organized by C, then A, then D, then B. Or if he decides to add E, or drop C. On the other hand, there's an up-front investment in design for the programming language and reporting format, and junior-level programmers might find the InversionOfControl terrifying, especially if they think you work for them.

I would like to see an actual UseCase. It is unclear to me whether this is a report-writer issue, or something deeper. One should be careful to use dynamic queries rather than hard-wire stuff into hierarchies because other users of the info likely will want other views.


EditText of this page (last edited April 14, 2010) or FindPage with title or text search