[Buildbot-devel] Generic implementation for paging and sort functionality in data api
Dustin J. Mitchell
djmitche at gmail.com
Mon Jul 30 22:22:05 UTC 2012
On Mon, Jul 30, 2012 at 3:07 PM, Naveen Kumar <naveen.iitm90 at gmail.com> wrote:
> For middleware I am using dojostores. One of them is JsonRest. It assumes
> paging and sort features in the REST api and right now data api doesn't have
> them. I am going to implement as part of the project. When I tried to
> implement first approach that came to my mind is write it in each endpoint
> class. But this design is not generic. I would like it be generic. It
> should be written in such a place that it need not be written in every
> class. How do I do that? Is it possible? If so, what is the best place put
> that code? Suggestions?
This is a keen observation. I think that the best place to add it
would be in the endpoint base class. It may be necessary to
distinguish "details" endpoints (one item) from "list" endpoints (a
list of items) by having different parent classes for them.
This is one of the reasons I haven't added too many resource types yet
-- I expect that this will require some significant changes, so it's
good to not have too many resource types to change.
More information about the devel