React vs GWT for large scale web application - java

As Java developer, I always felt comfortable developing web applications using GWT, but every now and then I am trying to check if there is a better framework that I can use for developing a large scale web application.
I tried out React, and I liked it, but as a Java developer I am not feeling as comfortable developing using JS, and I am scared that when the project will become really big I will have troubles maintaining it, and I will get "spaghetti code".
Basically I wanted to know what are the benefits of React over GWT? and am I right to be scared of big scale projects developed in JS?

Now you could try VueGWT: Github project
The idea is to write your control in Java and your views with vueJS templates. We have started (only a few part for now) to use it for GenMyModel, a very big GWT application.

I'm a java born developper who now works in react-redux and miss the object language. If you try to develop a real good application you will have to add redux to react but its pattern is quite weird and not well documented.
If you feel more comfortable with Java than JS you should use GWT. It's true that ag-grid with infinite loading for example, may not exist in GWT for the moment but you have Google support. If you want the latest amazing widgets (the react virtualized select is another example) for your app and you really need them you will have to document yourself about these (with lacks of documentation) and use react.

Related

JS Framework suggestion for Java based workflow web app

I am building a workflow application with Java back-end.It's an application for a small engineering project that does a lot of workflow work. I'm working on design now and trying to choose JS Framework for front end. I am considering Angular 2, but it seems like there is a steep learning curve. I don't mind learning Angular, but wanted to ask others what alternatives are out there and if they would recommend Angular for a Java-based web app. UI could be SPA with multiple tabs or a hybrid SPA/MPA.
Thanks!
Have you looked into Vaadin?
https://vaadin.com/
Basically it abstracts away the "client/server" architecture and you code your UI as if it were running locally as a Desktop application. The framework converts your Java code into runnable JavaScript for you. It's very neat. Drastically reduces the time it takes to build a full web app. Although I would say that if you need an extremely fast and responsive UI then there are faster frameworks out there.
"Build your web UIs in HTML or Java" - You can choose Java for your front end which may be a good choice as you already use Java for your back-end. Just a suggestion.
Look into ReactJS. It has a learning curve but ain't as steep as Angular.

Easiest web development method from Java perspective?

I have always been a front-end Java programmer, sometimes had to do C# on .NET but for the most part, Java is probably all I know about.
Just currently I have to do a small-scale website doing extremely simple thing and I really don't know where to start. My HTML skill is probably as good as I am with XML on Android, which is fair to say far less complicated than the HTML source code modern website have. I have almost no experience with PHP either, and no strong background on building or managing a database.
Is there some sort of technology that builds fully working website using mainly Java? It may have other languages I have to familiarize with but for the most part, I'd like to have little learning curve. For the backend I'm very sure I'm going to use cloud server services like Azure or Parse.
This is a very special project of me so I can't let anyone code it rather than me and myself only. Thank you and have a good day.
Use Servlets and JSPs for web development it's a start point and then java webservices as you already know XML.
I suggest you to build all your front-end using the following set of technologies: HTML5, AngularJS, JQuery, javascript, bootstrap. Your backend could exchange json with the front-end. The Bootstrap is the base for all your website and you could get a free template from the web itself, which would severely reduce your hard work at web designing. You would need just to adapt the links and calls, and the AngularJS would handle the controller and other stuffs ( have a chance to learn about ). Some JQuery components, or even AngularJS components would enhance your system usability and combined with javascript would bring most of hard work to front-end. I had the chance do start a system from zero and this is what I did, and now I have an AngularJS app working together with java by having java on the backend ( spring, hibernate, etc ) receiving and providing json data. At github you find some angularjs seed examples which you could use in your app and, again, save time and effort.
My apologies in advance, My answer is a bit broader in scope,
The Best Development Model for developing any website regardless of your language choice in Azure App Service is to take advantage two powerful features offered by Azure App Service, the Continuous Deployment feature and Deployment slots.
Start your website on a git repository and you may have node modules or bower packages, but on build your git will crunch it down to a working website with proper gulp files. Check out this blog to understand the process.
Once you have the git repo working for a simple website, your development process becomes much smoother. You can commit a change and Continuous deployment will automatically start a deployment for you to get your latest bits into your web app.. Check this blog for more details on Continuous Deployment.
You can use deployment slots to stage your changes and swap to maintain multiple versions of your web app on the cloud to easily build a production level application that has a last known good state. Check this blog for more details on Deployment slots.
The two features are the most used features while developing, deploying and servicing any project I work and I have found them very useful to understand them and use them in all their glory.
I am not a Java developer, but from the your question I can see you are looking to start on web development, the quick and powerful way (purely subjective here :D) is to use Asp.Net 5 with Angular 2 Beta. Here is an end to end tutorial on how to setup a development environment. Asp.Net 5 should be friendly toward Java developers as it is very light weight and simple to use and works great with vscode and visual studio community edition.
Let me know if the long answer helped, if you need a pure java environment that should be possible too :).

