Storing AtomEntry items in chronological order

Topics: Argotic.Core
Sep 24, 2008 at 4:31 PM
Hi all,
me again.

The Atom spec says that:
 "This specification assigns no significance to the order of atom:entry elements within the feed."

I wish the entries to be returned in ascending chronological order of updatedOn.  It seems straight-forward enough to replace the underlying _feedEntries object with one of my choosing, but I'm struggling with the code to create that object. 

This leaves me with these questions:
- is it acceptable to override the underlying feedEntries object?
- can anybody point me towards the type of collection that I must use to get ascending sort?   I'm ok with defining a comparator that compares updatedOn - I just can't find a compliant class that I can apply this to..

Sep 24, 2008 at 5:34 PM

If you need to suppliment syndication feed/entries with additional features, you will want to typically do so via extensions. For ordering entries in a feed, I would suggest the Atom Ranking Extension (
Sep 24, 2008 at 8:28 PM
Edited Sep 24, 2008 at 8:34 PM
thanks for coming back so promptly.

My train of thought was that if the data is stored in its sorted-order, the 'sort' operation only happens when the list is modified.  If the data must be sorted by the viewer component (using an attribute or extension) the sort must happen each time the data is displayed. Thus, we would be making the 'write' expensive and the 'read' cheap - the best solution for a feed that gets read more than it gets modified/written to - which I guess is the 'normal' model.

Do my thoughts carry any merit?
Sep 24, 2008 at 8:57 PM
Any sorting/ordering you do on the feed entries will not necessarily be used by consuming clients, as the Atom specification assigns no significance. If you are only consuming the feed internally (no public clients) then ordering the feed entries would be a good solution. If you expect the feed to be consumed publicly by clients, then explicitly defining the ordering/ranking of the entries using an extension would be the most conformant solution.