Similarity:
From the perspective of software engineering, the two concepts are the abstraction of behavioral entities in application systems and software systems at different levels, supports natural modeling of behavioral entities in application systems and software systems, and guides the final implementation of the system. Software systems can be constructed as basic module units of software. different degrees of encapsulation and Information Hiding mechanisms are provided to facilitate maintenance, reuse, and high-quality software systems.
Differences:
1. Definition method:
An object encapsulates attributes and operations and can exchange information with other objects. It can be seen that objects depict the components, functions, and relationships of entities.
The entity that resides in an environment and can execute actions autonomously and flexibly to meet the design objectives. It can be seen that the internal structure is not defined, and only external features are described. The subject is a black box, and its internal structure is unknown.
2 degree of Abstraction:
Objects define the internal structure of objects, which is closer to the computer world.
The subject only expresses external characteristics, which is closer to people's intuitive understanding of real-world entities and has a higher abstraction level.
3. Autonomy
The object can operate on its own attributes. If the object method (public) is activated by another object in the form of a message, it is executed. Therefore, the execution of object methods is controlled by other objects. The autonomy of objects is more reflected in the control of internal states, without the autonomy of behavior.
Autonomy is the basic attribute of the subject, and the subject can control its own status and behavior.
4. Flexibility
The subject has different degrees of flexibility, and the object has limited flexibility, such as a simple stimulus response.
5. Running continuity
In order to achieve the design goal, the subject generally needs to continuously run and interact with the environment in the environment.
The object runs intermittently. After receiving the message, run the code, and then wait.
6 interaction nature
To be continued
.................................