[Buildbot-devel] Generic implementation for paging and sort functionality in data api

Naveen Kumar naveen.iitm90 at gmail.com
Wed Aug 1 06:17:21 UTC 2012


On Tue, Jul 31, 2012 at 3:52 AM, Dustin J. Mitchell <djmitche at gmail.com>wrote:

> 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[1]. 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[2][3]. 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.

Even if we add this in base class the data extraction logic should be
written in all the resource type classes separately, right? Or it is
possible to write common logic for all the resource types at one place(base
class or somewhere else)?

>  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 a considerable change. This can be done later?

>


> 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.
>
> Dustin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20120801/71bb8e88/attachment.html>


More information about the devel mailing list