• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Java EE 5/6 web application architecture - aaarrgghhh!

 
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've decided to develop a web application as a learning exercise although there is a
serious underlying purpose behind it.

I'm new to Java EE but I've been a software engineer for a long long time and reckon
I should be able to pick stuff up reasonably quickly.

My initial thoughts about the application are that there are people using a browser, IE,
Firefox, Chrome whatever, and access my application server and type stuff in which
gets stored in a database, displayed back to them, that kind of thing. Nothing amazing,
no time travel, no quantum physics or anything like that. I reckon I'd like the user
interface to look pretty good, not like a Hello World! Servlet but not exactly a rich
internet application either. Something of the quality of the new Yahoo! MAIL would
be good for me if this is within my grasp.

Without knowing exactly how this is going to be built I shouldn't be thinking about
timescales, but in truth in my mind's eye I'd like to have a phase 1 production ready
in around 6-9 months time.

I somehow landed upon Glassfish and have been using this (v2.1) for playing about
with and it seems pretty good, hey it's free and there are plenty of cloud providers
supporting it, so I'd like to use this as my application server. I've been using NetBeans
(6.7.1) as my IDE and it seems pretty robust although I've not even scratched the
surface of the overall functionality.

It seemed like JSP/JSF as the presentation technlogies seemed like the default option,
EJB 3.0 as the business tier, JPA as the persistence tier and a MySQL database. I'm
pretty happy with the combination of EJB/JPA/MySQL, I'm sure this will all do what I
want and it's all tried and tested.

It's the view technology that I'm not sure about. Where I'm coming from is that I
don't want to do is read through a thousand pages of documentation (which is quite
feasible in this domain) before finding out that I've backed the wrong horse and
having to start all over.

I'd really like to be using a visual layout tool for page design as I'm an engineer not
a graphic artist, I don't write code in assembler (any more) so why count pixels
to get stuff positioned where you want it. I came across the Visual Web functionality
in NetBeans but shortly after the encounter I find that the project is dead or dying
although I'm not sure why or what will replace it. Then there's facelets which replaces
JSP? but is it suitable for a production application now or in six months time? And
then JavaFX, does it complement, replace, interoperate with or just steamroller
JSP/JSF? And then the component libraries, ICEFaces, Jboss, MyFaces, RichFaces,
such choices!

I'm trying to find out what I need to be learning about, but I keep getting the nagging
feeling that anything I'm investing my time in evaluating is going to end up being
abandoned, superceded or both, and all the time spent learning will be wasted.

Maybe I'm getting too old for this game, I'm 44 years old now, perhaps I should be
thinking about taking up painting landscapes or gardening or something. After two
months looking at EE I've not even managed to nail down what I need to be working
on, is this just me?

If anyone would care to describe an approach they've taken I'd be very interested to
read about how you solved any similar sounding problem.

Thanks!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JSP is a reasonable default choice for your presentation layer. You might want to look into the JSTL tag library once you're familiar with JSP; it simplifies a number of common tasks, making your pages easier and quicker to develop.

If, one day, you decide that you need more than JSP/JSTL you'll find that many other frameworks build on top of it, so your investment isn't lost.

Since you're just starting out, I'd advise to stay away from JSF and its myriad side projects (*face*). Although Sun pushes it, enough people do not hold it in high regard to make it a not-so-safe choice. And what's more , it builds on top of JSP anyway, so you should get a firm grounding in that first.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I reckon I'd like the user interface to look pretty good, not like a Hello World! Servlet but not exactly a rich internet application either. Something of the quality of the new Yahoo! MAIL would be good for me if this is within my grasp.


Um... that's a pretty complex UI, full of JavaScript, Ajax, and so on. If you're still working on server-side technologies you might want to hold off on entering an entirely different world of hurt.

Things like JSF and Seam require a pretty firm grip on the basics: here there be dragons. Have a little patience.

