Skip to content

spollapa/yoga

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yoga makes your existing MVC-based REST framework on Java (for now) faster and more flexible.

Check out our homepage here: https://github.com/skyscreamer/yoga/wiki

Inspired by LinkedIn’s JavaOne presentation on building flexible REST interfaces (http://blog.linkedin.com/2009/07/08/brandon-duncan-java-one-building-consistent-restful-apis-in-a-high-performance-environment/), Yoga is a framework for supporting REST-like URI requests with field selectors. 

Yoga selectors allow you to:

A. Combine multiple queries into a single "relational" query
B. Make expensive data optional

For example, imagine I run a music social network site, and you want to find out the songs of your friends' favorite artists.  In a traditional RESTful approach I would navigate the object tree, making several sets of queries.

1) Get my friends
2) Get their favorite artists
3) Get those artists' albums
4) Get the songs from the albums

This would be a LOT of queries.  In Yoga, you can do the same with a *single* query:

    GET /user/1.json?selector=:(friends:(favoriteArtists:(albums:(songs))))

View a more detailed explanation of our selectors here: https://github.com/skyscreamer/yoga/wiki/REST-Selectors

In short:

    Advantage               Which gets you
    ----------              --------------
    Fewer requests          More speed
    Fewer sockets           Lower cost
    Simpler client code     Happier client develoeprs

The Yoga framework automates most of the plumbing for you if you have an existing RESTEasy or RESTful Spring MVC application.  You'll just need to add some annotations and a few lines of configuration and you'll be up and running.  If at some point you want to apply the selector logic in deeper levels of code (e.g. generating custom DTO's), we've got patterns that will make that easy for you.

Once the initial REST types have been defined and the basic queries defined, there is no server-side programming required to change the client queries.

Yoga is created by:
Carter Page (carter@skyscreamer.org)
Corby Page (corby@skyscreamer.org)
Solomon Duskis (solomon@skyscreamer.org)
... and contributors like you!

Packages

No packages published

Languages

  • Java 100.0%