Use of JAVA EE 7 when only RESTful application needed as backend for AngularJS - angularjs

I'm building a RESTful application to serve as the back end for an ANGULARJS front end application. I would like to use java for the backend component and hence looked into JAVA EE 7, which seem to do the job, but I do not intend to use JPA or any other JAVA EE technologies except maybe JSON processing.
So my question is: is it still worth it to go with JAVA EE and use EJB as resources knowing I'll be getting the overhead of a EJB container and the general weight of JAVA EE server, or use JAVA SE + JERSEY ? Is that actually an alternative?
Thanks
Ibrahim

JAX-RS is part of the JEE specification so its not really an option to just use Java-SE. So what you really looking for is a lightweight solution to still host a JAX-RS application. You do not need to use a full JEE container to accomplish this if you do not plan to use the full stack. You can use Tomcat for example. There are a few examples on how to use Tomcat and a JAX-RS implementation like Jersey or RestEasy:
http://www.vogella.com/tutorials/REST/article.html
http://www.javacodegeeks.com/2011/01/restful-web-services-with-resteasy-jax.html
https://www.ibm.com/developerworks/library/wa-aj-tomcat/
If your company has cash you can always look at the evil empire IBM and their Liberty Profile but I would say stick to Tomcat :)

Basically, Jersey is part of JavaEE stack. The thing is, JavaEE is modular, You can use just what you really need (in this case, Jersey, which is a reference implementation for JAX-RS 2.0 specification). Have a look at great community examples regarding JAX-RS on GitHub that were inspired by Arun Gupta. This might help You with Your decision

Related

Framework for GAE which use datastore (python preferred)

I love the free tier of GAE, especially Datastore.
I would like to know which frameworks that use Datastore as database.
For example, I only know
Kay Framework (not maintain anymore)
http://kay-docs.shehas.net/
Ferris 2 (not maintain anymore)
http://ferris-framework.appspot.com/docs/index.html
I prefer Python, but php or java are ok too.
Honestly, GAE kind of is the framework. That's part of the point.
If you look at the Google Cloud documentation, you can see that they use Flask, Django or webapp2 as the Python frameworks for providing examples related to the use of Datastore. Personally I cannot recommend any frameworks that utilize Datastore as their database.
In general for Python you can use either the REST API or the client library for a GAE application. This article demonstrates the CRUD functionality implemented using the client library.
If you wish to use third party client libraries for the Datastore API, you can find a list here where two Java libraries are mentioned (Objectify and Catatumbo) and one PHP library (Datastore Library for PHP).
webapp2 is very light weight and has all the basics you would need. however if you are looking for a more "extensive" framework where you dont have to worry as much you could also look into Django (https://cloud.google.com/python/django/appengine)
If you like to do more yourself, like structuring your project in your own way, building your own libs = webapp2
If you want a full framework out the box in GAE Python = Django
GAE is an AMAZING service, and either way I would say you are making a great choice.
Hope this helps.

JSPs for a simple Project Reporting Web App?

I'm about to start developing a simple reporting tool for tasks in international projects. In a nutshell: using the tool, a project is created, defining team members, tasks, and work packages. Team members will be asked to periodically submit reports on the work they've done (related to tasks and/or work packages). These reports will be stored and accessed trough the tool.
I'll use Google App Engine (client requirement) and its datastore (using JDO). But I want to ask you for advice on the frontend part: JSP looks pretty messy for non Java developers... any other idea???
Thanks!!!
Seems like at the moment it's either java or python. However, you may want to look at Grails. GSPs might looks a little less 'messy'. I'm suggesting Grails based on your description of the project, that I suspect will turn out anything but simple later on. You might end up being glad for the mix of constraints and flexibility that Grails will afford.
JSP doesn't need to be any messier than other similar HTML presentation frameworks, it really comes down to implementation. That being said, it is old Java technology which means it's not being kept up to date, and finding a good single source of documentation is difficult.
If you don't want to use JSP, there are other frameworks you can use, you just need to make sure they're compatible with Google App Engine.
The new kid on the block is the Play framework, and that's a Java MVC framework similar to Ruby on Rails. You can find a tutorial here: http://viralpatel.net/blogs/first-play-framework-gae-siena-application-tutorial-example/
If you're going to use Spring, check out this question: Alternatives to JSP for Spring MVC view layer
For a front end developer, if the code is separated correctly, you won't have to know anything about Java since there shouldn't be any Java mixed in with the HTML. If that's your only worry, then I would just go with JSP to keep things simple unless the team has experience with another technology.

Can I use Spring MVC 3 with GAE, even if it is not mentioned (or actualised) in "Will it play in Java"?

My question is in the title.
I am afraid to use Spring MVC 3 (and learn it..) and having bad surprise after.
Do you have any recent feedback or recommendation about using SPRING MVC + GAE ?
Thanks you,
You can use Spring MVC 3. Search the web and you'll find numerous tutorials and mini-examples on how to use it on App Engine.
That said, you should prefer a more lightweight solution, because big frameworks can suffer from slow start-up times. There are workarounds specific for Spring MVC, like this blog post suggests.

GWT now has spring roo support, what will this mean to GWT developers?

I have been using GWT with App Engine for a while now. Recently there was an announcement that GWT will support Spring Roo and SpringSource Tool Suite. I am having trouble seeing the big picture from the Google announcement page. For those without much knowledge of Spring what does this mean for GWT developers used to building swing-like gui's?
My understanding is that Spring-Roo simplifies creating the server side component as well as making a rudimentary GWT front end for you. Then as a GWT developer, you can take the generated GWT front end and further embellish it. So, if is as good as they say it is, it makes your life as a GWT developer much easier and makes you more productive.
My first impression on Spring Roo is just a code generator. But after I learn a few things about the files AspectJ created in the project, my view was totally changed. I took one ERD diagram from databaseanswer.com and created the entities with Roo, generate the web controller. Straight away I got an application within minutes. All I needed was an ERD diagram and what I got is the well written application in Java based on the fact that AspectJ codes are Java codes. If I want to write the complex code for reporting. I can write them either in one of the Entities or custom service classes. Not only GWT, any support or add-on Roo will ease my development. Struts 2 addon for Spring Roo in the future ? Yes, please.
I think that this alliance enables developers to design complex and high performing applications even more easier. Concering GWT applications Spring would offer the server-side part with the many aspects provided by the framework (e.g. dependency injection, architecture, securits, data access ...) you might need in an enterprise application.
As far as I understand Spring Roo is a framework for rapid developement. Using GWT in combination with this, GAE and other mentioned spring technologies you'll be able to quickly start developing app engine applications (for example).

Do you have any comments on using GWT with Appengine?

I'm looking for tips, suggestions, advice or examples of applications build using Google's Web Toolkit with Google AppEngine.
Since Google AppEngine now supports Java using GWT just became a whole lot easier (ie. you can use GWT RPC).
Take a look this screencast.
Here's a screencast on the subject: Using Java (GWT) with Google App Engine
Functionality seems very limited though since GAE uses Python + JavaScript and not Java.
Can you elaborate more on why using GWT with the Java version of GAE would necessarily be a good idea?
I'm not arguing against it, and it seems obvious Java would be the way to go, but just wanted to hear the concrete reasons.
To answer my own question: GWT provides an interface called "GWT RPC" that allows you to talk directly to Java Servlets, therefore offering an amazing level of integration between client and server.
The crux of the problem with GWT and GAE is that you want to use JDO to persist your objects when using GAE, and the bytecode manipulation done by the nucleus (JDO implementation) makes your domain objects no longer work with "GWT-RPC".
Today, the best solution is probably the Gilead GWT adapter for Google App Engine which is currently under early stage.

Resources