I'd suggest taking things one step at a time. There will *inevitably* be mis-steps, back-steps, and the occasional two-step. Bear in mind that things like the Yahoo Mail interface took lots of developers lots of time to develop, and that doesn't even include the back end.

I don't really see how age enters in to the picture.
 
Brendan Healey
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks for the comments regarding JSP/JSTL, this was where I started off and I'll look
at it in more detail. Regarding Yahoo! MAIL, I'm not delusional and appreciate that this
is the work of a serious project team or teams, I'm not trying to do anything as complex
but do I want an interface that although much simpler looks as good?, well frankly yes I
do. Whether this is attainable as a phase 1 or a phase 3 delivery remains to be seen, but
I'm not going to be coming up with something that looks like it was built in the 1990s!
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The advice here is good. Avoid JSF and EJB like the plague until you find that you need them -- which for me is never.

If you want nice looking and acting interfaces, you'll also need to start wrapping your mind around the client-side triumverate of HTML, CSS and JavaScript.

There are a couple of articles in the JavaRanch journal that you might find helpful to start off on the right foot:

The Secret Life of JSPs

The Front Man
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brenden: JSPs and best practices have evolved a lot since their inception. That means there's a lot of old documentation and advice based on old practices. For me, JSPs, using EL and JSTL, work out just fine. Furthermore, in my opinion, an MVC framework is essential -- either Struts or Spring MVC. (Not sure about other frameworks, and I haven't kept up with Struts since Struts 2.) Using MVC insulates you from having to hassle with web.xml URL mappings and servlets, plus there are many other benefits, depending on your needs. In terms of tags, as I mentioned, I use JSTL, EL, and <jsp:include .../> -- those cover 98% of what I need. The point being, there's really a small set of things you use, so the learning curve isn't too bad, and implementations don't need to be complex. On the other hand, some people I respect choose other paths, such as Ruby on Rails or PHP. JSPs have always met my needs, so even though I've dabbled with those, I haven't seen a need to switch.
 
Ranch Hand
Posts: 691
Mac
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Max Rahder wrote: Furthermore, in my opinion, an MVC framework is essential -- either Struts or Spring MVC. (Not sure about other frameworks, and I haven't kept up with Struts since Struts 2.) Using MVC insulates you from having to hassle with web.xml URL mappings and servlets, plus there are many other benefits, depending on your needs.



Totally contradicting to Bear's comment:

Then he needs to learn whether to go for frontcontroller pattern or view-Intercepters, filters etc. etc.
Whether to use hibernate or EJB3!!!

And offcourse why Struts2 and Spring MVC - Seam is much more mature(Though heavy weight) and newly coming web beans sepcification derived from it.

I would suggest go ahead with JSP, Servlet and DAOs. You are still following simple form of MVC.
 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is one pretty new technology born exclusively from frustration with JSP. It is not something for everybody, be prepared to accept really fresh approach. If you show some patience at the moment of initial shock you will definitely not regret later
Here is the link: http://www.hybridserverpages.com/

[ UD: In the interest of full disclosure, let it be known that Aleksey's email address indicates that he is involved with hybridserverpages.com. ]
 
Brendan Healey
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks to you all, your opinions are very valuable. I shall take a step back and
take a good hard look at JSP/JSTL and try to decide on an MVC framework. It's
a good job that I never thought it was going to be easy.

I have to say that I'm firmly of the opinion that the pace of development in the
EE space needs calming down!
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have to say that I'm firmly of the opinion that the pace of development in the
EE space needs calming down!


While I agree with the sentiment, I've never seen that as a problem. After all, one uses certain technologies or libraries because they help solve a problem, and fit into the architecture. If a new JEE version contains new APIs, so what? One needn't use them. Same for frameworks (web or others): sure, more of them are appearing all the time, and it would be a big job to evaluate them all, but unless there's an itch in the application code that really needs to be scratched -at which point one would look around to see which of the frameworks that address this itch are being used and liked-, the plethora of options shouldn't get in the way.
 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I vote for EJB! You can use it but would need a lot of studying and research to master!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic