Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Value objects

Pragya Keshap answered on February 19, 2023 Popularity 8/10 Helpfulness 1/10

Contents


More Related Answers

  • object.value()
  • object values javascript
  • javascript get object property with variable
  • how to get values of oject js
  • Object.values returns
  • object values
  • define object property js
  • Object.Values () javascript
  • js create object with properties
  • js create object with properties
  • how to a property from a JavaScript object
  • object.values()
  • javascript of the object properties to a single variable
  • ... in objects

  • Value objects

    0

    Value objects (VOs) simplify a design. Entities have traits such as an identity, a thread of continuity, and attributes that do not define their identity. In contrast to entities, value objects have only attributes and no conceptual identity. Best practice is to keep value objects as immutable objects. If possible, you should even keep entity objects immutable too.

    Entity concepts may bias you toward keeping all objects as entities, as a uniquely identifiable object in the memory or database with life cycle continuity, but there has to be one instance for each object. Now, let's say you are creating customers as entity objects. Each customer object would represent the restaurant guest, and this cannot be used for booking orders for other guests.

    This may create millions of customer entity objects in the memory if millions of customers are using the system. Not only are there millions of uniquely identifiable objects that exist in the system, but each object is being tracked. Tracking as well as creating an identity is complex. A highly credible system is required to create and track these objects, which is not only very complex, but also resource-heavy. It may result in system performance degradation. Therefore, it is important to use value objects instead of using entities. The reasons for this are explained in the next few paragraphs.

    Popularity 8/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 19 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.