Making sense of Java Enterprise Frameworks
I, like most started off using just jsp and straight jdbc, but eventually tried Velocity to handle my views. Then, ended up ditching Velocity and implementing my own rudimentary methods for organizing communication with the client browser and my own business logic. Once I got wind of Hibernate I was thrilled. I recall I used to feel guilty every time I embedded more and more sql right into my logic code. One schema change and I was forced to scour all my *.java searching for sql statements :)
Then, finally I came across something horrific: The Spring Framework. Not horrific in the sense of it being a bad tool, but horrific in the sense that it revealed to me how little I understood proper web application design patterns.
Spring (as far as I can tell) is pretty much a jack-of-all-trades framework. It is supposed to manage your business code, has a MVC, manage hibernate sessions/interaction for you, handle transactions, and everything else. But most importantly, the framework forces (or through its API "encourages") you to follow a proper design pattern, enabling you to have maintainable, readable, manageable code.
I was immediately shocked by the number of acronyms and terms thrown at me: DAO, POJO, AOP,business logic, collaborators, etc... clearly I was in over my head. Nonetheless I attempted to create a simple web-app using the spring framework that allowed a form to submit data to a database. It took me 2 hours :) (granted I was writing everything from scratch.. no Xdoclet to make my life easier.
Anyhow, my main concern at this point is proper design pattern, and through all the struggle, this was the most I could really understand out of my battle:
User Browser -> FormController (shows views/jsp, makes use of FormValidator) -> ServiceObject -> DAO_Object (makes use of hibernate..) -> Regular Java Objects persisted by hibernate.
I'm still not even sure what my business logic is supposed to be. And where does my "etc code" go (such as code that reads in a csv file and generates a pdf, or other funky stuff that might happen in a webapp).</p>
Believe me I've read this,this, and this, and finally this, and I am still not clear on all my concepts. I find either they are too "beginner", and thus lack a description of the big picture, or are too advanced and loaded with concepts I haven't been explained.
What design pattern(s) do you use? Is there a middle-ground tutorial out there that might help people like myself?
I just want my web apps to follow a pattern that makes sense, is extendible, is manageable, and doesn't reinvent the wheel.