The theory of what we call M-modules for model-driven modules is developed. An M-module is a knowledge-based program module in which the knowledge is encoded as a model that remains available for modification or adaption to meet changing requirements. The methodology of M-modules can help the system designer to make effective use of the decomposition properties of a complex problem. It helps him to decompose an application problem into a hierarchy of subproblems that are much more easily understood and managed by a human user. An important feature that makes the decomposition useful is the methodology orders system operations in a way that prevents deadlock and that contributes to avoiding other system malfunctions. An M-module contains three components a model, a set of values, and a set of procedures. The model encodes knowledge about the domain that is the responsibility of the M-module. The set of values describes the M-modules current information about that domain to the level of detail relevent to the M-module. The procedures are those necessary to modify or retrieve information contained in the set of values or to modify or retrieve the model of the procedures. The M-module accepts information or demands from outside itself--either from a user or from another M-module--and responds according to its internal condition and the constraints of its model. A key aspect of M-modules is that it leads to a hierarchical system design.