in

The ORM Foundation

Get the facts!

How to model maximum rental period for a year

Last post Thu, Sep 17 2015 22:45 by jacobvos. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • Thu, Sep 17 2015 13:01

    • jacobvos
    • Top 25 Contributor
      Male
    • Joined on Mon, Jan 21 2013
    • The Netherlands
    • Posts 39

    How to model maximum rental period for a year

    Hi,

    I am looking how to model that a maximum rental period is defined for a certain year. For example: for year 2015 the maximum rental period is 20 days, for year 2016 the maximum rental period is 30 days, etcetera.

    See below some alternatives to model the period.

    Which one is the best, and why? Or which other alternative is better, and why?

    Regards,

    Jacob


    Filed under:
  • Thu, Sep 17 2015 14:16 In reply to

    Re: How to model maximum rental period for a year

     Hi Jacob

    Of your three solutions, the one with Period(days) is preferable as that best captures the semantics. However, you should declare the reference mode to be unit-based -- it will then appear with an appended colon thus: Period(days:).

    As a minor change, I would rephrase the predicate reading to make it infix, e.g. Year(CE) limits the maximum length of car rentals to Period(days:). There is nothing wrong with your mixfix reading, but when there is an easy infix readings I prefer to use that. You could also name the role hosted by Period as maximumCarRentalPeriod to control the column name that is automatically generated when mapping to a relational schema.

    Cheers

    Terry.

  • Thu, Sep 17 2015 20:48 In reply to

    Re: How to model maximum rental period for a year

     As a follow-up to my previous response, the term "Period" has multiple dictionary meanings. It can mean simply a duration in time (e.g. 7 days), or instead an anchored duration in time with a specified start and end time (e.g. the period from 2015 Sep 11 to 2015 Sep 18). If your model needs both concepts, I suggest you use Duration for the former and Period for the latter (as recommended for SQL). In that case, you could rephrase the fact type under discussion as

    Year(CE) limits car rentals to maximum- Duration(days:).

    This uses hyphen binding to shorten the predicate reading while still ensuring correct verbalization of constraints (e.g. Each Year limits car rentals to at most one maximum Duration).

    Cheers

    Terry 

  • Thu, Sep 17 2015 22:45 In reply to

    • jacobvos
    • Top 25 Contributor
      Male
    • Joined on Mon, Jan 21 2013
    • The Netherlands
    • Posts 39

    Re: How to model maximum rental period for a year

    Hi Terry,

    Thank you for your answer. I now changed it into how it is shown below.

    Regards,
    Jacob


Page 1 of 1 (4 items)
© 2008-2024 ------- Terms of Service