Aggregation files

Back to Recurring programming techniques in Pastel

An aggregation file is a header file which includes other header files hierarchically. Aggregation files gather together logical groups of functionality, such as reporting, or testing. Aggregation files reduce the complexity of using a library, since they relieve the user from being required to remember a large amount of file names.

Aggregation hierarchy

The aggregation files form a tree hierarchy. On the highest level, a whole sub-library, such as PastelSys, can be included by a single header file. On lower levels, one could include all stuff related to discrete random variables. The aggregation files mostly coincide with the documentation hierarchy, which is natural since both the documentation hierarchy and the aggregation hierarchy follow a logical grouping. The example below visualizes the hierarchy of a few selected aggregation files.

pastelsys.h
    random.h
        random_goodness.h
        random_discrete.h
        random_continuous.h
        ...
    testing.h
        ...
    reporting.h
        ...
    ...
...

Aggregation detail

Aggregation files can easily bring unneeded stuff into scope. If this ever proves to be a problem, the user can adaptively decompose the inclusion into lower levels.