Re: EOModel normalizing: Sorting arrays? (was Re: EOModel Editor)

From: Mike Schrag (mschra..dimension.com)
Date: Tue Jul 18 2006 - 08:11:08 EDT

  • Next message: mar..iffy-berlin.in-berlin.de: "Re: EOModel normalizing: Sorting arrays? (was Re: EOModel Editor)"

    and for the short, more direct response :) :

    * it's mostly your code, yes :)
    * apparently some people have non-string keys in the user dictionary
    mixed with strings, so it's BASICALLY the same except that I had to
    add support for mixed type comparisons
    * it sorts on read and it just "happens to be sorted" when it writes
    back it, which preserves the sort order
    * I had to temporarily remove sorted lists because EOSortOrderings
    and qualifiers, for instance, need their order preserved. The new
    patch to Cayenne should allow me to selectively return a TreeSet
    instead of a List, though, for certain nodes of the plist tree and we
    can sort lists when we need to.

    ms

    On Jul 18, 2006, at 6:59 AM, mar..iffy-berlin.in-berlin.de wrote:

    >
    > On 17. Jul. 2006, at 23:47, Watkins, Garry wrote:
    >
    >> ...Since you have been sorting things from dictionaries today,
    >> would you automatically sort by the keys of the user info
    >> dictionary in the properties inspector?
    >
    > I assume Mike is using my code, so yes, the keys of the user
    > dictionary are sorted. But as dictionaries don't have an order
    > anyway, it doesn't matter.
    >
    > There is a possible problem with arrays though. I assumed that
    > there are no arrays whose element order matters, so I simply sort
    > all the arrays I find. Otherwise the whole thing wouldn't make
    > sense, as for example the list of entities (which EOModeler
    > constantly scrambles around) is an array. I am not aware of any
    > arrays where the order of their elements matters, except maybe
    > arrays that have been put in the user info doctionary.
    >
    > Maybe the code should be changed to not sort arrays which are below
    > an entry named 'userInfo'. Sounds like a hack, though :)
    >
    > Marc
    >



    This archive was generated by hypermail 2.0.0 : Tue Jul 18 2006 - 08:11:14 EDT