Initializing help system before first use

Modules vs. packages

Release 2.0 of Mosel introduced the possibility to write libraries for Mosel directly in the Mosel language, such a library is called a package. Packages are used from a Mosel model in exactly the same way as modules, namely by specifying their name in a uses statement. However, from the implementation and functionality points of view the two ways of writing Mosel libraries are not the same and the choice between packages and modules depends largely on the contents and intended use of the library. In some cases it may be convenient to split the implementation of a library into two parts, one as a module and the other as a package. If a module and a package on the specified DSO path have the same name, the package will be loaded by Mosel.

The following list summarizes the main differences between packages and modules.

  • Definition
    • Package
      • library written in the Mosel language
    • Module
      • dynamic library written in C that obeys the conventions of the Mosel Native Interface
  • Functionality
    • Package
      • define
        • symbols
        • subroutines
        • types
    • Module
      • extend the Mosel language with
        • constant symbols
        • subroutines
        • operators
        • types
        • control parameters
        • IO drivers
  • Efficiency
    • Package
      • like standard Mosel models
    • Module
      • faster execution speed
      • higher development effort
  • Use
    • Package
      • making parts of Mosel models re-usable
      • deployment of Mosel code whilst protecting your intellectual property
    • Module
      • connection to external software
      • time-critical tasks
      • definition of new I/O drivers and operators for the Mosel language

With every module example in this manual we shall discuss the possibilities of implementing similar functionality as a package. For a detailed introduction to writing packages the reader is refered to the chapter 'Packages' of the Mosel User Guide.


© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.