Re: Some suggestions

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Aug 11 2008 - 18:40:48 EDT

  • Next message: Demetrios Kyriakis: "Re: Some suggestions"

    On Aug 10, 2008, at 5:49 PM, Michael Gentry wrote:

    > On Fri, Aug 8, 2008 at 10:17 AM, Andrus Adamchik <andru..bjectstyle.org
    > > wrote:
    >> +1 for the pluggable naming engine, and making the first alternative
    >> implementation to work like you described, i.e.:
    >>
    >> * drop the "to" from to-one relatinship names
    >> * replace "Array" with "s" for to-many.
    >> * use FK as a basis for to-one relationship name
    >
    >
    > For a to-many, it isn't as simple as adding an "s" at the end for a
    > to-many. At least not in English. For example, if you have a to-man
    > to an Address object, you probably want "getAddresses" and not
    > "getAddresss" as the method name.

    Of course. Not sure how far we can go with an automated engine here. I
    guess some of naming cleanup may still have to be left to the users.
    But we can build a basic algorithm for 95% of cases. E.g. check for
    the ending "s" and change the suffix. Are there amy formal English
    language rules that would help us in building the algorithm?

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Aug 11 2008 - 18:41:19 EDT