Model Architecture and Design Approach #17096/HEAD / v10 |
Tags:
not added yet
Model Architecture and Design ApproachIntroductionThere are a few simple concepts to master in order to create and use models in OMS. Like other modeling frameworks such as OpenMI (Gregersen 2007), CCA (Bernholdt 2006), ESMF (Collins 2005), and CMP (Moore2007), OMS adheres to the notion of objects as the fundamental building blocks for a model and to the principles of component based software engineering for the model development process.Component-based software engineering (CBSE) has existed in one form or another for several years. The advantages of constructing modular software are well known within the software community. Modularity is a general concept which applies to the development of software in a fashion which allows individual modules to be developed, often with a standardized interface to allow modules to communicate. In fact, the kind of separation of concerns between objects in an object-oriented language is much the same concept as for modules, but on a larger scale. Typically, partitioning a system into modules helps minimize coupling, which should lead to 'easier-to-maintain' code. Initially, software components were viewed almost exclusively as source code modules. In recent years, however, the popular use of the term software component has been with reference to so-called “binary” components. Binary component are individual software artifacts that exist in compiled form, and are typically ready for distribution. A wide variety of technologies have been developed to support the packaging of binary components. OMS as a framework is object-oriented, the models within the framework are objects or components as understood in CBSE. However the design of OMS is unique in one important aspect. It is considered non-invasive and sees models and components as plain objects with meta data by means of annotations. Modelers do not have to learn an extensive object-oriented application programming interface (API), nor do they have to comprehend complex design patterns. Instead OMS plain objects are perfect fits as modeling components as long as they communicate the location of their (i) processing logic, and (ii) data flow. Annotations do this in a descriptive, noninvasive way. Non-invasive lightweight frameworks principles based on plain objects have proven successful in other application fields (Richardson2006) and are expected to pay dividends for agro-environmental modeling. Why is a non-invasive approach important?
In the graphic above, OMS system components interact with science components through annotations (metadata). This separation enables the science components to be formed into models outside of OMS without disentangling the code. Also note that modelers make OMS system components interact with science components using a domain specific language (DSL) designed for OMS modeling, precluding the need to understand the more complex OMS API. Since OMS is a non-invasive modeling framework, the modeler does not need an extensive knowledge of object-oriented principles to make model-framework integration happen. Creating a modeling object is very easy. There are no interfaces to implement, no classes to extend and polymorphic methods to overwrite, and no framework-specific data types to replace common native language data types. Instead OMS uses metadata by means of annotations to specify and describe "points of interest" for existing data fields and methods for the framework. Annotations are explained in detail in subsequent sections of this workbook. Within a modeling object any complex internal object-oriented design can be used as needed, however, the framework does not depend on any object-oriented contract.
Modular Component Based DesignComponents comprise the main building blocks of simulation models in OMS. Traditionally, scientific applications are designed as large blocks of hand-crafted code, which usually results in a monolithic application. Such model applications are not designed to have parts of them easily re-purposed to subsequently create a related application. A major disadvantage of building monolithic simulation models is that conceptual boundaries within the model are not captured or not there at all.With OMS, we understand a component ideally to represent one scientific concept, manifested as a plain (Java) object with annotations. A component can be hierarchical, it may contains other, finer grained components contributing to the larger concept. It is a "black-box" that exposes its framework relevant information via meta data. A component represents a sufficient level of complexity so that someone can use it in an executable simulation. A single component can become a model, however, a model usually is the top level component within a component hierarchy. A large legacy monolithic model containing multiple concepts can be represented as a single component in OMS. It also can be re-factored into components and re-built as a component hierarchy. Whether deconstructing a legacy model or creating one from the ground up, a modeling team must decide on the granularity of the components in the design of the model. This mostly is a judgement call based on the modeler's knowledge of the scientific concepts involved.
The figure above shows the basic structure of an OMS component. Like all modeling frameworks OMS provides for the same features:
As pointed out in (Peckham2008), an "Initialize #Run #Finalize" (IRF) is a common life cycle for almost all simulation models. OMS provides annotations allowing the modeler to specify these framework requirements on top of the plain object.
The component approach takes object-oriented designs to the next level. While object-oriented design methods focus on abstraction, encapsulation, and localization of data and methods, they can also lead to simulation systems where objects are highly co-dependent. To remove this limitation, a more structured process was introduced in model development and applied to OMS: component-oriented modeling. It emphasizes the component as object-oriented software which can be developed and tested independently, and delivered as a unit. It provides its services through well defined interfaces. Component implementations in general have proven to support reuse in a more efficient way than just using object-oriented methods. There are some general benefits of using components for building complex systems.
The use of components helps face the challenge building complex simulation models by reducing model software complexity and overcome the limitations of monolithic, highly coupled model implementations. Model Base of ComponentsOMS also introduces the concept of a model base, considered to contain two or more instances of a model designed to address the modeling needs of a customer. For example, the customer may require a model apply to business scenarios across diverse regions. Therefore the solution could involve several instances of the model, each modified, configured, and validated for a particular region. The model base therefore contains all of the components used to create instances of the model.The customer may require a model be used in different contexts within a business function, and the solution may involve model instances that fit into the various business work flows. Knowing these requirements up front is important for architecting the model and deploying as instances aligned with business needs. The model instances should be managed as a model base. Model base components (including the model and its instances) should be managed within an OMS modeling project and stored in the OMS Component Library.
Model Control With OMS System ComponentsFORTRAN modelers can forego using OMS for model control by creating a FORTRAN module containing iteration and conditional controls, and connecting it to the science components. The entire model can be created on the FORTRAN side, and if the components (modules, subroutines, or functions) are properly annotated, the model can be built to interact with the various OMS tools for calibration, analysis, and visualization. However, OMS provides several system components for model control that can be very useful and efficient. With this approach, OMS provides model control, and FORTRAN provides the science. How to specify OMS model control is covered in the DSL section later in this workbook and through exploring how it is done in the oms3.prj.csm project.
Model Structure
ReferencesArgent, R.M. An overview of model integration for environmental applications—components, frameworks and semantics Environmental Modelling & Software, Volume 19, Issue 3, Pages 219-234, Mar 2004Bernholdt D.E. and Allan B.A. and Armstrong R. and Bertrand F. and Chiu K. and Dahlgren T.L. and Damevski K. and Ewasif W.R. and Epperly T.G.W and Govindaraju M. and Katz D.S. and Kohl J.A. and Krishnan M. and Kumfert G. and Larson J.W. and Lefantzi S. and Lewis M.J. and Malony A.D. and McInnes L.C. and Nieplocha J. and Norris B. and Parker S.G. and Ray, J. Shende and S. Windus, T.L. and Zhou, S. "A Component Architecture for High Performance Scientific Computing", Journal of High Performance Computing Applications, ACTS Collection Special Issue, May 2006 Collins, N., G. Theurich, C. DeLuca, M. Suarez, A. Trayanov, V. Balaji, P. Li, W. Yang, C. Hill, and A. da Silva. Design and Implementation of Components in the Earth System Modeling Framework. International Journal of High Performance Computing Applications, Volume 19, Number 3, pp. 341-350. 2005 David O., S.L. Markstrom, K.W. Rojas, L.R. Ahuja and I.W. Schneider, The Object Modeling System. In: L.R. Ahuja, L. Ma and T.A. Howell, Editors, Agricultural System Models in Field Research and Technology Transfer, Lewis Publishers, Boca Raton (2002), pp. 317–330. Gregersen, J.B., Gijsbers, P.J.A., and Westen, S.J.P., (2007). Open Modelling Interface. Journal of Hydroinformatics, 9 (3), 175-191. 2007 Moore, A.D., D.P. Holzworth, N.I. Herrmann, N.I. Huth, M.J. Robertson, The Common Modelling Protocol: A hierarchical framework for simulation of agricultural and environmental systems. Agricultural Systems, Volume 95, Issues 1-3, Dec 2007, Pages 37-48 Peckham, S: CSDMS Handbook of Concepts and Protocols: A Guide for Code Contributors, http://csdms.colorado.edu/wiki/Help:Tools_CSDMS_Handbook, 2008 Richardson, C: POJOs In Action. Manning Publications. Jan 2006 Rizzoli, A.E., Leavesley, G.H., Ascough II, J.C., Argent, R.M. Athanasiadis, I.N., Brilhante, V.C., Claeys, F.H., David, O., Donatelli, M., Gijsbers, P., Havlik, D., Kassahun, A., Krause, P., Quinn, N.W., Scholten, H., Sojda, R.S., and Villa, F. 2008. Chap. 7: Integrated modelling frameworks for environmental assessment and decision support. In: Environmental Modelling and Software and Decision Support – Developments in Integrated Environmental Assessment (DIEA), Vol. 3, A.J. Jakeman, A.A. Voinov, A.E. Rizzoli, and S.H. Chen (Eds.), pp. 101-118. Elsevier, The Netherlands. Rizzoli, A.E., Svensson, M.G.E., Rowe, E.C., Donatelli, M., Muetzelfeldt, R., van der Wal, T., van Evert, F.K., Villa, F.:Modelling Framework (SeamFrame) requirements. SEAMLESS report no. 6, Dec 2005 |
Navigation Bar for Object Modeling System
Resources:
Downloads You must login to see this link. Register now, if you have no user account yet. OMS API Javadoc Publications & Presentations Annotation Reference DSL Reference Handbook 3.0 (Draft) Frequently Asked Questions (FAQ) OMS License (LGPL 2.1) New Users: 1. Get an ALM account 2. Join the OMS project Contact Us: Jack Carlson Coordinator, OMS Laboratory OMS Laboratory Jack.Carlson@colostate.edu (970) 492-7323 Olaf David Director, OMS Laboratory odavid (at) colostate.edu (970) 491-8026 |