Environmental Engineering Reference
In-Depth Information
differences in light interception models may not lead to noticeable differences in
simulated potential yield, they may lead to sharp differences when simulating water-
limited production, particularly in arid environments. Further, two alternative
approaches to modelling light interception, say for “homogeneous canopies”, could be
implemented as two composite strategies, and this would allow modelling approaches
to be compared at finer granularity. This kind of composite model provides a sound
foundation for selecting modelling approaches to be used operationally.
Formalizing models in basic units of composition (simple strategies) and in
aggregated units (composite strategies), with the same interface, and decoupling
interfaces and data from modelling equations provides the design infrastructure to
link and populate a knowledge base. The use of semantically rich interfaces fosters
safe re-usability of components as discussed in the introduction. Finally, both
simple and composite strategies are discrete units of code which can be used either
to build components, or even as “full” simulation models to be used in stand-alone
mode, in the latter case still preserving the benefits of a modular system as
described in the introduction. By imposing the same interface on simple, composite
and context strategies, the components obtain the full benefits of the Strategy and
Composite design patterns, making re-use simpler and allowing full extensibility.
Test of Pre- and Post-conditions
Implementing tests of pre- and post-conditions is the central idea of the Design-by-
Contract approach (Meyer 1991) . In DBC software, entities have obligations to
other entities based upon formalized rules between them. A functional specification,
or 'contract', is created for each module. Program execution is then viewed as the
interaction between the various modules bound by these contracts. In general,
routines have explicit pre-conditions that the caller must satisfy before calling
them, and explicit post-conditions that describe the conditions that the routine will
guarantee to be true after the routine finishes. When building biophysical models,
the DBC approach not only ensures the correct functionality of the software, but
also specifies the limits of valid use of the model, which is knowledge about the
model itself. It also allows data of uncertain quality to be used: if an input (either
an exogenous variable or the output of another component) is out of the expected
range, an exception can be raised, both informing the user of the problem and
allowing for exception handling. The DBC approach is implemented in APES via
a utility component developed for the purpose, called Preconditions.
Exception Handling
Exception handling is a programming language construct designed to handle
runtime errors or other problems (exceptions) which occur during the execution of
a computer program. Handling exceptions is of crucial importance in a component
Search WWH ::




Custom Search