Spring MVC / Restful services - how to get started - rest

I'd like to build a restful service to return some JSON data to a mobile application. I've worked with Grails in the past - it's pretty much perfect for this - but I'd like to learn Spring for my own purposes, mostly because it's the dominant Java-based server technology. So, I'm thinking about building the service in Spring MVC 3 for my own edification. But, one problem already is my hosting service doesn't support Spring - nor Grails for that matter. They do support Ruby on Rails and PHP.
My question - how heavy of a learning curve is it to get Spring up and running with a restful service? Is there a really good tutorial/learning resource to learn Spring in a short amount of time? Also, will it be difficult/expensive to find a hosting server? Or should I throw in the towel and go with Ruby or PHP?

There are loads of tutorials and some very good ones as well
This one was recommended by SpringSource a couple of weeks ago. It's in 5 parts so make sure to check out the other ones as well :)
At first glance it might look like alot of work but it really isn't, you do the initial wiring pretty fast and then adding new Controllers are really simple so in long term it's going to be fast and easy.

Related

Migration & Technology Alignment: Sails.js from Wakanda

I am evaluating Sails.js as potentially the most closely aligned alternative for a migration of about four years of development on the Wakanda JS full stack platform. I would appreciate perspectives from the Sails.js community based on the following overview:
AS-IS: WakandaDB, Node.js / SSJS / Node Workers / Shared Workers; Client side: Angular 5 for Web and for Ionic/Cordova hybrid mobile apps.
Wakanda DB and Wakanda API and dataclass / dataclass method architecture and all of its off the shelf capabilities will no longer be in play.
It seems that Sails.js is the most closely aligned to my current technology stack. Does the community agree with this? I understand the community is pretty large, but I do not see evidence of this in terms of books on Amazon (as compared to the Meteor platform for example).
Appreciate perspectives and any references to migration related guides/references.
Kirk
I'm using sails.js professionnaly for four years now.
I worked with version V0.12 and now V1.0.
I've never heard of the Framework Wakanda so i can't tell you if the technology stack match.
All i can say is Sails.JS have strenghs and weaknesses.
I will just give you the cons so you can see if this is a no go for you.
The community is not the most active, a lots of good stuff developed for v0.12 isn't ready for v1.0 after years (i'm thinking of sails-auth and sails-permissions who provide good ACL structure).
He could be to big for small projects but i don't think it's a problem for your needs.
He works great with MongoDB but not that much with other DB system (even if community developed adapters for other DB as postgresql).
And for me the biggest weakness of this framework is his ORM.
This one will play with your nerves, you will have to rewrite some parts like the one who create the criteria of the query from express req and set default limit to your query even if you don't ask it.
I you don't use mongo, don't use the migration script provide by the adapter and build your own with db-migrate.
So i will recommend Sails JS for project with complex API but simple DB structure.
Hope this will help you in your choice ;)

Need help getting started with making REST services using GAE

I've just started on a small project to create some REST services using Google App Engine and Java. I'm new to both technologies, but I've done some reading on both. I'm familiar with SOAP (have used them previously), and I think I understand the conceptual differences between REST and SOAP.
Currently I need info regarding two things:
1) I'm trying to find some tutorial which builds a simple REST service from scratch for deploying on Google App Engine (GAE). The simpler the better, but it should have at least a few routing options. I don't need any UI, if that matters.
2) Which RESTful Framework should I use with Google App Engine. Again, simplicity is what I'd like, and something which has tutorials and a newcomer can easily grasp.
My ultimate goal is to just write a REST wrapper with multiple routing options, which eventual consumes some pre-existing SOAP services and returns their results.
Have you checked out Google Cloud Endpoints for creating a REST service? Its pretty simple and straightforward, also has support for OAuth.
I would give Jello framework a try. It offers a clean, and simple to follow, JSON format and provides a very powerful and comprehensive RESTful implementation that follows the OData specification.
Here is Jello's REST development guide: http://jello-framework.com/guide/rest.html

Choosing GUI framework for portlets under WebCenter portal

