al3xandru / jreql

A Java driver for RethinkDB, the open-source distributed JSON document database with a pleasant and powerful query language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A thought about api design

btiernay opened this issue · comments

I'm not sure if you are familiar with Jongo, which makes working with MongoDB in Java more like working in the mongo shell, but you should take a look if not:

http://jongo.org/

What I like about it is that it doesn't try to hide the native look and feel of the query language and is very easy to work with. Also, it has great support for Jackson which is key in Java when working with JSON.

Anyways, you may be able to grok a few ideas from their design.

Cheers

Thanks @btiernay. I need to look into it, but at the first glance there seem to be quite a bit of string parsing/interpolation being used in jongo.

Depending on your perspective that may be a good or a bad thing. Sql is the same way and there is something to be said for not abstracting it too much (eg Hibernate criteria api). I thinm Jongo has done a good job at balancing typesafety with expressiveness and ease of use. Just my 2c.

Cheers

Btw, why aren't YOU using testng in your code? :)

  1. My thoughts right now is that the first version should be API-centric. Adding a porcelain API on top of that would be easier.
  2. I wanted to see how far can I get with JUnit. Parameterizing tests is still weak, so I'll probably go back to TestNG ;-)
  1. Fair point
  2. No excuse ;)