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. |