I'm working on a client-side Java application for which I want to create a web-based user interface (which will be served up to a browser from the local app). At the risk of oversimplifying, its a microblogging tool that will support functionality similar to Twitter and Facebook. Its open source, and you can read more on our wiki.
Its important that this app is extremely easy to use, and I also want it to look good relative to contemporary web applications (such as the examples available on the Chrome web store). Since I am not a web designer, I'm hoping to use tools that give me an attractive UI "out of the box". Oh, and I need to keep the distributable file reasonably small (un him so whatever I use needs to be reasonably lightweight.
So far, I've looked at Sproutcore and GWT.
Sproutcore apps definite have the appearance I'm hoping for, but I'm not that familiar with JavaScript, and after some experimentation is not entirely clear to me how I will achieve some of the more sophisticated functionality that I think I'm going to need.
Being Java, GWT is more within my comfort zone, however I had a hell of a time just getting my development environment set up properly. It seems that GWT wants to dictate the structure of my application, but since the user interface is only a small part of it I'm not willing to build the entire app around GWT.
Something else I've been thinking about is using CoffeeScript (which seems more palatable him and him him him him him than JavaScript, and there are Maven builders for it), perhaps together with JQuery-UI.
What other options should I consider?
To recommend two big javascript frameworks Sencha and Cappuccino.
These have an extensive UI toolkit out of the box. The latter has an MVC framework build in, the former has a general JavaScript library build in. Both come highly recommended.
Also as recommended jQuery UI is a reasonable toolkit. I would personally couple Sencha for its rich UI toolkit and a lightweight MVC framework like Backbone. I'm afraid this does require learning JavaScript well.
You can also instead drive your JavaScript UI toolkit mainly from the server and skip the clientside MVC. For that sencha should surfice as a UI toolkit, but if you want meaningful functionality you will need some more structure. I would also recommend RequireJS for modular file management.
Take a look on Vaadin its based on GWT but simpler to use. I use it since 2 years and i'am not a designer too.
Take a look at jQuery & jQuery UI (jQuery Modile if you are looking to deploy to hand held devices)
Also, since you mentioned that you are not a designer, you might want to implement the front end in an MVVM pattern to separate the UI from the business logic of your applications. Knockout is a nice way to do with with decelerative data binding
I don't like writing plain JavaScript, so I'll tell you little bit about Java based frameworks. Recently, I've picked Google Web Toolkit.
Pros:
plenty of materials
Eclipse + Google plugin
Very intuitive API
3rd party libraries
Fancy widgets + optimized JavaScript
lot of generics
very active community
awesome async callbacks
Cons:
very slow debugging, that will drive you mad sooner or later
lot of deprecated code for so young framework
Mixed feelings:
You don't have to write declarative UI (you can do Swing-like development), but your code grows bigger and less maintainable, so it is quite probable that you'll eventually learn some declarative UI like UI Binder
Visual designer for GWT is somehow nice, but very unstable (eclipse) :(
Some considerations:
Do some prototyping with Vaadin. Try some debugging. Then try GWT and debugging on similar sized project. Consider debugging as the VERY important decision factor, because GWT debugging was the most frustrating thing for me.
Consider JSF + some nice rich component framework for JSF like RichFaces, IceFaces, PrimeFaces etc (but you app won't be "light" and "small" anymore if you really care). Be sure to be perfectly comfortable with environment (IDE + plugins), nothing beats JSF there (I'd pick RichFaces + Seam today, if full Java EE is option).
If you don't want to learn javascript I recommend you GWT with Sencha-GWT (GXT), you can develop all your app in java language, and also debug your code in java.
It is very easy to create a web app with this technology, and provides almost all funcionality available in javascript version.
Also you can mix it with hibernate and giled to persist your data, and giled helps you to serialize hibernate objects.
I have been writing an application in SproutCore for the front-end and a Java backend. In my mind this works perfectly.
The backend can stop worrying about HTML and JavaScript contents on the client side, if the request is XHR or plain request/response. I can implement the backends using plain old Java Servlets, and only worry about the data that is passed between the client and the server (JSON for the most part).
The client becomed fast and responsive, and SproutCore has a rich amount of components that you can mix and match.
So in other words with SproutCore (and Cappuccino and other full-blows MVC JavaScript frameworks) you can let your client do what it does best : Render and display HTML, CSS and JavaScript, while leaving your server to worry about what it does best: retrieve, store and update data. If you are interested, the source code for this project is available with the GPLv3 licence: https://github.com/joachimhs/EurekaJ
I have written an article about the differnt approaches between server-side MVC and client-side MVC here: http://haagen.name/2011/05/24/The_RIA_MVC_Model.html.
Also SproutCore comes with the MIT licence, so its avaiable for use without (m)any restrictions.
Related
We build Java Spring MVC web apps for internal company users that have pretty basic GUIs. A few have jQuery/Ajax to add some GUI richness, but nothing major. For a new app, the business users are asking for a very rich web app (ex: drag and drop functionality, flexible tables like in Excel, etc). Our users can only use IE8 and we can't run Java applets in the browser. Also we don't have the time to learn an entirely new language (ex: Flex), so the learning curve can't be too steep for Java MVC developers. This app will only be used by company internal users (~ 100 concurrent users).
I have looked into some of the newer Javascript MVC frameworks (ex: Spine, Backbone, Ember). My main concern is that I am not sure how well the resulting complex Javascript will run under IE8. A secondary concern is that we don't have experience trying to maintain a lot of code in Javascript. It seems like a lot of Javascript code would become a maintenance nightmare (non-typesafe, harder to debug, not as many tools, etc).
I have also looked into GWT and ZK. These frameworks reduce the concern about maintaining a lot of Javascript code, but the IE8 performance concern still remains. If we built a very rich GUI in one of these frameworks, would the resulting auto-generated Javascript work well in IE8?
What framework would you recommend that would meet the high-level user requirements listed above and also meet the non-functional requirements (small learning curve, low maintenance burden, good future support)? Has anyone tried to do something similar to this? If so, what did you use and how did it turn out?
We are working with Vaadin, which is quite similar to GWT (develop Java code), an it works fine in all browsers. For us, scalability of the view is the more important thing (manage large code sets)
You can go with ZK OR Primefaces
Both are very rich web framework Just explore their Demo decide which will be very helpful for you.
Vaadin supports drag and drop but programming model for d&d is a bit nightmarish.
I would certainly pick GWT in your case. Google guys put a lot of work to have it working with ie8 well. note GWT has good tool support like Eclipse plugins. to avoid writing everything from scratch, you could start with some framework that builds on GWT like gwtplatform or ExtGWT.
You may also consider ADF Faces, it has a very rich component set, you can see a demo here.
In my company all our projects are done with Apache Wicket.
This java web framework is simple, powerful, very efficient, component based and everything is testable.
And the community is great.
Have a look to http://wicket.apache.org.
Francois
I am planning to write a medium scale web application. The server side technologies will include Java, Hibernate, MySQL and the client technologies will include Html, CSS, Javascript and Jquery.
I am looking for the best suitable Java framework for developing web (Struts, Spring, Wicket and so on).
I consider myself heavy Jquery user and I really prefer to do client side stuff.
Wicket for example has modules like the date picker and other modules (AJAX) that should make life easIer with javascript and acts like a replacement to it. But I really prefer javascript.
I thought of writing an application with client side and Java Web Services.
What do you think?
Do you know a framework that isn't afraid of Javascript or don't
suggest replacement to it but tools to use it?
Component-based frameworks generally provide ready-to-use components, that come with their own JavaScript code. If you don't like this, I would stick with action-based MVC frameworks, which generally don't care about what you use at client-side.
My preferences go to Stripes and Spring MVC, but YMMV.
I'd recommend the Play! Framework.
It is a MVC based framework and you can use hibernate, work with a MySQL database and it offers templating for easy HTML generation as well as working well with CSS and Javascript (even includes latest JQuery in download). There are also tons of modules you can add to your project to make development faster and easier.
Play 2.0 should be released fairly soon (currently available in beta) which provides support for CoffeeScript and Less CSS (see here) amongst many other new features.
Edit
StackOverflow answer showing how easy it is to create webservices in Play: https://stackoverflow.com/a/4513047/681807
Well all the framework you have mentioned (struts, spring, wicket) , none of them afraid of javascript.
Like in Struts2 and Spring they have provided build in ajax support for developer like me who is more comfortable with serverside development than client side work (ajax/jquery fancy stuff).
Its on individual how he/she is using JS with any existing framework and you are even free to use simple HTML at you client side with whatever JS way you want to apply to your UI.
Framework support to UI is always intended to provide a close integration to the server-side so as to speedup the overall development time.
In Short i can not recommend any framework as that will dependent upon you project requirements which fits perfectly as per your need, but none of the framework will stop you to use JS in the way you want to use.
I'm a newcomer to JSF and am still trying to follow examples to learn the basics of how it works, and that has now lead me to begin exploring ICEFaces.
I love the concept behind GWT that you can just write in pure Java and have it compile down to JS and HTML, but I have also heard that ICEFaces offers a lot of things that GWT doesn't.
That led me to start thinking: is there a way to combine the two in a project, and get the best of both worlds? Is it possible to get the AJAX-centricity, rich UIs and underlying capabilities of JSF, but then use GWT to handle all the client-side code generation?
I looked at something called ICEPush which may very well do just this, but without fully understanding the roles both technologies play in MVC web apps I wanted to take a moment and see what the SO community thought of such a hybrid solution.
Having said that, I was wondering if someone could break down - in quasi laymans terms - the intentional difference between these two frameworks, and to give argumentation as to why they can be - or shouldn't be - combined inside the same project.
Essentially I'm looking for an AJAX-friendly, rich UI Java webapp framework that is open source, has an active dev community, and comes loaded decent/good documentation.
Also, not that beggars can be choosers, but I'd appreciate it if answerers don't solicit other solutions besides ICEFaces or GWT. I'm very well aware that these are not the only two webapp frameworks out there, and this question isn't going to convince me to start using either of them; I'm simply interested if their strengths can be combined, or not.
Thanks in advance.
JSF in general makes heavy usage of javascript. JSF or bette the JSF frameworks provide lots of components. The Javascript is generated on the fly.
GWT compiles the Javascript upfront. It provides some components as well. GWT is doing AJAX calls to its interfaces.
I'm not aware of any bridge that allows you to integrate JSF with GWT. So there is no interface and those technologies don't work together.
Both come with good documentation and have an active community.
ICEpush can be used directly with GWT; you can find out more about the integration here:
http://www.icepush.org/product/icepush-GWT.html
ICEpush provides a simple API to "push" notifications to the browser. Essentially, users (or browser windows) are organized into groups. When something interesting happens (such as a new photo uploaded to a photo sharing application) you can invoke a push on the group users.
In the case of the ICEpush GWT integration, you receive a callback into your "Java" code and can respond to the notification (such as, display the new photo). A GWT application can potentially run offline, but that does introduce the risk of application code being subject to offline attack.
In the case of ICEfaces, the ICEpush integration is abstracted away: rather than a "push" to a group, you "render" a group. With ICEfaces you request that all relevant pages be rendered on the server and any necessary page updates are sent to the browser. This makes it particularly easy to add Ajax Push features to an ICEfaces application.
So, the choice is really whether you want to use JSF or GWT. With JSF you have a standard server-side framework that emphasizes pages built from declarative markup. It is the natural successor to JSP application development. With GWT you have a procedural client/server distributed framework that emphasizes events and pages that are built from "Java" objects. It is the natural successor to AWT/Swing on the web. Both are very popular, so it's more a question of the technique you prefer.
I´ve been developing web appplications using Microsoft technologies for a long time, but now I´m been asked for building a VERY BIG application on a Java Web project. For some reason, I´m being forced for using GWT as the front-end; I´ve read some comments about it where some people says that is not the best option for big/enterprise applications (In this case, is something almost as complex as an ERP). Another requirements are: allow connecting to multiple databases, using a technology for rapid development and having a low performance cost (users don´t like to wait for pages to load)...
So the questions would be:
- Is GWT the best option?
- If so, what´s the best back-end (Java technology) that we can use? I´ve read that it could be Groovy, Spring Roo or JSF.
- Should I user Hibernate, or creating another light-weight option?
Thanks in advance
GWT is a serious framework no matter if it's used for big or small project. Before committing to GWT you have to realize that:
it's a client(browser)-based technology
it's a translation layer from Java to JavaScript where JavaScript development is either eliminated or reduced to a minimum
it's capable of integrating with server (middle tier), especially well with Java-based ones no matter what technology it uses: JDBC, Hibernate, GAE, proprietary, etc.
it's tailored toward Java/desktop developers so expect steep learning curve if it's not your background
it requires fundamental understanding of MVP (variation of MVC) frameworks
it requires familiarity with JavaScript browser technology
big projects with GWT will require using supporting frameworks like GWT MVP, Guice, gin, gwtp, etc.
The good analogy would be Swing or Eclipse RCP. They offer rich GUI desktop development platform while integration with variety of server-based technologies. But the target platform for GWT is a JavaScript-enabled browser, not a desktop.
GWT is a very capable platform and is fitting for projects of all sizes especially since 2.1. The Google Wave team helped the GWT develop APIs and practices that really help in using GWT for large projects. As far as coming from a .NET background it may be a steep learning curve at first, but Google's getting started guide for GWT is a good place to start and you should be able to hit the ground running. One thing that people often forget is that GWT is actually just a compiler that emulates portions of the JRE and in the end it is all just HTML, CSS and Javascript.
For back end technologies there are many options, but there are actually 2 decisions you must make. First you will need to decide on a web/communications layer. The way I see it you have 3 main options for the type of communications before we even get into implementations: GWT-RPC, REST(XML or JSON), or SOAP. I prefer REST with JSON however, if you have no need to expose your services outside of GWT you may be better off with GWT-RPC. If you choose to go with REST or SOAP you may even choose to not use a Java back end but instead use .NET to stay in your comfort zone. To do this I would write an XSD to describe your data model and use .NET to persist and expose your data as JSON via REST. You can then use JAXB to generate a Java representation of those classes for use in your GWT client however you will have to strip out all of the XML annotations and modify them to work as overlay types.
Secondly you will need to decide your persistence layer. Many prefer Hibernate, but I prefer JPA, either will work great for enterprise level applications. The advantage to using a Java back end with GWT-RPC communications is that you can use the RequestFactory with EntityProxy so that you only have to maintain one version of the object from the client through the persistence layer.
First you can't use JSF for back-end
i suggest you to use hibernate for back-end
and jsf for front-end especially the new version jsf2 with the power of CDI
and i recommend you to use Richfaces , Primefaces as lightweight jsf components
and also Seamframeworkas development platform
if you use it i think you will have the most powerful java web technologies
GWT can serve you in big project but it may take double time comparing
with JSF
but if you like GWT you should
Have a look at Vaadin
There are zillions of Java web application frameworks.
95% were designed before the modern era of AJAX/DHTML-based development, and that means these new methods are grafted on rather than designed in.
Has any framework been built from the ground up with e.g. GWT + Extjs in mind?
If not, which framework has adapted best to the world of forms with dynamic numbers of fields and pages that morph client-side?
Echo2 / Echo3 by Nextapp (www.nextapp.com) is totally awesome.
Advantages over GWT:
1) It is not limited to a sub-set of java like GWT
2) It is easier (in my estimation) to learn
3) Has extremely robust design studio for almost drag and drop designing.
4) It is very fast, and works very well on all platforms browsers
5) You can write your application using either java script or java
6) It has great and straight forward methods for handling events and actions.
Personally I think that for any web-application in which you are trying to integrate java and speedy delivery I wouldn't hesitate to pick Echo3 or Echo2.
If you're starting from scratch. I'd have to say Google Web Toolkit. I have to say it is incredibly powerful. You get keep using most of your Java tools. Plus, you don't have to duplicate code that exists on both the server and the client, it just gets compiled differently for each area.
I'd consider REST-style frameworks as well as the other recommendations here- Restlet or Jersey may be good choices for the backend, while you use something like JQuery or GWT on the front end. Both frameworks can easily produce JSON, and the REST style provides a nice clean line of demarcation between your client application and your server source; I find that JSF can make that demarcation pretty muddy.
I use JSF and IceFaces. Although JSF has a few limitations, IceFaces seems to work pretty well and has ironed out a few of the problems with JSF.
I haven't used a really good AJAX Java framework as yet, although Echo2 looks interesting.
I like the stripes framework. It lets you use whatever javascript toolkit you want.
Here is their documentation on AJAX
GWT is quite powerful and easy to use (all Java, no Javascript/HTML/CSS coding). If Google has their way it will be a dominant framework/tool in web applications development, and for good reason. It already works with Google Gears (which allows offline access to web apps) - and more than likely will be optimized to work within Google Chrome.
DWR
I use this to dynamically populate drop downs, and even filter them on the fly based on user input in other places on the form.
I like the combination of JBoss Seam and Richfaces, especially with the JBoss tools that are extentions to Eclipse - makes building these sort of RIA's incredibly easy.
Wikipedia contains some useful comparisons:
Comparison of JavaScript frameworks
List of AJAX Frameworks
Your choice depends on several different factors including whether you want the "work" done client-side (most javascript frameworks) or server-side (echo2 etc.). Other things worth looking at are tools like OpenLaszlo that provide Flash (I think) out of the box, but drop back to DHTML if there is no Flash player present.
Unfortunately I think the decision comes down to balancing several competing cocerns. Check out the comparisons and try them out - most come with online demo's for you to try.
Aptana has a server side frame work called Jaxer. This is from their site:
Jaxer's core engine is based on the same Mozilla engine that you'll find in the popular Mozilla Firefox browser. This means that the execution environment you use on both the client and the server are the same. It's Ajax all the way through and through. That means you only need one set of languages -- the languages that are native to the browser -- to create entire applications.
This framework is open source and has a very nice IDE based on Eclipse. Aptana is also working on a Javascript implementation for ActiveRecord called ActiveRecordJS. Potentially you could use this both client and server side with their framework.
GWT is one of the best AJAX framework that I used ever. Most important thing about this framework is that its maintained by Google. And Everyone know "Who is Google ?"
GWT is used by many products at Google, including Google AdWords and Google
Wallet. It's open source, completely free, and used by thousands of
enthusiastic developers around the world.
GWT provide rich widgets that can be used to built any application. Almost all the widgets they have.
Another important point is GWT is continuously developing and its also have stable release which is very good thing. Another thing Google has also released GWT-Material which is again a very good thing because everyone is moving toward material.
I hope this will help you!!!