Java web application development kit recommendation - java

I'm looking for good java MVC web application development kit (or framework), with servlet engine, database persistence layer and viewer layer included and ready to go? One example is TDK (Turbine Development Kit), but it's kinda outdated, and their M.E.T.A. is very hard to work with (it uses maven 1.0).
Thanks,
David

There's AppFuse and Roo if you're looking for "make it go".
If you're not dead-set on Java, there's Grails (and JRuby on Rails).

Give a shot to AppFuse. It will leverage either Struts 2 or Spring MVC for you, with a nice persistence layer.

There are many good 'stacks' that you could use, some of which have already been mentioned.
They all have their own strengths & weaknesses, and you really need to select a stack that best fits your requirements.
The Spring/Roo, AppFuse & Seam are all great, but they do come with a certain amount of... errm... bloat.
You may find that picking and mixing technologies actually provides you with a lighter weight and more performant solution, so long as the technologies you choose integrate relatively seamlessly.
If you're looking to package a full execution environment including the servlet engine as part of your application, Jetty is a good choice, and you can easily integrate it into a Maven build environment.
You may also want to investigate using HyperSQL for your database, which will allow you to prototype using an SQL compliant database without having to worry about installing a full database manager such as MySQL or PostgreSQL.

Related

Alternative usage of Spring Roo

is Spring Roo supposed to be only a tool for rapid development of web applications, thanks to all that scaffolding, source code generation and similar stuff, such as grails for groovy.
Or can it be utilized as a source code generator / osgi platform for building enterprise applications ? What I mean is, that there are source code generators, that generate only domain model and light DAO layer based on metadata definition when starting a new project and you have to stick to the objective - create a web app. But there are also generators, that generate the entire DAO and service layer - fantastic for iterative dev process of bigger apps - and you are not restricted otherwise, you are just using it to build you enterprise app step by step. With this you can really build a huge enterprise applications / platforms that will be maintainable for a very long time.
Also the OSGI model could be employed in a way, that you might develop a core portal application for instance, with a package of social office addons that you may plug in, etc. etc.
My point is, that Java development needs to be "Rubyfied". I mean Ruby on Rails environment where you have everything unified and standardized. A platform that could rule the java world some time :-)
Since Thomas and #jhericks trashed Spring Roo I'm going to say I actually like it mainly because its not a framework. Roo also (now) support multi-maven modules.
To answer your question: Spring Roo is not framework. It is code generation.
So yeah it is a code generation platform not only for web apps but any Java app.
There are couple of reasons why some people don't like Roo:
It uses AspectJ
It uses Spring
It does Code Generation
After building several applications with Spring Roo I can say its greatest value is its ORM generating abilities and its DataOnDemand test generation.
Other than that Spring Roo is really just Spring *.
Frameworks like Play and Ruby on Rails are just not really the "Java Way". That is most Java (Web) Apps I see are combination of libraries and not a giant framework.
As far as I experienced, Spring Roo is meant to be a RAD/bootstrapping tool for web applications. There are some major features missing and not on the roadmap that would make it truly useful in an enterprise application context. An example being multi-module Maven support.
This rather polemic article and its follow ups summarize quite well how I feel about Roo and similar projects like Seam Forge.
If you are looking for something RoR-like for Java check out the Play Framework that currently seems to gain momentum.

Starting a Java project - IDE, Framework, etc. -

