Cours The modular concept, tutoriel & guide de travaux pratiques en pdf.
The modular concept
The concept of the module has long been in use in the engineering field. \Ve find it for example in the implementation of electronic devices where we find slide-in modules which contain complete functional units. The advantages are obvious, the modules can be developed, produced, tested and even repaired as self-contained units. The use of modules also enables substantially reduced costs because it is possible to refer to proved solutions for certain functions.
The same motivations which promoted the introduction of modules in engineering also apply in the field of software development. Because, today. software is no longer created by an elite group of programming wizards, but wit.~in an industrial framework, it is absolutely essential to produce the software in a properly structured and modularized fonn.
A certain amount of modularization is already to be found in most commonly used programming languages in the procedure. Procedures already enable a problem to be subdivided into smaller part problems. The parameter mechanism permits an exact specification of the interface for solving a part problem. The implementation of the solution remains « hidden » in the individual procedure. Because, however, the data defined within the procedure exists only during the execution of the procedure, commonly used so-called global data must remain visible for all program parts. It cannot be guaranteed therefore that a special implementation (definition of the data structure) of the global data will not be used within a procedure. In large projects this leads to incomprehensible complexity of the system because changes to the implementation of the global data have effects in many (unexpected) places.
An effective solution to the problem is created here in Modu1a-2 by the concept of the module and the associated concept of data encapSUlation. A module makes it possible to hide both data and procedures and their implementation. In this way it is possible to combine individual part problems of a larger system. Each module has an external interface which precisely defines all operations of the module. Once this interface has been defined, the module can be used independently of the actual implementation because the details are not visible to the user. We speak in this context of information hiding.
We can differentiate between various classes of modules:
(1) Function modules make available to the user a series of functions. but themselves do not contain their own (internal) data objects.
(2) A so-called data module (abstract data structure) contains its oVi.l1 data objects and makes procedures available for manipulating these objects. The objects are of course only accessible from outside via these procedures. A data module contains only a copy of the data object.
(3) An abstract data type is defined by the definition of a type name and the operations required to process the type. The operations also embrace here the generation of new copies of the data type. All the operations are parametrized with the respective copy of the type.