advantages of play framework for people coming from php / ruby / python

One of the strongest selling points of play framework is it's development cycle, just fix the code, go back to your browse, hit reload, and go one, all without the write, compile, deploy, hassle typical of j2ee web development.
Nevertheless, for web developers coming from php, ruby or python this is hardly surprissing, moreover it's considered the natural way to develop web apps.
Moreover, many of the advantages of play, (efficient template system, resolve errors quickly, stateless, fun & productive) are taken for granted in those frameworks...
So I'd like to know what do you think are the main advatages that play framework brings to web developer coming from dynamic languages.
From my point of view these are the main advantages
it's java, so if you don't feel confortable with java, and you are not willing to learn it, that might not be an advantage. On the other hand, if you HAVE to use java, coming from php or rails you will feel right at home with play
it's static (except for templates and routes, that's about to change on the next version), so you have compiler checks and safe refactoring.
tool support: IDE support (eclipse, intellij, netbeans)
endless collection of libraries to do everything you want, well, it's just java
runs on the jvm, which has years of experience and optimizations
it's compiled, so you may expect better performance
it's really fullstack: it comes with everything you need to develop a web app, compiler, web server, in memory db server, offline documentation, integrated database manager, local and distributed cache management, fixtures, evolutions, dependency management, lots of utility libraries, unit tests, selenium tests, ide support. You need no apache or mysql setup to get up and running
it has advanced features, like asynchronous requests, web sockets, asynchronous jobs
zero development environment setup: just unzip play.zip, play new my app, play run myapp
excellent documentation
great and fast growing community
scala is firmly in it's horizon, if you come from a dynamic language you might feel more comfortable with a language like scala, even though it's static
can be deployed to any servlet container, like tomcat, but also comes with it's own lightweight server
it's got an ever growing collection of community contributed modules
it's cloud friendly, works on gae, heroku, playapps, cloudbee, dotcloud, etc... (see this question)
source code: this is one of it's main advantages, even though it's often neglected. The source code is pretty readable, understandable and not over engineered. Even without much java knowledge, it's possible to have a look at the code, understand it, and begin contributing to the project
In my particular case, coming from a php & classic asp background, play allowed me get a web application up and running while learning java at the same time. it really let me enjoy my transition from dynamic languages to java...
Play has some advantages compared to other dynamic web frameworks, but I think that if you are proficient in codeignter, rails, django, etc, and if you are not willing to benefit from java's (or scala) ecosystem, you should stick to what you know...
A similar debate has been running on Google Groups recently, but more specifically comparing Play and Ruby (on Rails). I have tried to collate some of the feedback the community has provided on this topic, rather than just give me personal view. Hopefully this will make for a more rounded answer!
statically types business logic layer (and using the new templating engine, even your views will be statically typed). This has therefore the advantage of better IDE support as well.
Can use Java as well as Scala, so you are not restricted to a single technology stack.
Play just works out of the box, but is also highly configurable, so does not force you to work in a particular method.
In memory DB. Great for new developers, who just want to get started. No need to go through setting up WAMP/LAMP server etc, just to get started. Just download play, and you are ready to go!
Its Java (or Scala)! I got hooked on Play because I used PHP begrudgingly because it was the easiest way to host a personal website, but hated that I was building software in a way that I did not feel was well structured. Play allowed me to use Java without the bulk of a J2EE application.
Play framework. Play is heavily inspired by Ruby on Rails and Django. A developer familiar with any of these frameworks will feel at home.
1) Play leverages the power of Java to build web applications,By lifting away the Java EE constraints, Play provides developers with an easy-to-develop and elegant stack aimed at productivity.
2) It focuses on developer productivity and targets RESTful architectures. Play is a perfect companion to agile software development.
3) Folder structure of the play mostly match with the Rails.
4) Play loads the code dynamically. Just fix the bug in Java file and hit reload, the change will get reflected instantly on webpage. No need to go through those sluggish rebuild / deployment / server restart.
5) No configuration: No configuration required just download, unpack and start development.
6) Error discovery is very easy, When an error occurs, play shows the error message, the file path, line number, and relevant code snippet right in the browser.

Develop A Search Engine Front End In Java

