in

The ORM Foundation

Get the facts!

Why are dates modeled as Objects and not Values?

Last post Wed, May 6 2009 7:29 by Roger Cass. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • Mon, May 4 2009 9:36

    • Roger Cass
    • Top 25 Contributor
      Male
    • Joined on Thu, Apr 23 2009
    • Dayton, OH, USA
    • Posts 30

    Why are dates modeled as Objects and not Values?

    I am still coming up to speed with ORM and using it to convert a logical ER diagram into something more easily understood by our business partners. It did not take me long to run into a temporal concept, which led me to deal with dates. I note that the examples and papers show modeling dates as Objects and not Values. This has me a little confused. Perhaps I am still thinking too much about a date being a fundamental type in other modeling and development systems. On the other hand, there appears to be no built-in reference mode for dates. What would be the recommended reference mode? Number?
  • Mon, May 4 2009 15:17 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 805

    Re: Why are dates modeled as Objects and not Values?

    Hi Roger,

    Welcome to ORM!
    Yes - I understand that the terminology can be confusing so I hope that the following explanation helps. 
    Ken

    Objects: ORM uses the concept of an "Object Type" which is not the same as an object in OO.
    An ORM Object Type can be either an "entity type" or a "value type".

    The "date" data type:  If you are using NORMA, then you will find a data type called "CE". This stands for "Christian Era".
    The following example uses the object type "Date(.CE)"
    As you can see, there is only one ORM "date" object but the relational mapper has mapped the single "date domain" to two completely different concepts in two different tables (viz. date of birth and company formation date).


    Filed under:
  • Wed, May 6 2009 7:29 In reply to

    • Roger Cass
    • Top 25 Contributor
      Male
    • Joined on Thu, Apr 23 2009
    • Dayton, OH, USA
    • Posts 30

    Re: Why are dates modeled as Objects and not Values?

    Excellent explanation and example--just what I needed to know. Thank you.
Page 1 of 1 (3 items)
© 2008-2024 ------- Terms of Service