摘要
在模块化程序设计过程中,当将问题分割成模块后,就要建立各模块间的相互作用方式及通信方式,该技术称为模块接口技术。软件工程的一个最基本的原则是将接口和实现分开,头文件是一项接口技术,实现的代码部分就是源程序文件。头文件要提供一组导出的类型、常量、变量和函数定义。模块要导入对象时,必须包含导出这些对象的模块的头文件。设计接口的一般原则是:保持接口的稳定、内部对象私有化、巧妙使用全局变量、避免重复包含。
In modeling programming, the interactive way and communication way should be built when the program is divided into several parts. This technology is called module interface technology. A basic principle of software engineering is to design interface part and realizing part independently. Head file is a technology of interface, while source program file is the code part realizing the program function. Head file provide a set of educed types, constants, variables and function defination. The module must include the head files exporting the objects when the module imports objects. The general rule to design interface is keeping the stability of the interface, holding private inside objects, using the global variables skillfully, and avoiding repeatedly inclusion.
出处
《山东建筑工程学院学报》
2004年第2期55-57,共3页
Journal of Shandong Institute of Architecture and Engineering
关键词
多模块
接口
头文件
程序设计
multi-module
interface
head file
programming