I need support in order to speed up development process. I received a request to start developing a website with java technology. I usually develop in C# - ADO for Entities - ASP.NET MVC - MSSQL server - Visual Studio. Best of these choices were:
- C# Intellisense.
- ORM.
- Complete Security Management of Users, Roles.
- Separation of Concerns into MVC.
I was wondering if any can help me to determine best Java MVC Framework - DB - IDE based on these premises, Start a project with:
- Integrated security for users, roles
- MVC
To shed more light, to replicate same functionalities I can have each time I start a website using C# ASP.NET MVC 2 project. example http://nerddinnerbook.s3.amazonaws.com/Images/image020.png
First, let's discuss IDE, ORM, and security, and DB: In my opinion, the best Java IDE is IntelliJ IDEA. It's from the same folks who have developed Resharper for Visual Studio. It has the most powerful editor of all Java IDEs and has built-in support for many popular Java frameworks.
ORM: The most powerful ORM library in Java is Hibernate. Hibernate itself is an implementation of Java Persistence API (JPA) standard. EclipseLink is another implementation of JPA, but Hibernate is a better option IMO.
Security: Spring Security is probably the most powerful security (authentication and authorization) framework available in the Java world.
DB: If you are comfortable with SQL Server, then keep on using that. However don't use Microsoft's JDBC drivers. Instead use a driver from DataDirect: http://web.datadirect.com/products/jdbc/index.html. If you don't want to use SQL Server, MySQL is a great FOSS choice and Oracle, DB2, etc. are other options.
For the Web framework, there are several options:
Option 1: If you want a RAD style framework, choose Grails. Grails is similar to Ruby on Rails but uses JVM and a Java-like but dynamic language named Groovy. Grails' ORM API is called GORM, which is built on top of Hibernate, but is much easier to use. Grails also uses Spring Security for managing security.
Option 2: If you want an enterprise-grade framework, choose JBoss Seam + JavaServer Faces. JSF is a component-based MVC framework, and there are plenty of great JSF libraries available for use: RichFaces, OpenFaces, etc. Seam integrates JSF with EJB and together they make a great enterprise framework. However it has a steep learning curve.
Option 3: Use Spring + SpringMVC + JPA.
Option 4: Use Struts 2 .
Final remarks: If you are looking for an easy-to-learn MVC + ORM framework, use Struts 2 + JPA. If you are looking for a RAD and easy-to-use MVC + ORM framework, use Grails. If you are looking for a robust and enterprise-grade (but not-easy-to-learn) framework, use JBoss Seam.
Not only Spring MVC but the whole Spring eco system will get you up and running with the least surprises. You can also download the Spring Tool Suite (a preconfigured eclipse version tailored for Spring) to get an integrated development environmanet which knows about all spring stuff.
But Spring - Spring MVC - Hibernate - Spring Security and STS seems to cover your needs and will provide a sound basis to do the project without too many bad surprises. This leaves you to focus on the customer and the jump to Java.
Afterward you might consider different options in the Java space, as there are plenty of other frameworks available with their strong points. But in the short run it is better to limit the number of moving parts
The standard, most common framework/orm setup is spring/hibernate. Both of these tools have unfortunately been grown to ridiculous extremes over the years, so they may seem daunting in size, but a simple setup with each is much easier than it may seem from looking at all of the options on their respective sites.
Best suggestion would be to follow a step-by-step to get a basic spring/hibernate setup going and just expand off of that. At one point I had a prototype project like this I'd use to generate a "starter-set" to bootstrap projects.
BTW, I'd also suggest a simple ant build script. Some people may suggest maven, but it's enormous and very (imo overly) complex, and you're going to have enough new tools to wrap your head around to want to avoid having to learn another large command set.
Welcome to the Java world. The best thing (and in some cases also the worst thing) about the Java domain is that you can create your own stack based on your requirements. You're not necessarily bound to a single vendor as is commonly the case in the .NET domain.
Since it seems you're in a greenfield situation you can:
Adopt the webdevelopment stack of a large commercial vendor like Sun/Oracle (JSF/EJB3 + NetBeans/JDeveloper + Glassfish/Weblogic + MySQL/Oracle) or IBM
Adopt the webdevelopment stack of a smaller open source vendor like JBoss, SpringSource.
Take a look at JBoss Seam and SpringSource Grails and Roo (the latter two are based on the frequently mentioned Spring/Hibernate frameworks)
Mix and match your own stack based on the above and your requirements. Although this requires deep knowledge of the various technologies, frameworks, tools available.
You have lots of options as you can see. Now since your interested in a productivity focused stack - and I suspect an opensource one - and you have no legacy I recommend either Grails or Roo. In which Roo is probably the most accessible one since you don't have to learn Groovy. If you don't like the generation tooling I advice you the stick to the Spring stack and just adopt Spring/JPA/etc.
As for IDE, the only Java IDEs worth their salt IMHO are Eclipse and Netbeans, especially since both of them are free. Use Eclipse for extensibility and ease-of-use, use Netbeans if you need to rapidly develop a GUI.

Start with Java (JVM) ecosystem

I have came from another question to this one:
How can one start with Java (JVM) ecosystem? What are beginner, intermediate and advanced knowledge-bases (bags!)? To be honest Java ecosystem was always a bit confusing to me, so it would be very helpful to provide some "reference references" and "defacto tutorials" for learning (curve!) JVM.
Note: I want to use JVM with Scala (or Clojure) but not Java itself.
I am a C# developer (WPF, Windows Forms, ASP.NET, Web Services, ... like that).
The Java Tutorial is a good place to start.
Update: you have enough questions for about a dozen posts here ;-) Honestly, you should do some research yourself (Google is your friend), then ask more specific, targeted questions; that would yield better results. (e.g. I don't think anyone can answer your question regarding Swing or JavaFX without more specific details about what you are trying to achieve.) I try to give a few pointers below, about areas I know to some extent.
for servlets and other web frameworks, here is a bunch of tutorials.
Tomcat and Jetty are both application servers.
there are a lot of different web frameworks, because different people have differing preferences, ideas and style, so many have created their own framework. It can be confusing, but at least there is choice :-)
for persistence, apart from JDBC, ORM frameworks are another strong option. I use Hibernate and I can recommend it; in a bigger project it can make your life much easier. Ultimately it depends on your specific project and constraints; there is no single right choice.
AFAIK Java has no equivalent of LINQ.
See also this post for further recommendations.
Java based web applications need to run inside of a web container such as Jetty or Tomcat.
You build your app and deploy it to the container which hosts the application at runtime.
Pure/plain JDBC should only be used directly by simple applications or integration layers that do not have access to the class model.
Most applications that I have seen have used some kind of Object Relational Mapping framework which models the entities as classes at a higher level than plain old JDBC.
Popular O/R frameworks include:
hibernate
toplink
datanucleus
cayenne
For web based development, you could start with AppFuse, see the quickstart guide.
AppFuse is a templating system that generates the skeleton of an application for you.
Then look deeper into what has been generated, and see what frameworks they are using.
AppFuse lets you choose between different technology stacks, so you could compare.
I haven't seen AppFuse support for Guice or GWT.
Guice is a Dependency Injection framework, others that could be used instead are Spring or picocontainer.
Another investigative approach that you could try would be starting with AndroMDA, which is a model driven architecture framework - you start with a UML model and then generate or forward engineer a working application.
AndroMDA also lets you control the choice of the underlying framework implementations by configuring different cartridges, once again you should dig deeper to see what they are using in the generated application.
If you are looking for a basic introduction, then the Java Tutorials are nice. To do other things like Java Web Development, then your going to need to consult google for the respective technology since they vary so widely.
One book though that I highly recommend taking a look at is Java Concurrency in Practice
Yeah, it is almost impossible for new guys to get started. This is going to drive away a lot of developers, and Java is in danger of not having constant new bloods. The old farts would love that, it's great for career security, and that's why they are making Java more and more complicated.

Simple Java web application on Tomcat

If we only need to graphically authorize a user,
view a few tables representation (from database),
ability to change data in the database visually
what tools to use to write such a web application that will run on Tomcat?
What framework allows to do that in the most straightforward, easy-to-manage and elegant way?
I would look at Spring Roo as the framework for building your app. It will allow you quick construction of most of the features you are looking for in several minutes. (or so they claim)
There are so many elegant web frameworks available to choose from...
A JSF solution is a one suggested by the Java EE standard - if you select JSF you'll have to be more verbose in the code, but you'll have the assistance of tools such as the Visual JSF designer in NetBeans. Using JSF2 is a much better idea, IMO.
I personally recommend you to have a look at Wicket - it's a great Java web framework, centered around ideas such as ellegance, simplicity and usability.
There are many more great frameworks out there, but this is a start.
You can also try Grails. It's Java + Groovy scripting + Spring Framework + GORM + Spring Security. Less boiler plate.
Tools: Spring Source Tool Suite (Eclipse based IDE).

Taking the next step with java development?

