What is the entity class?

What is the entity class?

Entity class

It is a conceptual entity class data-intensive classes - their main purpose is to store data and provide access to these data.
In many cases, the entity class is permanent, which means that data is long existed, and need to be stored in a file or database.
The main object oriented modeling and different static entity relationship model frequently used logical database design is that, although both methods between class, class attributes, class relational modeling,
but the object-oriented modeling allows a predetermined static Action class.

Removal in the above "Software UML modeling and design software architecture and embodiment modes with" [p.80].

Defined mainly by the object identification is referred Entity. Entity (entities) have a special modeling and design ideas.
They have a life cycle, their form and content of the fundamental changes that may occur during this period, but must remain an inherent continuity.
In order to effectively track these objects, you must define their identity.
Their class definitions, responsibilities, attributes, and associations must be determined by its logo, without relying on it has the property.

The removal of the above in the "domain-driven design software the core of the complexity of the response to it" [p.58].

Removal of the two sheets are described what entity class, data-intensive, persistence, having a life cycle, the definition of identification.
But none will speak thorough nature of the entity, is the second in particular, seems to increase a logo is the entity.

Entity class is object-oriented static modeling. But the entity itself is a concept, so we need to get to know what is the entity.

Entity concept

And having a true specific things morphology or structure, as can be perceived by people in contact with the hands.
From the point of view of data processing, real-world entity called objective reality, it is the real world, any distinction, something recognizable.
Entity can refer to people, such as teachers, students, etc., may also be referring to things such as books, warehouse.
It not only refers to the objective objects can touch, you can also refer to abstract events, such as performances, football and so on.
It can also refer to the links between things and things, such as student enrollment, customer orders and so on.

In fact, he says in very clear, real-world entity called objective reality .
So it is not like there is not identified entity. I, for example, such as: electricity supplier shipping address system, a customer can manage multiple delivery address,
in order to update certain shipping address will add a logo for the shipping address.
But there are also goods orders shipping address, but he does not care there is no logo, created by everyone to be the value of the object attached to the order class.
With a shipping address class because there is no identity was known to be an entity or value object is wrong. Because he is an entity.
Like some literature suggests one thing to create value for the first target, in case of need identified and then modified to the same entity.
In fact, the value of the object is part of the entity, he can not be independent and meaningful existence. So there is no one thing bothered to establish the technical value of the object or entity.
Some of the properties on an abstract entity into a value object is more specific because clearer and more realistic. Not because identity.

to sum up

It said domain-driven design value object concepts and entities in the entity they are real.
Only by understanding the concepts they are real entities, in order to more clearly use technology to abstract entities and value objects.
In JPAuse the @Entityannotations to represent an entity used @Embeddableto represent the value of the object.
So I hope you can pass this article to understand that not because of the use @Entityor @Embeddableannotations to distinguish entity or value object.
Not because XxxEntity, XxxValueObjectsuch a class named entity or values to distinguish objects.
These are more like stereotype in UML explicit ( stereotype).

For questions, please add QQ group discussion:

image

Released four original articles · won praise 0 · Views 39

Guess you like

Origin blog.csdn.net/tgioer/article/details/104211187