February 03, 2004
DBTags

Sigh. I was just about to mention how cool and useful the DBTags tag library is, when I find that it's deprecated, and that I should be using the JSTL instead. Bugger.

The JSTL is implemented by Jakarta.

Posted to Java by Simon Brunning at February 03, 2004 10:36 AM
Comments

Except you shouldn't be using the JSTL for SQL issuance either - don't let your pages be your model.

Posted by: Anonymous on February 3, 2004 12:46 PM

Hmm. Perhaps.

Certainly, for any entity which is represented in your model, you should do your persistence via a DAO [1].

But, we have some financial data that we want the user to be able to see. This data doesn't have any representation in the model, and I don't think it needs any. It doesn't *do* anything; we are just streaming it out of the DB for the user to look at. So, no business object (i.e. no model), and no DAO.

Or is this just a cop-out? ;-)

BTW, I had real trouble finding good JSTL docs, so for future reference:

http://www.onjava.com/pub/a/onjava/2002/08/14/jstl1.html
http://www.cs.ut.ee/~jaanus/klserv/tarkvara/unpacked/java/j2eetutorial14/doc/JSTL3.html
http://java.sun.com/developer/technicalArticles/javaserverpages/faster/
http://www.russellbeattie.com/notebook/1005811.html

[1] http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html

Posted by: Simon Brunning on February 3, 2004 01:35 PM

deffinately a cop-out. Seriously, why would you want this one single JSP to be different than everything else you've done (assuming that you aren't accessing your database from any of your other JSPs). It certainly wouldn't be too much extra work to *at least* create a servlet to get your data and stick it in the request.

Posted by: Anonymous - 2 on February 3, 2004 01:43 PM

Actually, the SQL crap in JSTL does a lot to invalidate the whole idea. It's obvious that whoever wrote them was a jakarta pratboy who happened to be on the JSTL JSR, and couldn't quite be bothered paying attention to best practices, even the ones Jakarta encourages.

Posted by: Anonymous on February 3, 2004 02:34 PM

For the sake of contrariness, let me point out that sometimes two-tier works just fine, especially for read-only data where the database is serving it up just like you need it anyway.

Why spend two days coding something that can be done in half a day? Will you really make up the day and a half in the long run? Even if you can you will make up the time later, do you have more pressing things to do now?

Posted by: Alan Green on February 5, 2004 07:56 AM

Exaclty what we were thinking, Alan. ;-)

Posted by: Simon Brunning on February 11, 2004 01:39 PM
Post a comment
Name:


Email Address:


URL:



Comments:


Remember info?