Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By KevinWorkman

Thread: What is the difference between an "Entity" and "Value Object"?

  1. #1
    vahini is offline Member
    Join Date
    May 2011
    Posts
    5
    Rep Power
    0

    Default What is the difference between an "Entity" and "Value Object"?

    I have tried to read related posts on the web but couldn't get it Can someone pls explain me with an example. Thanks in advance!

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,693
    Rep Power
    8

    Default

    Could you provide us with some context? Where are you reading these?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    vahini is offline Member
    Join Date
    May 2011
    Posts
    5
    Rep Power
    0

    Default continuation to the question

    I was under the assumption that "Entity" and "Value Object" are same. But they are not.
    Below link has more details. I am not able to get the explanation why they are not same.

    Third World Software... Development: Entity vs Value Object

    Could please help me with an example..

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,693
    Rep Power
    8

    Default

    Honestly, I'm not a fan of over-complicating things by trying to make them fit into design patterns. If you don't understand the purpose of a design pattern, you're probably wasting your time memorizing the terms it uses.

    But check out the wikipedia page here: Domain-driven design - Wikipedia, the free encyclopedia

    From the article:

    Entity: An object that is not defined by its attributes, but rather by a thread of continuity and its identity.

    Example: Most airlines distinguish each seat uniquely on every flight. Each seat is an entity in this context. However, Southwest Airlines (or EasyJet/RyanAir for Europeans) does not distinguish between every seat; all seats are the same. In this context, a seat is actually a value object.

    Value Object: An object that contains attributes but has no conceptual identity. They should be treated as immutable.

    Example: When people exchange dollar bills, they generally do not distinguish between each unique bill; they only are concerned about the face value of the dollar bill. In this context, dollar bills are value objects. However, the Federal Reserve may be concerned about each unique bill; in this context each bill would be an entity.
    vahini likes this.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    vahini is offline Member
    Join Date
    May 2011
    Posts
    5
    Rep Power
    0

Similar Threads

  1. Replies: 3
    Last Post: 10-12-2010, 04:21 PM
  2. Replies: 1
    Last Post: 09-08-2010, 04:08 PM
  3. Replies: 1
    Last Post: 01-21-2010, 09:20 AM
  4. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •