cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: [jira] Updated: (CAY-477) Support for preordered relationships
Date Wed, 03 Mar 2010 21:28:20 GMT
Also here is a reason why I don't find ordering of relationships  
particularly useful is that things like ordering are context dependent  
("context" in a general sense)... The same mapping can be used by  
different UI frontends with different ordering requirements.

Actually I even find callback mappings useless in my apps for that  
same reason. And it is even worse with orderings, as lists of objects  
may be reordered on the fly in the UI, initial ordering can be  
affected by user preferences, etc.

So I feel like it looks good on a feature list, but will be barely  
usable in practice. Anybody can give real life examples to the opposite?

Andrus


On Mar 3, 2010, at 3:51 PM, Andrus Adamchik wrote:

> Are we going to track property changes of objects? E.g.:
>
> // assume ordered on painting name
> Painting p = ...
> p.setName("A");
> artist.addToPaintings(p);
> p.setName("Z"); // should we reorder in this line?
>
> I'd say no (although we can), and this probably means no to (1) and  
> (4). Although on commit we should probably detect that the ordering  
> property has changed, and reorder affected lists.
>
> Andrus
>
>
> On Mar 3, 2010, at 3:32 PM, Andrey Razumovsky (JIRA) wrote:
>>
>>    [ https://issues.apache.org/jira/browse/CAY-477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

>>  ]
>>
>> Andrey Razumovsky updated CAY-477:
>> ----------------------------------
>>
>>   Attachment: 477-proto.patch
>>
>> Here's prototype of how I see the issue.
>> Orderings can be added to objRelationship, and they are relative to  
>> *target* entity (e.g. to Painting for "Artist.paintingArray"  
>> relationship). For relationships with orderings, resolving returns  
>> ordered list.
>>
>> Some things to be done:
>> (1) Collection methods, like add() addAll() should keep the order.
>> (2) Map and Set support
>> For (1) and (2) we'll need to introduce different underlying  
>> implementation of PersistentObject*
>> (3) Modeler support
>>
>> (4) Not sure of this --> set() method of collections and changing  
>> the object in ordered collection should somehow keep order. This is  
>> unseen truth for maps but will be a pain for lists. Do we need this??
>>
>>> Support for preordered relationships
>>> ------------------------------------
>>>
>>>               Key: CAY-477
>>>               URL: https://issues.apache.org/jira/browse/CAY-477
>>>           Project: Cayenne
>>>        Issue Type: Task
>>>        Components: Core Library, Modeler
>>>  Affects Versions: Undefined future
>>>          Reporter: Andrus Adamchik
>>>           Fix For: Undefined future
>>>
>>>       Attachments: 477-proto.patch
>>>
>>>
>>> This is already supported on the client (PersistentObjectList).  
>>> Need to either add support for it to ToManyList or migrate  
>>> DataContext to use PersistentObjectList. In any event Modeler  
>>> support is needed.
>>
>> -- 
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue online.
>>
>>
>
>


Mime
View raw message