Documentation is error-prone. So the best documentation should be the code itself… or automatically generated from the code.
I haven’t found any open source project that can do this so I created one. As I’m currently learning Scala, I decided to write the code with Scala. You can find the code in Bitbucket: https://bitbucket.org/enefem/restdoc
It’s by no mean complete so feel free to fork and add functionalities or ask for improvements.
How To Use
To use the tools, you must define an init-parameter in the Jersey Container. The param-name should be packageName and the param-value should the complete package name where your REST resources are located. Example is as follow:
Even thought Scala is now among the trendy programming languages, it still misses a lot before it is considered as one of the major players.
Most Scala programmers are they who are not satisfied with Java, so it’s natural that most of them were before programming with Java. One of the things Java programmers miss from Scala is a robust and functional IDE. Since I’m a big fans of Eclipse, this means Scala IDE for Eclipse. While surely the improvements have introduced to the plugin, there are many things left out.
So what are still missing? This is my list based on several months experience with Scala IDE. If some missing features are missing (duh…), just comment and I’ll try to update the post.
No refactoring. I miss refactoring a lot. I still remember the day I find refactoring features on RefactorIT for JBuilder. It’s like the day you saw sun for the first time. And not long after that, I found Eclipse with its build-in refactoring features. Call me lazy programmer, but programmer should be lazy, isn’t it?
The content assist takes (almost) forever. Yesterday I found myself restarting Eclipse about five times just because I’m programming with Scala. And I’ve increase the timeout of content assist ten folds.
Content Assist doesn’t show (not nearly) all posibilities. When it works, it doesn’t even show nearly all possibilities I want to have. On some cases, it even can’t show a pretty simple completion for a field. As small example: if I write ‘va’, I hope I can get ‘var’ and ‘val’ as the first entries of the completion suggestion.
Limited formatting options. Eclipse’s Java Formatter is the best configurable formatter I’ve ever saw. This Scala formatter doesn’t even come near it.
No suggestion, not even correction suggestion. I often use Ctrl+1 in Java editor to assign the statement to a variable. Not possible. If you got errors, you got no correction suggestion.
No integration to scala documentation. Weird, but the Scala editor can show Javadoc but no Scala documentation is accessible.
No auto import. I ended up importing the whole package everytime I need a class.
But yes, I still put a lot of hope woth Scala IDE. It shouldn’t take a lot of time, because the code is in Scala and Scala means productivity, right?
Last night, Kevin released the 8th version of Google Guava libraries. For me personally, nothing so exciting in this release. Just nice to have some bugs fixed and some new methods and classes. MinMaxPriorityQueue could be interesting, but I don’t have scenario where to use it right now.
When you are creating resource in a REST application, it will only be automatically created if you have an empty parameter. The problem is, sometime we need a resource that is configurable, so it can be reused by other applications.
We can solve this problem by defining init parameter in our web.xml like this:
The default theme of Eclipse is good, but I must admit that with some configuration, Vim can show code better. And this is pretty easy, just go to Google and search for ‘vim color’.
I know from a long time ago that Eclipse allows us to change the color preference of our editor. Hence I never change the default since it is just too much hassle to do that. Not counting that when I reinstall Eclipse, I might have to reconfigure all that stuffs.
So when I found this plugin Eclipse Color Theme, I know I will like the plugin. But God, how I’m still surprised to see the result.
Do you like it? There are even more themes you can download here.
By connecting your printer with the Google Cloud you will be able to print to your printer from any computer or smart phone, regardless of where you are. Just activate the Google Cloud Print connector in Google Chrome and your printer will automatically be available to you from Google Cloud Print enabled web and mobile apps.