Related
I am student. Currently, I am experienced with Core Java and very introductory Servlets and JSPs concepts.
For my summer internship, I have a task at hand where I am to develop a social CRM for a small startup.
I am very new to web development, I have no prior experience in this field, I am familiar with the technologies involved though, however I want to start off now and develop a good project in the summers.
I want to base my project on Java, I am considering using GWT for all client side AJAX work along with a J2EE server.
Would this be a right decision on my part? What is the learning curve involved with GWT? Can I really start off with something like a small CRM without doing nothing more than a HelloWorld previously?
Need some suggestions as to how should I kick start my work and progress quickly with concepts and my project as well.
If you want to develop a good project, like you say, then I believe this is a very fine choice. It's certainly not the easiest one (you could probably hack something quickly with PHP etc.), but I'd say that it really pays off.
I would suggest to follow the official tutorial and the remainder of the official documentation (stay away from the "Editors" framework for now though, it's madness at the moment.)
If you already have a solid background in Core Java, and if you get the right picture of how GWT works (eg which code is transformed to JavaScript / when HTTP requests will occur / ...) I think you can absolutely do it. Make sure to get some solid HTML/CSS and a little bit of JavaScript background first.
I must add, that I would personally not go the Roo route (sorry #jgrabowski) - especially not at first (probably not ever, even though Roo is probably a very good tool, if you like such tools.)
Understand the GWT technology,
create a few very simple prototype apps (just for fun),
then learn to apply best architecture practices, and improve your code.
And maybe you'll find, that a different architecture may even work better for your app (Just as an example: In the case of the largest application I'm currently working on, the generally-suggested MVP architecture would simply not work very well, at least not the way it's usually presented. So it's sometimes better to form a good solid understanding first, instead of blindly copying "best practices". Then you can make an informed decision, and develop a good project!)
You can start playing with Spring's Roo and generate GWT skeleton of your application. Then you can analyze it, try to understand it, improve it (and even remove Roo from it afterwards:-).
Roo is able to generate well architected GWT application that is inline with current best practices, so I believe it might be good start for you.
Found an excellent source for exploring GWT in depth.
I would stronly recommend the book "Google App Engine Java and GWT Application Development", as of now the book is quite updated on GWT, GAE and the APIs.
https://www.packtpub.com/google-app-engine-java-and-gwt-application-development/book
In recent months the GWT Activities and Places pattern has matured.
The example covered at http://code.google.com/webtoolkit/doc/trunk/DevGuideMvpActivitiesAndPlaces.html gives a broad introduction to the pattern. The downloadable sample will lead demonstrate how to 'slice' your application into Activities and Places. This pattern will take away some of your 'architecutre' concerns - you can just go with the flow and do it the A & P way.
Note, however the intro page and the demo code are very light on UI. Separate to your architecture planning you'll need to get up to speed on laying out a GWT app - but that's also covered well in the GWT articles. As #Chris-Lercher suggested, create a couple of UI prototypes that you're happy to throw away to get you started.
I am torn between Wicket and Vaadin. I am starting a micro-isv and need to make a choice of web framework. I have narrowed down my choices to Wicket and Vaadin. I have used both frameworks and I love them both. however I need to make a choice.
If If I choose Vaadin:
I wont have to worry much about the look and feel. It comes with nice themes.
I will do all my programming in Java which am very good at and wont have to spend time hacking CSS which am not very good at.
And most of the components that I will need for a business applications are there OUT OF THE BOX including, desktop like layout, tooltips, Keyboard shortcuts, tables with draggable and collapsible columns to name a few.
However, if I go the Vaadin way:
I will loose the ability to create UI declaratively.
I wont have the fallback feature if the browser doesn't support JavaScript - e.g most non Webkit mobile browsers.
Vaadin company is selling some components - e.g the JPAContainer so am not sure the company will be committed to offering full open-source framework. Business interests will always come first.
Vaadin applications will be mostly for the intranet. They are not very suitable for the internet with a web look and feel.
If I go the Wicket way:
I will have to style my applications and I can hardly give them a desktop look and feel.
Any advice? Anyone with experience on either framework kindly tell me the cons and pros and how you made your decision.
I think I've invested some time for both frameworks. I really like both because they bring the Swing-alike coding to web development. And I don't know easier ones for me (although there is click but I don't like the velocity templating thing)
And yes, there are differences.
I wont have to worry much about the look and feel.It comes with nice themes
true, but every serious company will style its app differently (unless you are prototyping)
I will do all my programming in java which am very good at and wont have to spend time hacking css which am not very good at
Then Vaadin would be 'better'.
i will loose the ability to create UI declaratively.
What are the advantages of that? (BTW: you could code declarative in groovy ;-))
But ok. I know what you mean: if you can afford a few separate designers then wicket is 'better'.
i can hardly give them a desktop look and feel.
Why not? Or what do you mean here? Wicket supports ajax and there are components which supports nice 'desktop-alike' things (ajaxlink, lazycomponent, autocompletion, progressbar, see wicket stuff + extensions). ok, for any more complex component you'll have to code in javascript BUT BTW did you know that you could even use GWT within wicket
Some minor experiences:
Vaadin is surely faster while coding (no css, html stuff). But if you go production keep in mind that the ease of programming can come to the cost of performance on the client side: e.g. if you use the 'wrong' layouts such as Horizontal/VerticalLayout, ... the massive use of javascript could slow down old browser.
But Vaadin is not slow! Use appropriate layouts such as CssLayout or FastLayout and also old browser can serve it. (Although if you would use CssLayout your coding-style is really wicket-alike.)
One issue with Vaadin is that it is a bit harder to profile, because you don't see easily where the client needs all the CPU and the nested divs gets cryptic id-names.
One great thing about Wicket is its warp persist integration
(Guice can be integrated in Vaadin and Wicket)
Testing the UI should be easy with Vaadin (although I didn't found unit testing stuff) and is very easy with wicket.
Last but not least creating lists/tables is VERY easy in Vaadin compared to wicket.
I've worked extensively with Wicket but I've not had any experience with Vaadin so this might be (a little) biased.
I'd recommend Wicket for obvious reasons, but what's probably of interest to you is Wickets openness. As Gweebz rightly pointed out, Wicket uses basic HTML markup as its foundation, so any structural or cosmetic changes are often trivial to implement.
Personally one of the things I really enjoy about out wicket work is the flow between front end presentation and the data backend, we've implemented Spring & JPA/Hibernate which means that any changes in the front end can be translated back into the data base with a single line of code thanks to Wickets model based architecture.
Again I can't say much for Vaadin having never worked with it, but if you're looking for architectures to start off with, I'd also recommend you have a look at GWT.
(continued from the comment in the first Wicket-related answer)
The major difference between Vaadin and Wicket is with how UI composition and client side code is written. With Vaadin you usually compose your UI without any templates or HTML at all and you get a sleek, fully Ajax'ed UI out of the box. However, if you prefer the templating approach just use CustomLayout which does exactly that.
Client side coding is rarely needed, but when it is you do it with the Java-based GWT which is IMO a lot more nicer than writing Javascript by hand. Besides, with GWT you automatically get cross-browser compliant solution instead of having to deal with those issues yourself.
When comparing frameworks you also should take a look at community activity and documentation. With Vaadin both of those are excellent. Also note the Vaadin Directory which currently contains 100+ very useful UI components and other addons.
I have a limited amount of experience with each but I prefer Vaadin. It allowed a richer experience with the web application I was developing. The main benefit that sold us though was how easy it was to write unit tests around our UI classes, ensuring the components functioned correctly when interacted with in the expected ways. This is also possible with Wicket however it was more difficult in my experience.
I will also mention that either framework will require some styling. Wicket starts off as plain old HTML and Vaadin starts off with a MacOSX-like theme by default but almost any web-app you write will require at least SOME customization. With this in mind, customizing the CSS of a Wicket app is SIGNIFICANTLY easier than Vaadin for the simple reason that you control the markup. Vaadin hides the markup from you and generates elements with weird IDs and structures so it is harder to customize the look. Just remember this when making your decision.
I am currently working with Wicket and I have worked in the pass with Vaadin. I wil be short in my observations:
Vaadin is entitled to be free but IMO, is not so beautiful like that. If you need support, help, documentation for that painful and tricky problems that you encounter, then you are screwed because you do not have so good documentation/community when compared with Apache Wicket. Vaadin have guys to help you, but you have to pay for it.;
To program in wicket you need to be a strong programmer. Vaadin also requires good Java knowledge but you can easily do some spaghetti code if you want (just saying, not doing..);
Apache Wicket really separate the web technologies (Javascript, HTML, etc.) from the framework technology (Java). Vaadin also try to do it, but IMO is not so elegant and transparent on that.
Appart from that, we are talking about two different types of frameworks, two different approach, which have pros and cons that I advice you to search and compare and see what really fits your needs.
Edit: Oh, and about the look and feel, for instance you always have Wicket Bootstrap
Also do notice that even though Vaadin base framework is free, for some additional functionality you might need to buy extensions.
Ex - If you need to integrate a good charting solution such as Highcharts, you'd have to pay and buy the vaadin charts extension (even though highcharts is available free for FOSS apps, the vaadin charts plugin built on that is not given free for FOSS apps).
Thank you for your question.
The answer is short and simple
Vaadin is a great tool for java developers who needs to develop web apps, but it is a powerful WAR Machine if you have moderate javascript knowledge, and some basic css skils.
Vaadin is not slow, it is even faster than React and Angular.
If your app is slow, it's because you designed it wrong, and that's true to any framework you use.
Keep in mind this, Vaadin uses web components, so most of the UI is built on the client, no heavy rendering on the server
In your case you said you don't have css knowledge, two options:
Use Vaadin, or hire frontend developer.
I am a web developer for more than 10 years, and I have started as a php developer and a javascript developer.
I can tell you that once I've got into Vaadin, I can not develop another way.
What to choose depends primarily on the business requirements (see points 2 and 4 of your question)
However, if I go the Vaadin way:
I will loose the ability to create UI declaratively.
You can try using the ZK framework - similar to Vaadin with a declarative user interface in XML
I would like to write a somewhat complex web gui application.
It will be used to edit certain content by displaying panels and allowing the user to drag items to edit the content.
The explanation is somewhat abstract, but the point is that i'm looking for a modern gui writing technology, the more standard it is the better odds of me finding information and samples to using it.
I've been using JavaFaces to write some simple web pages and have taken a look at RichFaces for purposes of writing the app described above.
I would love to hear recommendation of similar technologies (For example - What was used to write this website?)
Thank you!!!
Update: Thanks for the answers so far, Since I was asked for more clarification I'll try to explain the use of the app:
It will be used to edit a complex script. There will be one panel with the actions of the scripts (The phases) and the other panel will show the content of the currently selected action. To each action type there will be a different set of attributes to modify.
You will be able to reorder actions by dragging them to a new location (Kinda like powerpoint slides organizer or flickr photo organizer) and also copy them that way.
The content of the action attribute panel will be able to display various types of content such as html text and buttons and all kinds of stuff.
Hope that helps. Thanks Again!
Update2: After reading this StackOverflow Thread I'm leaning towards RichFaces for it's vast support and standardization.
It seems you need a RIA. The Java worlds offers the following options:
Google Web Toolkit - a powerful RIA technology, which will require you to go through a steep learning curve. Nice component frameworks are SmartGWT, gwt-ext and ExtGWT. In my opinion all of them have some drawbacks, but in your case you might not observe them.
RichFaces - quite powerful as well, and since you have JSF experience, I'd recommend this.
ZK - never used it and I don't like some aspects of it (at least a while ago when I last checked it), but it's still an option.
Echo3 - similar to GWT in the way of development, but very different in the actual result. I'm not sure, however, whether it's still in development
JavaFX - if you are adventurous, and your application won't be used by the open public, try it.
ASP.NET MVC was used to write this site.
To your question: you should use the technology you like. If you've used to Java, you may wish to explore various MVC frameworks for that. Or you can try out new unfamiliar to you (yet) technologies.
Take a look to GWT and SmartGWT. Together are quite a powerful combination to write RIA webapps.
An interesting framework that I would be glad if I had the time to look deeper into is Cappuccino. Look at 280Slides for an example.
Flex is also nice open source option to create Rich Internet Applications. If you would like to stick to the JavaScript then you can use JQuery, YUI etc
There is also one very interesting thing called Vaadin check it http://demo.vaadin.com/sampler/
ICEfaces is one possibility. Demos here.
I used richfaces including drag and drop functionality, realy nice to offer good usability.
If you like the Java Web Technologies take a look at zk. It promises the same things as ICEFaces. I don't know if it can live up to that promises but IceFaces coul certainly not for me.
ZK should enable you to build your web app like a common swing app.
I'd suggest that you do not invest into technologies/frameworks which are based on integration of browser side ajax capabilities with server side frameworks if you'll need advanced functionality in the browser.
What is advanced and what is not is a completely different topic of course, but just to give you a heads up, as you start facing more and more complex UI requirements, you'll discover that the connectivity to back end framework (like JSF) will become more of a problem than a capability. Especially with things like JSF lifecycle, and most of the server side frameworks being based on the idea of an HTTP post (for client-server communication), you'll have issues.
An example: you'll be requested to develop a very specific UI widget that has drag and drop capability. If the Ajax-jsf integration framework of your choice does not contain this widget, your problem is born at this point. You'll start looking for ways of injecting data into existing channels, and it will get messy.
To avoid further speculation, let me just repeat that if you are sure that your chosen technology setup will give you 90%+ of the capabilities you'll need, that is ok. If you end up developing too much custom stuff, then consider an integration between a powerful client side (javascript or flex or silverlight) layer and a simpler server side layer (resteasy etc) Initial development may not be as fast as the other options, but if you'll need flexibility, this will end up being a much cleaner setup. I'd suggest you take a look at DOJO, and ExtGWT .
Cheers
Seref
It looks like XHTML + JavaScript could be enough for the dragging & dropping functionality you describe. This means you can use just about any web framework of your choice. If you need frequent asynchronous server calls (AJAX) then GWT is the most standard Java framework I think, although it has its peculiarities. Personally I like Wicket because it does not use XML configurations, relies heavily on code and has a nice community around it. Wicket also offers good AJAX support btw.
I work in a medium to small team ( 10 people ) developing and supporting several web enterprise applications.
We have a dozen of them built with a house-made framework with asp-classic working against ms-sql server.
We are evaluating the migration to a new development stack.
We'd like it to be open (free) and simple.
I've been looking around the java web frameworks, but all of them seem to be extremely overbloated for our needs (with the possible exception of http://www.playframework.org/, which I couldn't study yet...)
We are thinking about porting our own framework to this new stack, rather than adopting a whole new stack that we are unaware of ...
so far now, we though about the following possibilities
plain java - jsp - jsf
groovy - gsp (no grails at all)
jruby (no rails at all)
we feel really comfortable working with dynamic languages (well, as dynamic as classic asp can be) and with a lean and understandable framework...
I see no small and simple web frameworks for java, like there are for php or ruby...
I really like groovy, but I see no web implementations outside of grails... Besides the language documentation doesn't seem to be quite complete (I might be looking in the wrong place, perhaps)
php could be an option, but I think it would be hard to advocate for it in my current work...
any other option, advice, pros and cons?
thanks a lot
--
edit
some related link Can anyone recommend a simple Java web-app framework?
I'd suggest you take another look at Grails. It does use hibernate and spring under the covers, but for most situations, you don't need to know the details of those frameworks. There's a large community and lots of documentation/blogs/mailing lists for support, as well as a thriving plugin community with over 300 plugins solving pretty much any need.
If you're still put off by grails, you could look into the play framework. I don't have any experience with it, but there has been some traffic recently around it on hacker news and the like. I know it uses groovy for the templating language.
I cannot recommend anything, but strongly recommend that you consider these things:
Rapid development. Basically you want to save a page file, and reload it in the browser. Instantly! It can be done, do not settle for long deployment times.
Plain, readable text files!
Convention coding instead of explicit coding - big XML files will eventually drive one or more developers insane. The less, the better.
Good tool support (just having syntax coloring may be a big help)
Consider the long term support of your choice. You are basically remarrying with your software - will it still be maintained in 10 years? By whom? Will you have alternatives (JSR's are great - look at the amount of servlet engines)?
And WHEN you choose - get the source code for it, and ensure that it builds correctly. It will never be easier than now, and some day you WILL need to fix something inside. On short notice! (You may even consider allocating resources for donating documentation/patches/time to the open source project you are building your business on).
EDIT: A few more things:
You want to be able to verify things at compile time. One of the things that make it possible to build cathedrals in Java is that the static typechecking prevents a lot of nasty runtime errors. "Oh, THAT method? Well, it's not here, sorry. Boom!"
You want good error reporting. Built in! Try throwing a NullPointerException deep, deep down and see what 1) the user and 2) the developer is told about it. Anything that requires going to a log file to get the details WILL cause calls at 3 AM eventually.
Look into scalability from the start. Any non-trivial customer will need to and the world goes to multicores, so you might as well think about it already now. What will you do when all the magic pixie performance dust has been used and it just isn't enough: The application requires more than a single box.
And read this: http://www.pragprog.com/titles/mnee/release-it
You're forgetting about the other major player in this field: the LAMP stack (linux, Apache, MySQL and mod_perl). All components are free, there are many books available on LAMP development and each of these components, and there are vast numbers of libraries and components already available.
Apache: the Definitive Guide
Learning Perl: by SO's brian d foy
Practical mod_perl
If you are afraid of Grails and need Java, try Stripes and read the excellent Stripes book (http://www.stripesbook.com/blog/). You can buy the eBook pdf for $23. The book covers the framework in amazing detail. Stripes is a very strong, lightweight MVC framework that deals with all the common problems of web development (templates, url mapping, form validation, security, internationalization, testing) but it won't automagically create the database layer for you unless you want it to by using Stripernate. You can also use Groovy with it. You can use it standalone or with Spring.
I've had great success in simple web projects using Spring MVC with JSTL JSPs. Spring MVC is a framework that can be kept pretty darn simple (1 additional XML file used for configuration). You can eschew all the fancy options and just specify a set of JSPs that you want to associate with view names, then forward to those views by specifying their names in the controller.
Spring MVC can also easily scale up and be as complex as you need, letting you switch from JSTL to JSTL with Tiles, or Struts, or JSF, or Wicket. It can also handle complex web flows using the Spring Web Flow project. But for most projects I just keep it simple -- build a JSTL JSP, create a controller that provides the objects that JSP needs, and associate them by having the controller return that view. Once you get the project set up and you're familiar with the configuration, it takes maybe a couple minutes to wire a new page into place.
If you like Groovy but don't like Grails you could try Gaelyk, which is a lightweight Groovy framework. However, AFAIK you can only use Gaelyk if you're hosting the app on the Google App Engine
If your apps won't be hosted on GAE, and you really don't want to use Grails, another option is to use Groovlets, Groovy template servlet, GSPs.
However, personally I think it's a big mistake to dismiss Grails. It really is a great framework, and you can go a long way without knowing much about Spring and Hibernate. One of your complaints is a lack of Grails documentation. I think you must have been looking in the wrong place, because in addition to all the books available, there's a very extensive reference document and a lot of other documentation available on the website. Finally, there's a very active mailing list.
My platform of choice is JRuby - Rails (3) because of its very rich and powerful ecosystem, but mainly because:
* very easy to use
* many MANY libraries
* fast support via IRC
* deep documentation
You can also check out Scala + Lift Web Framework ( imho best static typed language, nice framework )
Because of the nature of new project we are about to start, I need to get into Java world rather quickly.
I have about 8 years of PHP experience, and about 3 year in Javascript.
(CI, Kohana and my own MVC framework)
I have solid knowledge of OOP (as much as you can get from PHP/JS and little ActionScript & python here and there)
So instead of learning from scratch, i was thinking to grab some web framework (at the end, project will be web based) and learn java along the way. Java code it self don't seam too strange, and i have solid experience with MVC in php so the whole concept makes sense to me.
So I'm looking a list of instructions on how should I learn Java.
(and not to spend too much time on things that are not so important)
Also you can suggest framework, from what i seen, struts looks nice, spring too, but it seam that it have too much XML configuration...
Start with a good book. I always found Thinking in Java pretty good, besides there is a free online version available. Skip the things you already know. Well you probably know what an object is and so on...
Next thing learn to use a good IDE. Have a look at Netbeans, IntelliJ IDEA or Eclipse. Java without a proper IDE is useless.
If you transit from PhP you are probably going to develop some Web applications? This is a steep learning curve. JavaEE is big, complex and it takes a while to dig into all those frameworks. Propably you end up saying "Why is this so complicated, I can do it much easier in PhP". You will be right about that.
Can't give you a good recommendation about the frameworks that are suited best for you. We use Seam + Richfaces. Not that hard.
If you're switching from PHP, and looking at Web frameworks, then I'm assuming that you intend to continue Web development in Java. In that case I would spend a little bit of time on the Java Tutorials, then get into a book on Web programming in Java, like Head First Servlets and JSP. I think it will be a lot more focused on what you need than more general books on the Java language.
(source: oreilly.com)
I also find that once you learn the basics of servlets, JSP, and JSTL, it becomes much easier to understand any of the different Java-based Web frameworks.
None of them required extensive XML configuration anymore, those were the old days.
I will suggest you to grab Java concepts, anyway. Grab a good Java book to learn it along the way, as you said. Thinking in Java is good to go, but its just about core java and concepts. For java web you might want to look into Servlet and JSP basic, which you can learn using official J2EE Tutorial from Sun.
For Java web framework, there are plenty. But I would suggest you something you are already familiar with. You are right MVC based Java framework. Struts and Spring both are MVC frameworks and give you are clear separation of layers. Spring is a giant in itself, it has the answer for almost everything, that might confuse you in the start. Struts 1 is already outdated, and Struts 2 has a very tough competition.
I would suggest you to look into Wicket. It just a web framework, unlike Spring, and a very well written and easy to grasp.
Its a tough task, I must say. Lets see what other has to recommend.
Good point, nooomi. I would suggest Netbeans, its much more intuitive, and sleek.
IntelliJ is amazing, but commercial and not free.
Eclipse is not my type, lot of other folks are quite happy with that. You might find it good too.
So I'm looking a list of instructions
on how should I learn Java. (and not
to spend too much time on things that
are not so important)
I liked Head First Java, but I know some find the format offputting, and experienced programmers probably find it a bit simplistic, the SJCP Study Guide by same author (Kathy Sierra) goes more in-depth while keeping playful tone. There is of course the Java Tutorial online where you can get a quick overview of the main parts of the platform. Effective Java is a good "best practices" book once you have gotten the hang of the basics.
Also you can suggest framework, from
what i seen, struts looks nice, spring
too, but it seam that it have too much
XML configuration...
Another vote from me for Wicket as web framework. For persistence/db part, I recommend you look into iBatis before trying Hibernate. This is a "sql query" oriented framework rather than object-relational mapping, so it will probably feel more familiar to you. I haven't used it yet myself, but from what I have heard it probably has fewer "gotchas" (with regards to caching, performance etc) than Hibernate too.