SitePoint Sponsor

User Tag List

Page 5 of 5 FirstFirst 12345
Results 101 to 105 of 105
  1. #101
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by nacho
    Is this wrong?
    Not wrong, but it makes money an entity rather than a value object.
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  2. #102
    SitePoint Addict
    Join Date
    May 2003
    Location
    The Netherlands
    Posts
    391
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, it does. I guess I could live with it though.
    There’s more than one way to skin a cat.

  3. #103
    SitePoint Zealot johno's Avatar
    Join Date
    Sep 2003
    Location
    Bratislava, Slovakia
    Posts
    184
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by thr
    The only thing I have against the whole "doing it from SQL" is the fact that it's Objects we're mapping onto SQL and not the other way around. I'm realy considering an XML-approach just to get all the features I wan't without tying me to a specific DB.
    I would definitely go the way defining schema in PHP (lastcrafts aproach) or XML. You can add this MySQL5 specific stuff anytime.
    Annotations support for PHP5
    TC/OPT™ Group Leader

  4. #104
    ********* Victim lastcraft's Avatar
    Join Date
    Apr 2003
    Location
    London
    Posts
    2,423
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi...

    Quote Originally Posted by nacho
    Yes, it does. I guess I could live with it though.
    In the context of persistence it will drive you mad.

    Regarding Money being made up of the amount and the currency, Postgres has a composite type facility. I think other database systems (not MySQL) have similar facilities.

    Going the XML route will solve this problem quite easily. I managed to get "Changes" to return objects of arbitrary classes, and it's espcially easy if you are using serialisation.

    yours, Marcus
    Marcus Baker
    Testing: SimpleTest, Cgreen, Fakemail
    Other: Phemto dependency injector
    Books: PHP in Action, 97 things

  5. #105
    SitePoint Guru
    Join Date
    Nov 2002
    Posts
    841
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Associating quantity and units is a more general domain pattern. For example, in continuous process manufacturing, one cannot express quantity without units. You can order 7 tractors, but you cannot order 7 molasses. In some industries the potential for rounding errors means that you always have to associate quantity and units. In my old industry, one could never leave behind the units expressed on the order, say by converting to a common unit. The resulting rounding errors could (and historically had) result in product that exceeded the capacity of its container.


Bookmarks

Posting Permissions

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