javaEE as a backend for emberjs


#1

Actually I am good in Java stuff. how do I use Javaas backend for ember. is Java good to use as a backend or I need to learn other backend languages


#2

If you can set up your backend with a REST api it doesn’t really matter what type of backend you use. You don’t need a REST api to use Ember but it makes life a little easier as Ember ships with a REST adapter. You can make your own adapter but takes a little more effort.


#3

Bump!

I’ve just started helping out at a place that uses Java in the back-end, but I’m a total noob with Java and/or its ecosystem. Is there anything that’s going to trip me up or worth looking into when integration Ember apps with a Java based API??


#4

There is a spec called JAX-RS for Restful web services in Java and the more popular implementaciĂłn is Jersey. You haber a nice intro here: http://www.vogella.com/tutorials/REST/article.html Then you need to follow the RestAdapter conventions or write your own adapter Hope that helps


#5

Adding to what @malzola said you will likely want to use the RestAdapter, which has pretty strong conventions that can be a headache when you use it with any REST API that doesn’t use the ActiveModelSerializers gem alongside Ruby on Rails.

Essentially any backend will work, Rails / Django / Flask / PHP / Java etc. are all great frameworks / languages that can get the job done quickly and effectively, and already have working open source projects available on Github that can do all the heavy lifting (it’s not even that heavy really).

All you need to do is have your backend respond to requests with JSON that’s formatted like this.

The problem is most out-of-the-box solutions (like Django Rest Framework for Django) don’t follow that convention. As you can imagine it isn’t a game breaker, it just won’t automagically work. Personally I found this to be a problem when I first got started with Ember-Data because I was using a new framework at the time and had yet to conquer model serializers.

If I was to get really philosophical right now I would point out that EmberJS users have a really strong tie to the Rails framework. This naturally provides better tooling and support for Rails, which causes more people to use Rails and the cycle to continues. Rails is great, but I feel that it fails to pick up on much of the awesomeness in other pervasive web frameworks.

The bottom line though is Ember-Data is good enough to work well, and relatively easily, with any API backend that can serve JSON. Push comes to shove and your poison of choice doesn’t work? All you have to do is write a short client-side serializer and ember-data could care less whether you sent it rancid Keystone or ice-cold Budweiser.