On 11/24/2012 10:15 AM, crocket wrote:
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