一个关于概念的问题

isaacyh 2005-08-29 04:03:17
今天看了看面向对象的书,发现一个问题:

面向对象里有构件、包、子系统的概念。。。。。

那么在C#里分别对应了什么呢??
是不是包对应的就是命名空间,而构件可以有多个包,并且可以含有一些二进制资源、exe、dll等等???
但这种构件和子系统又有什么区别呢??
...全文
160 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
oyljerry 2005-09-01
  • 打赏
  • 举报
回复
UML中的构件图,包图...
isaacyh 2005-09-01
  • 打赏
  • 举报
回复
查了查书,懂了。。。。
构件是物理上的概念,而包和子系统是逻辑上的概念。

Component:

A non-trivial, nearly independent, and replaceable part of a system that fulfills a clear function in the context of a well-defined architecture.

source code component, run time components, executable component

Package:

A package should be used in cases where a set of classes and/or other packages need to be grouped together for model organization purposes.

Though the contents of the package can have public visibility, which makes them visible to model elements outside the containing package, packages are primarily just grouping mechanisms.

Subsystem:

A combination of a package (can contain other model elements) and a class (has behavior)
Realizes one or more interfaces which define its behavior.

A subsystem should be used in cases where a set of classes and/or other packages need to be encapsulated within a container and hidden behind a set of well-defined interfaces.
By convention, none of the contents of subsystem are visible except the interfaces of the subsystem.

This allows subsystems to be easily replaced, and the implementations changed, provided the interfaces remain unchanged.

It offers a degree of encapsulation greater than that of the package.

namhyuk 2005-08-29
  • 打赏
  • 举报
回复
构件应该是指Component吧?
包反而更像是C#里的assembly。
子系统不清楚,ado.net算不算是.net framework的一个子系统呢?
瞎猜的。
namhyuk 2005-08-29
  • 打赏
  • 举报
回复
构件可以有多个包?怎么听起来像是Assembly可以包含多个module,资源,dll呢?
子系统? have no idea

110,529

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