Edition 0 Updated to asp. Net core 0



Yüklə 11,82 Mb.
Pdf görüntüsü
səhifə176/288
tarix12.07.2023
ölçüsü11,82 Mb.
#136458
1   ...   172   173   174   175   176   177   178   179   ...   288
NET-Microservices-Architecture-for-Containerized-NET-Applications

Additional resources 

DevIQ. Domain Entity
https://deviq.com/entity/
 

Martin Fowler. The Domain Model
https://martinfowler.com/eaaCatalog/domainModel.html
 

Martin Fowler. The Anemic Domain Model
https://martinfowler.com/bliki/AnemicDomainModel.html
 
The Value Object pattern 
As Eric Evans has noted, “Many objects do not have conceptual identity. These objects describe 
certain characteristics of a thing.”
An entity requires an identity, but there are many objects in a system that do not, like the Value 
Object pattern. A value object is an object with no conceptual identity that describes a domain aspect. 
These are objects that you instantiate to represent design elements that only concern you temporarily. 
You care about 
what
they are, not 
who
they are. Examples include numbers and strings, but can also 
be higher-level concepts like groups of attributes. 
Something that is an entity in a microservice might not be an entity in another microservice, because 
in the second case, the Bounded Context might have a different meaning. For example, an address in 
an e-commerce application might not have an identity at all, since it might only represent a group of 
attributes of the customer’s profile for a person or company. In this case, the address should be 
classified as a value object. However, in an application for an electric power utility company, the 
customer address could be important for the business domain. Therefore, the address must have an 
identity so the billing system can be directly linked to the address. In that case, an address should be 
classified as a domain entity. 
A person with a name and surname is usually an entity because a person has identity, even if the 
name and surname coincide with another set of values, such as if those names also refer to a different 
person. 
Value objects are hard to manage in relational databases and ORMs like Entity Framework (EF), 
whereas in document-oriented databases they are easier to implement and use. 


202 
CHAPTER 6 | Tackle Business Complexity in a Microservice with DDD and CQRS Patterns 
EF Core 2.0 and later versions include the 
Owned Entities
 feature that makes it easier to handle value 
objects, as we’ll see in detail later on.

Yüklə 11,82 Mb.

Dostları ilə paylaş:
1   ...   172   173   174   175   176   177   178   179   ...   288




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin