My company currently has a Java project that allows us to run jobs to process data. The current project has a web interface, but its rather old, and most of the web interface is implemented through Java Servlets by printing HTML out to the web browser.
We want to instead create a REST API using the same core process, and replace the web interface with a different implementation in the future. Then eventually, we may have customers use the REST API.
My question is this: I understand NodeJS is pretty powerful, and from what I've read, makes the most sense when developing a REST API with the JavaScript and JSON integration. Should I attempt to create the REST API with Java, and if so, should I use JavaEE and Glass Fish, or should I have the API be built with NodeJS, then have the NodeJS server call the core Java service to process the requests?
I understand I may be introducing unnecessary complexity, however the project is rather large, and it won't be feasible to port the project over to NodeJS. I don't have experience with REST API creation (or SOAP), so this is new territory for me.
Thanks for the help,
Colby
Your aim is to create REST API so that your customer could use the API.
For this you can use :
NodeJS to create all your complete application code and Rest API.
There are plenty of
Java is good to create Rest API. You can use JEE and server you are comfortable with. For example, GlassFish.
My suggestions : Use Java because your current application is on Java. You could save time because working on same language. You already have skills in Java languages. You can use Spring framework ( Spring MVC, Spring Security and Spring Boot). Theses frameworks offer some great features and are simple to learn.
Since your current application is already in Java, based on Servlets, the easiest way to create a REST API is just to use the JAX-RS API in your current application. You can start with this JAX-RS tutorial. You would probably also want to use JSON-P for converting between Java objects and JSON. GlassFish, Payara, or any other application server should already provide both the API out of the box.
If you want to use plain servlet container, such as Tomcat, you can add Jersey library to our application, which provides a servlet to support the JAX-RS API in the same way. Or you can alternatively use Spring REST to build the REST API.
I don't recommend to use Node.js just for the REST API - it would introduce a new language for a thing, which can just as easily be done with Java, which is already used by your application. In the end, you would still need to connect the additional Node.js application with the current Java app, which is cumbersome. You would probably end up creating a REST interface between the Node.js app and the Java app, making the Node.js app redundant.
Related
I'm using Azure for the first time and wanting to make a very simple RESTful API, but trying to follow the example using Swagger.io feels like a lot of work for what I want to achieve. Is there a way to just write Java code for JAX-RX without going through the Swagger.io generator process?
Service description stating that you can bring your API as is:
Bring your existing API as-is - You don't have to change any of the
code in your existing APIs to take advantage of API Apps -- just
deploy your code to an API app. Your API can use any language or
framework supported by App Service, including ASP.NET and C#, Java,
PHP, Node.js, and Python.
Swagger support facilitate ease of consumption, since you able to auto generate client sdks in various languages based on swagger spec. Nothing prevent you not having swagger and still use service.
I want to develop a web service.Out of Java web service and .Net Web API which should I select.
.My requirement is that it should be stable and should be effective in performance.Which should bare load of thousands of requests and won't fail.Out of this two which should I choose and why?
My suggestion would be implement Rest WS in Java, Since it's platform independent, rich API's, you can go with Spring for rapid development.
My suggestion is Java. I'm used to Java to build REST server that serve thousands request and it's still working well.
The Jersey is good framework for you. Also Java is open source and independent platform.
I'm sort of new to http://www.parse.com . And I want to develop backend in Java using REST API. It seems parse.com does not provides direct Java library for REST API development. But I found some third party libraries(un-official) like for Java:
JAVA
Almonds — A Java REST API that mimics the Android API.
mobile-parse-api — This library implements the REST API of parse.com in java with open interfaces for libgdx and playN.
Parse4J — Library for the REST API.
ParseFacade — Parse Android SDK alternative.
But I am not understainding how to get start with these libraries in order to create backend API in Java
#Mahendra
I assume by now you have found your answer. In case you haven't then here is a thought process that might be of interest.
From the little reading I have done on Parse.com it is a sort of like an Object database in itself which provides ready REST style api for all data stored there. See this - https://parse.com/docs/rest/guide
In addition they provide libraries for all popular Front Ends (iOS, Android, JS).
I think they are advocating a paradigm shift for programmers who are used to having a lot of processing on the Backend servers and exposing simpler rest API which provides a processed and targeted response to each http request.
Basically they are suggesting that the whole backend infrastructure (db, app server, server side logic etc) can be replaced by parse.com
If you are considering using Parse.com I assume you have read and understood above mentioned thought process and decided that it makes sense for your project.
I would advise you to consider using a using a common client side Java library that works with the Parse rest api and then use appropriate Client SDK (iOS, Java, JS etc) to work with your library and design the UI. Since you are asking about Java library, I assume your language of choice for storing processing logic is Java.
What I suggest next may be bit of a long shot ... but worth a consideration.
Write code non-ui code in Java and work with the Android API from Parse.com. Use a Java to Objective C. https://github.com/google/j2objc
This will also allow you to use Java code for your web browser (using GWT as a UI framework).
Then write UI code in the framework suited for the platform (obj c for ios, Java for Android, GWT + Java for web browsers) and use the java library to connect to Parse.com.
If you have already tried out such an approach would be good to write back opinions in a comment so the community may benefit.
I've seen that it is possible to run the django web framework on a GlassFish application server. Is it also possible to use a simple Enterprise Java Bean in a django project which runs on the basis of Jython? My idea is to have a django website for the frontend and Java EE in the backend (to manage the database access, etc.). Does anyone have experience with that?
A possibly easier variant would be to expose the EJB functionality using REST or possibly SOAP to get around interface problems between jython and java rather than do the call directly.
I'd like to learn how to create a java web service that can be consumed by a web tier, which is constituted of java and flex.
What books can help me learn how to create a java web service and consume it via java & flex?
Should I look to build a web service from scratch or from frameworks like: XFire, Axis, CXF, Spring Web Services, etc.?
If using a framework is recommended, which of the above or any others makes the most sense to learn/use?
EDIT:
Both the java AND flex components of the web tier need to independently access the web service. For example, the flex component helps the user create & save a spreadsheet; the java component retrieves the spreadsheet data and displays it accordingly.
Flex should do the job: Web Services with Flex tutorial
You may not need a web service. Your Flex app can consume Java POJOs directly using Spring and BlazeDS.
What kind of a service are we looking at? If it requires database integration you probably need at least some kind of a framework - you really don't want to be putting your SQL queries hard coded into the app. Spring + Hibernate seems to be one of the most popular choices for a Java server implementation, but both of them are quite massive and require some effort. Appfuse could be something that provides a good starting point for building a service.
Why do you want to do your service with Java anyway? Is this because you know only Java or because there is a Java container already running on your server? I've seen great results with Ruby on Rails too and now there's some buzz about Scala too in the Java world. This could be your chance to try out something new and more flexible ;)
I'll take this opportunity to plug my own book, Eclipse Web Tools Platform: Developing Java Web Applications. Chapter 10 deals exclusively with creating Java Web services. Although the examples are all shown using WTP tooling the lessons discuss Java Web services created with Apache Axis.