By: J. Brant, J. Yoder
Published in: PLoPD4
Summary: Dynamic creation of formulas and queries for database-reporting applications. A Smalltalk perspective, but still generally applicable.
You need to create a configurable reporting application. Information will be given in a formula based on a database query. Define objects that represent the report that are made up of objects that process and view the data. A report is created by attaching processing objects to viewing objects. Use Query Objects to select data from the database and Formula Objects to operate on the data.
You're using Report Objects and need to create queries for reports at run-time. Create objects that represent queries. Define operations on these objects and a method to return query results.
You're using Query Objects to build dynamic queries. Many reports have similar queries. Build queries out of composable parts. Define one class to represent tables in the database. Define a class that performs each query.
You're using Report Objects where some values are computed. You want the user to create or modify formulas at run-time. Define an object to represent the results of a computed formula. Use Constraint Observer so the result object is consistent with its inputs.
Category: Business Computation, Database
You're using Formula Objects and need to update results when input values change. Create a constraint object responsible for the computation. Use Observer [Gamma+95] to update the constraint when input values change. When the constraint is updated, it evaluates the formula and assigns the result.