posts - 14,  comments - 51,  trackbacks - 0
在概要设计时,发现参与讨论的人对什么是模块,模块的划分根据是什么的认识有很大的差异。
我也不敢乱下定论,还是看看书本是怎么说的:
---------------------------------------------------
1 .参考一下《软件架构艺术》一书,Stephen T. Albin  在里面描述:

Modules are discrete units of software (binary and source). Binary modules are instantiated at run time and these instantiations are commonly called components and connectors. A given module may contain the specifications for several component types and connector types. The component (instances) may be of a fixed number in some situations. For example, a Web server executable, when launched, results in a single Web server component instance. The Web server module is the binary code that exists as a set of program files. The Web server component is a running instance of the Web server.

I have seen some confusion over the use of the terms module, component, and connector. A module is a discrete unit of design that is composed of a hidden set of elements and a set of shared elements. Modules have high internal cohesion and low external coupling. Modules may represent the physical packaging of the application's binary code, which can be described further by component types and connector types. Components and connectors describe the physical instantiation of a system. The term component is often used to mean a component type or module. A module refers to a unit of software that can be designed, implemented, and compiled into a deliverable executable system or subsystem; it is a unit of execution. A component is a runtime entity, the definition of which exists in a module. A classic modular architecture is a client-server system. The client and the server are two modules. The server exports some elements such as a set of publicly visible relational database tables and views. The client knows about this publicly visible schema. The client and server are unaware of the internal composition of the other.

那么按红色部分来说,如果说一个dll或一个Exe里由多少个模块组成这将是的笑话了。
2 .参考Mary shaw的《软件体系结》:
    模块式软件被划分成独立命名的,并可被独立访问的成分。模块划分,粒度可大可小。划分依据是对应用逻辑结构的理解。
这个定义,似乎有没有《软件架构艺术》那么严格。没有定义具体什么为“被独立访问”的成分。
3. 《Documenting_Software_Architectures》
   A module tends to refer first and foremost to a design-time entity. Parnas's foundational work in module design (1972) used information hiding as the criterion for allocating responsibility to a module. Information that was likely to change over the lifetime of a system, such as the choice of data structures or algorithms, was assigned to a module, which had an interface through which its facilities were accessed.
    其说,模块是设计时的实体,特点是信息隐藏和能通过模块的接口访问。在介绍模块视图时他说:
    A module is a code unit that implements a set of responsibilities. A module can be a class, a collection of classes, a layer, or any decomposition of the code unit. Every module has a collection of properties assigned to it. These properties are intended to express the important information associated with the module, as well as constraints on the module. Sample properties are responsibilities, visibility information, and author. Modules have relations to one another. Example relations are is part of or inherits from.
---------------------------------------------------

不同的作者有不同的看法,但综合一下,我认为模块因该是一个独立设计的单元,并为其他模块提供访问接口。也就是说,他是一个架构中的设计元素,但不限制他的存在模式,也就是他是提供了可访问接口而且实现某一功能的一个实体,可以是一个类或一组类或可执行程序等。
  

posted on 2008-12-02 11:21 名羽 阅读(304) 评论(0)  编辑 收藏 引用 所属分类: project sum up

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理