A definition module declares the exported interface of a Modula-2 module. It tells clients which names and data types they can use, while the implementation module supplies procedure bodies and private details. The boundary supports separate compilation and programming abstraction.
For example, a stack interface can declare an abstract stack type and push/pop operations without exposing whether storage uses an array or a linked list. Clients should preserve the declared contract rather than inspecting hidden representation. GNU Modula-2 conventionally stores a definition module in a .def file and parses it when compiling importing modules; it does not compile the definition module separately as executable code.[ref]

Articles by others on the same topic (0)

There are currently no matching articles.