I'm Solomon Duskis, NYC consultant and a Java/J2EE guy. I work at Sungard Consulting Services in NYC. The postings on this site are my own and do not necessarily represent the positions, strategies or opinions of my employer. Solomon is a DZone MVB and is not an employee of DZone and has posted 22 posts at DZone. You can read more from them at their website. View Full User Profile

Yoga: RESTful and flexible

09.29.2011
| 4631 views |
  • submit to reddit

I've been working on yoga a hybrid REST theory/practice framework that "rests" on top of other Java REST MVC frameworks. The core of the framework is a custom rendering engine that converts POJOs to the user's desired representation. The guiding principles we used were:

  1. User defined "traversal" of objects (for example, only show a specific "tree" from an ORMed POJO)
  2. Plug-and-play representations
  3. Content Negotiation is more than just format, it's about content as well.
  4. NO DTOs!
  5. Links should provide a mechanism to get additional information
  6. Create a surfable API (as seen in Dr. Jon Moore's Hypermedia APIs talk)
  7. Allow flexibility to specify the "view" they care about - which will allow the user to reduce N+1 chattiness that so many REST systems have. - inspired by LinkedIn’s JavaOne presentation on building flexible REST interfaces.
  8. User code and integration should be as simple as possible.
  9. Allow for "augmentation" of the response data outside of the POJO
  10. Focus on documentation
  11. Showcase the runtime

We've done quite a bit of work to achieve the current state. The next steps include some additions of metadata and a UI that can "surf" that metadata.

Feedback would be greatly appreciated. We don't have a "real life" usage of Yoga yet, but will gladly support a "real life" endeavor

 

From http://www.jroller.com/Solomon/entry/yoga_restful_and_flexible

Published at DZone with permission of Solomon Duskis, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)