📜  组件和对象之间的区别

📅  最后修改于: 2021-08-27 06:34:00             🧑  作者: Mango

1.组成部分:
组件是对象的集合,这些对象为不同的系统提供了一组产品。它们具有许多与对象经常发生的元素。组件也可以在本地或分布式方式下运行。存在许多本地运行组件的示例,这些示例通常用于向外部程序提供精确的性能。组件是一个独立的实体,可以将性能导出到周围环境,还可以使用定义良好的开放式接口从周围环境中导入功能。 。组件为不同的结构提供产品,并使用引用的界面与不同的结构进行交互。

2.对象:
对象是一个真实世界的实体,它是一束数据及其行为(通常被认为是方法)。这些现实世界的对象共有两个特征,它们具有状态和行为。例如,房屋是具有地址,颜色(状态)和打开窗口,关闭门(行为)的对象。对象是掌握面向对象技术的关键。从类创建对象,因为类为对象提供了设计图。

组件和对象之间的区别:

S.No. Component Object
1. A component can be considered as a series of one or more classes. An object is created from the class.
2. Components use continual storage. Objects have a local state.
3. Components are like black boxes. Objects are characterized via a white box.
4. Components have a greater massive set of intercommunication mechanisms. Objects commonly use Messaging mechanisms.
5. Components assist third party composition. Objects do now not assist plug and play through the third party.
6. A component can be implemented in any programming language unlike a object. An object can be implemented only in Object oriented programming language.
7. A component have persistence. An object does not have persistence.
8. A component is usually static. An object is dynamic.