Wesley,
From personal experience, I know where you are coming from. I started
out knowing even less about this than you. I will say though that it
was fairly easy and quick to pick up both Struts and iBatis. The design
standards were handed down from a project leader long gone before we
even rolled out even the first basic modules, so I hope you have a
little more flexibility to set your own. We use plain old java objects
for our transfer objects between all 3 parts of the MVC for our
application. JSP for our view, Struts for our controller and iBatis for
our model. Our current design could probably benefit from a rethink,
but we have not rolled out all of version 1 yet.
We don't do much more beyond standard getters/setters in the POJOs.
Some validation is done in the Struts validate and some in the actions
before everything is turned over to our module managers which turn
things over to the appropriate DAO and sql maps. Like I said, this is
what I was handed and I don't know if we went overboard in abstraction
or not. Just my 2 cents. Enjoy the ride.
Al
Wesley Wannemacher wrote:
Hello,
I'm exercising the 'Casual Friday' rule here to ask some general
questions. I apologize in advance if I break any list etiquette, but I
subscribed on Monday and have been waiting patiently for Friday so that
I can get these questions off my chest. Thanks!
I've been working on Java/JSP for a few years now and I recently decided
to try out struts (better late than never). In the past, I would
typically write a JDBC wrapper library to help me get to the database,
then write all of my code with little abstraction from SQL code. Being a
database guy as well, this made sense to me, and I could do quick easy
things like a 'QueryToTables' tag that would allow me to paste SQL code
right into a JSP and have the results of that query pasted nicely into
the output. For updates, I would build the form I needed (using my own
custom tags for input fields) and call into my JDBC wrapper to hit
stored procedures.
I picked up a copy of 'Struts Design and Programming: A Tutorial' and I
am learning the details of the libraries, but I've never written a
JavaBean (EJB or regular Bean). It seems that EJB isn't necessary, but
that regular JavaBeans are used heavily elsewhere. So, I figured I would
start trying to figure out smart JavaBean Design (I don't really want to
have to refactor/redesign all of my core classes later when I'm more
experienced). The problem I have though is that all the books I have
laying around seem only to refer to plain ol' JavaBeans as GUI
components. If I understand correctly, to make an object a JB, I really
only have to have getters/setters for the properties I want to expose,
but can I have other methods that do other stuff? What suggestions would
you give someone who has never written a JavaBean before that is going
to begin working from the ground up on a new project? I figured I would
use iBATIS for database persistence, so I've been reading about that as
well. I guess I'm just a bit paranoid about writing the 'middle layer'
between struts and the SQL code/server, so any advice on gotchas and/or
suggestions for struts-friendly 'middle layer' design would be much
appreciated.
-Wes
--
Wes Wannemacher
Double A Trailer Sales, Inc.
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]