I'm just looking through available technologies to create portlets using WSRP. So we have the following requirements (I'll try to explain so as I can):
backend part: Jax-WS webservices implementation (in fact JPA + some business logic)
frontend: portlets should use Jax-WS webservices and should be exposed through WSRP and consumed in Oracle WebCenter portal
everything should be built via Maven
I'm having troubles with selecting a proper framework for portlet development.
A couple of things which I'm considering:
ADF - has a big learning curve, tightly coupled to Oracle stack, I wouldn't like to use it
Vaadin framework - looks fine, but its latest version doesn't support WSRP Add on, so I will have to write something on my own
There are also a couple of others possible frameworks which I have not looked through yet: JSF, Spring Portlet MVC.
Maybe somebody of you has already used similar stack and can give some advice on which framework is more convenient for portlet with WSRP. I would very much appreciate any thoughts on that.
Thanks in advance
For me I used JSF with JSF-Portlet-Bridge, Struts and ADF
But I always preferred ADF since it gave me a quick way to generate WSRP portlets from Task-Flows.
If you are going to develop big list of Portlets, I'd tell you to consider ADF, even though the learning curve might be steep but it'll be worth it, and you already have knowledge in JSF it'll be an easy task!

Recommendations for a Full-stack Framework for REST?

I am looking for a robust REST framework to eliminate all that boilerplate code with starting up a new REST-only web service (mobile clients). Is there a framework that already has this built-in where I could, for example, simply build the domain models and run with it? I would like to see:
Authentication & User Model
Logging
Basic CRUD
Permissions (for model access)
Scalability
It seems every web service at a minimum needs the above capabilities. Somebody, somewhere must have written a good re-usable framework with the above capabilities. Any ideas? I would prefer Node.js, Java or even hosting with a PaaS service provider that offers these features.
Spring 3 MVC provides a very nice and simple annotation based framework for REST.
See http://blog.springsource.org/2009/03/08/rest-in-spring-3-mvc/ it can be deployed on any java web server like Jetty or Tomcat.
A framework like XAP provides a combined solution of Spring and Jetty plus it's built for dynamic scaling.
See http://www.gigaspaces.com/xap.
Last if you want to easily on board this solution on any cloud CloudifySource provides an open source project which includes XAP capabilities and PaaS.
See http://www.cloudifysource.org
I use Symfony 1.4 for this. It is an PHP framework. It generates most of what you need for free. The database stuff is also quite easy as the Symfony uses ORM libraries (you can choose but I can recommend Doctrine: http://www.doctrine-project.org/).
For example the whole backend site(admin) generating is a matter of running one command. They have a great e-book fro free. More info here:http://www.symfony-project.org/.
There is also Symfony 2.X (http://symfony.com/), which have a lot of new features (e.g. new Doctrine 2.0). Especially with the bundle (plugin) https://github.com/FriendsOfSymfony/FOSRestBundle is the RESTful service quite easy.

Is Google Web Toolkit is fine to develop database based web application?

Is Google Web Toolkit is fine to develop database based web application or do you have any other suggestion?
Thanks to answerers!
For a heavy Database based web application, nothing beats Grails. Check out this tutorial by IBM. It will show you the power of Grails and how easy it is to develop database based web applications in minutes. I love GWT and smartGwt, but will go for them over pure grails only if there is a lot of non-database based front end (client side) logic.
If you do not have a programming language of choice (Grails is groovy based, which is based on Java), you could even look at Ruby on Rails which was the inspiration for Grails itself.
Alternately, you can add both grails and gwt in the mix by using this gwt grails plugin so that you have a powerful database integration, as well as a powerful front end developer. (I haven't used this though)
Sure, but you will need to create your own RPC service to get records from server to client and to deliver modified records back the server. But it isn't difficult at all.
Alternatively you could also use SmartGWT, which is an extension for GWT with more widgets, etc. They have data bound objects but in free version would would need to create your own data sources. If you decide to buy a license they seem to have database integration out of the box.
And additional note to consider with SmartGWT is that it has relatively big download size - about 3MB uncompressed and almost 1MB compressed (HTTP server should compresse it; it is in HTTP standard and it is transparent). So if it is going to be a service in public internet it might get quite long to load (often exceeding magic 8 seconds).
I had been working on GWT (Google Web Toolkit) for 1.5 years and learned that its a perfect platform for developing web application which uses backend database for its operation unless you have the right skill sets working on your project and a basic design which is developed according to the requirement of your project.