I want to take the next step in java web development, I am hoping to get insight & feedback on: what my next steps should be and how best to take them.
While learning the basics of java web development, I put together a simple web app that performs simple accounting and financial calculations. The web app is on a single jvm, uses Tomcat, and has standard web functionality - i.e. login/logout, basic security, etc.
How can I make this web app more "enterprise ready" - distribute functionality of tiers over different servers/jvms, HA, balance-able, etc.
What do I need to know/learn? - i.e. EJB3 or Spring Framework (seems spring is better option), REST and/or SOAP, etc.
How would one recommend (books, websites, etc.) I learn the "requirements" (see preceding line)?
Thanks!
In my opinion, you should try different approaches for a same problem, so you could compare the pros and cons of different tools and frameworks.
For instance, try to build an application using EJB, and then the same application using Spring. Take the presentation layer of your code written with JSF and then rewrite it using Tapestry.
I think this will be very helpful to you, as you'll be able to make best decisions when choosing tools for your future developments.
A few things to consider, as food for thought:
How good is the error handling/logging of the application? For example, if the user tries to put in X in for a currency value, what does the application do?
What is configurable within the application from the user and what is in configuration files and what is in a database with regards to configuration? Do you have passwords encrypted within the application?
What patterns would used in building this application? Are there patterns you could see using now that you have a prototype?
Is this application ready to handle different currencies and languages?
What happens if someone leaves the screen for a few hours and tries to use a form?
What administrative functionality does the application have?
Does it handle the case where the user has JavaScript disabled?
What are the limitations of your application, IOW what can't it handle the way it is?
Have you considered trying to write a manual for the application?
EJB or Spring? gets asked quite a lot nowadays, here's a decent related question about them.
Have some real users using your application. You'll be amazed on how many "new" features/improvements can be performed in your app ( and the technologies you'll learn to satisfy those requirements ) by having real users using it.
I would suggest the following books/tutorials are a must for every Java developer:
Manning: Spring in Action - 2nd edition
Manning: Java Persistence with Hibernate
Core JavaServer Faces
Adobe Flex ( Adobe website video tutorials )
Effective Java
Apart from the standard technologies above you must be familiar with
Different testing frameworks , JUnit is a must
Build tools like ANT and Maven
Also you can build small projects by downloading trial versions of MyEclipse or Flex Builder.
I suggest that you create small java experiment projects for each new framework/library that you want to learn.
I've had good success using maven to help me quickly and consistently create java projects that I use to experiment with one technology at a time, such as Spring, Hibernate, etc. I use maven's site life cycle to record notes about what I learned and to document how to build and run each project. So, now I have 20 or so projects that I can use as baseline projects, one for each framework, to build upon.
Also, I prefer buying and reading books rather than relying on google and websites to learn new frameworks. Seems that I'm able to learn a lot faster this way.
I also suggest that you write web apps that you, yourself, would want to use. Or write a web app that solves a problem you've been having. I've found that I learn a lot more this way rather than simply copying and pasting from examples in a text book.
Hope that helps,
- Dave
Spring or Tapestry would be good options for new learnings. Does your app use any web services? If not work those in. Work with other application servers like JBoss and Weblogic and note their nuances with java. I'd also recommend learning Maven and work that into your build/deploy process.
Have fun,
Mike
You could vastly reduce the time taken to build your apps by learning some Test-Driven Development.
Try learning JUnit - it's becoming a core skill now, even in unagile shops.
If you're focussing on the web, try out Selenium - which has a Java controller to drive your tests from Java test cases.
After investing a bit of time in TDD will pay off no matter which frameworks or apps you work on. If you learn to test drive your code, you'll end up with smaller, cleaner code and less debugging.
You might look at AppFuse, which is a bundle of Java things together.
Or, you might take a look at a few more technologies to play with and add in:
Version Control - SVN
Tools - Ant or Maven
Framework - Spring, Seam, Struts
ORM - Hibernate or iBatis
Test Driven Development - JUnit, Emma
Continuous Integration - Hudson
I'd also read the Pragmatic Programmer and/or Code Complete.
Allow me to state that "enterprise"-ready does not necessarily imply scale-out solutions, many, many enterprise Java applications are running on larger systems requiring long-running-systems skill of their own.
I recommend mastering the Java language and runtime, understanding how bytecodes and loading traverse the JVM vs. focus on any given framework.
Speaking of frameworks and if you really have the time, try recreating an application framework yourself. Try and re-invent the wheel. IMO it is an excellent lesson in why frameworks themselves exist and teaches one to employ the features instead of always trying to work around them.
One more thing, never forget the database. I don't care what that looks like Oracle, MySQL or NoSQL, but become also an equal master at the data store.

Categories

Resources