An implementation module supplies the executable procedures and private declarations behind a Modula-2 module interface. Its associated definition module determines which declarations clients may import. This separation lets clients depend on an interface while the implementation selects a representation.
For example, a counter module can export a procedure Next while storing a private running count. Its implementation module defines how Next updates and returns that count; clients need not know the private variable's name. Replacing the storage mechanism is possible when the exported behavior remains compatible. The GNU Modula-2 manual illustrates separate definition and implementation source files, then compiles implementation modules before linking them into a software library.[ref]

Articles by others on the same topic (0)

There are currently no matching articles.