EJT said:
Why are people using EJBs as opposed to straight JDBC access to
databases from servlets and passing on to web pages? Why is the EJB
important and widely used today?
You CAN access a database directly from web service code. It will work
OK for very small projects, but quickly end up in a big mess in larger ones.
The reason for using something in between the database and the web code
is that it is often worthwhile to make an object-oriented model of the
things and events that you describe. If your web service is selling
fly-swatting equipment, then classes like Customer, Order and Price are
nice descriptions of the things you are working with.
It is usually worth the effort to separate MODEL,
PRESENTATION/MANIPULATION and PERSISTENCE: How things look on a web page
should have something to do with what is presented (and to whom maybe),
not how with it is stored in a database. If you do good abstraction and
separation, you will get better extensability, modifiability and
understandability than if mixing things that have do do with details of
the database, the details of what is modelled and the details of web
services.
Are there any books that will tie in all these J2/5EE related
technologies to help make good decisions on what to use and not to use?
You might want to find a good book on object oriented analysis and
design. As for which technologies to use, experience is probably the
only good guide (other peoples' experience, too!). Sometimes people
reading about some "silver bullet" technique (like when misunderstanding
design patterns) will want to stuff it into everything they see. The
result usually gets more complicated than it should be.
Experience is the word........
Søren