On 11/24/2012 10:15 AM, crocket wrote:
> It sorts XWiki Objects by their propeties.
> I already made an extension page on
> http://extensions.xwiki.org/xwiki/bin/view/Extension/XWiki+Object+Sort
> 
> I want to have a github repository on
> https://github.com/xwiki-contrib<http://github.com/xwiki-contrib>for a
> github user
> https://github.com/crocket/
> 
> The project page for xwiki-contrib-objectsort is
> https://project.snowberry.me/projects/xwikiobjectsort/repository
> And the repository page is
> http://gitweb.snowberry.me/?p=xwikiobjectsort.git;a=summary
> 
> You can clone the source code from git://snowberry.me/xwikiobjectsort.git

Hello,

I looked a bit at your code, and I have some observations:

- While I agree that being able to sort objects is important, I'd rather
see this in a patched version of the $sorttool instead of a separate
component; I've checked it and we'd just have to change the way
getComparable works. Doing this means that we're going to reuse a tool
that we're already supposed to be using for general sorting, and we'd
get as benefits the ability to specify a sort direction, and the ability
to mix properties and other object metadata, like owner document or
object number.

- Even as it is right now, I don't like that the script service only has
a getInstance method and then exposes the internal object.

- I don't think that both sort and sortCopy are needed. Only the method
that sorts a copy and returns it should be available.

- sortCopyByProps should also be called just sort, since the type of
parameters passed will be enough for the right method to be called
(polymorphism). And I'm actually wondering if we need both methods or
not, since sorting by just one property could be done by passing a list
with just one member.

WDYT?

-- 
Sergiu Dumitriu
http://purl.org/net/sergiu
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to