I have to create a search engine front end for my IR project. I know java very well but I'm not using it for web applications yet. So, I need to choose what to learn to achieve my goal.
I found that java has many technologies such as : jsf , jsp , spring , gwt ... So what of these technologies suite my needs and which ones can I learn fast?
edit :
My web app should have two pages (first to submit a search query, and second to display the search results).
Since you know Java but not the plethora of web app frameworks, I would stick with GWT. While it does have a learning curve to be sophisticated with it, in fact you can build a working default app with one click in Eclipse. That will be enough to get you started.
Next you need a search engine. Lucene is the premier Java search engine application and is well-documented. However, it's large. You may get there faster using the VectorClassifier in Classifier4J. This will is simple enough that you can actually understand the whole thing in a limited amount of time (which would lead to a higher grade if I were grading this project).
Starting with the GWT Hello World "greeting" start app, instead of sending your name you send your search terms. Then in the servlet, you'd match the search terms to your documents with Classifier4J, which gives you scores. You'd return the scores in the greetService RPC call and show them with the document titles in your page.
Being the standard web framework in Java, I suggest looking at JSF first. It's relatively easy to learn and there are a lot of components available for it from third parties (e.g. PrimeFaces). Do make sure you start using a recent version of JSF (e.g. 2.0 or 2.1) as older versions (1.1, 1.2) are somewhat limiting.
Wicket and GWT are quite nice too, although GTW has a little bit of a learning curve. Then again, most every technology has such a curve and this really shouldn't stop a professional developer. Those two however are alternatives to JSF, you don't use them in addition to JSF.
I would not really suggest going with JSP and Servlets. Those are representatives of 2000-era technology that have little place in today's development landscape (Servlets definitely still have their use, but for specialized cases, not as a primary component for UI elements).
If you are not limited to page-oriented approach, I recommend you to take a look at Vaadin. It is based on GWT, but much easier to learn for a Java developer. I think the the functionality you need can be implemented in one or two Java classes.
I've the same use-case as you. Underneath I use Lucene as my search engine. The beauty of using IR libraries is that the search input screen is simplified. I have just 1 text-field on my web page (like www.google.com).
I'd suggest you stick to the basic web technologies of Java EE for this and those are Servlet and JSP. You describe the UI in JSP and have it POST it to Servlet and then Servlet will use a service layer for application logic.
I suggest if you don't have experience with Java Web app development, go for Servlet/JSP model. It's simple and intuitive. Also, JSPs can have Java code.
GWT is a bit complicated, so is Spring.
JSF
Wicket
JSP/Servlet
Servlet(JSP)||JSF & Elasticsearch||Solr
Yes jsf is the newer technologie but you didnt need something big for this project..
here is a nice example project https://github.com/scrutmydocs/scrutmydocs

Beginning Google App Engine Java - Which Framework to start with?

I am new to both JAVA and Google App Engine. My Interest in Java stems from its compiled nature, speed and widespread enterprise use, whereas my interest in app engine is mainly because of it's initial free nature along with scalalbility.
I have been through Google's Getting Started and FAQ, I have modified the guestbook app and generally played around with the datastore, creating a simple entry system for use at work, using database schemas similar to the guestbook app. I come from a hackish PHP background, and most of my app consists of JSP pages with HTML and scriptlets mixed, with classes for the datastore stuff.
I have read about JSP, JSTL & JSF(not much) and also the basics of appengine, it's limitations,strengths and quotas. I also understand that my current approach is flawed. I have searched for JAVA frameworks and found one too many. I have been through the Will it play in App Engine list, but I do no half of the stuff mentioned there. I understand that webapp(used in the overview) is a framework and so is GWT. I understand I have to learn core java first.
What framework should I begin with which is easy to use and also robust/secure enough to handle a financial app? The framework should also have value, if I were to host it in a pure J2EE environment independent of App Engine.
I would appreciate a word on study resources too. Currently I see this book on amazon as a resource but are there cheaper alternatives like a library with a monthly subscription from where I can peruse similar books.(and I know that Google is a real good resource.)
Are there any developers here who have apps hosted on appengine java and would like to share their personal experience of appengine java with a beginner?
I use Eclipse with the Google App Engine plugin to develop and upload my apps.
Regardless of what you want to do in Java you absolutely need to learn your way around the core language and the basic part of the runtime library.
The Java Tutorial covers this and is pretty straightforward.
Then you need to learn the Servlet API which underlies almost all Java-based web solutions today. Sun puts this in the full Java EE tutorial (which is a bit heavy) so have a look at this quick overview.
When you have gotten so far, you have a much better idea of what your basic toolbox is, and can give information allowing to give better advice on what technologies you should choose.
Sorry for the steep learning curve, but the view on top is fantastic.
If you aren't doing Java development currently, and/or haven't done much web development. I definitely wouldn't complicate things with adding frameworks.
What are you trying to accomplish that you need a framework for outside of the Google App Engine stack?
I've been developing with Java for years and only started using Spring with my Google App Engine app because I need a good security and authentication option. I wish I didn't have to use it since it's a rather steep learning curve.
You should be able to do most everything you need to for a simple app with JSP. If done correctly you can even do it in MVC if you wish.
On top of everything else people have recommended, I suggest you take a look at Objectify, a much simpler datastore API than the JDO/JPA ones included in the App Engine SDK.
This is, of course, after you've gotten familiar with the core of Java first.

Categories

Resources