 |
The "Community" is Always Right?
Posted by johnm on November 28, 2003 at 10:42 AM | Comments (8)
In Sue Spielman's Practical JSTL article, she writes:
The JSTL includes a number of actions that provide a mechanism for interacting with databases. The previous sentence should, at a very minimum, send up a red flag in your architectural visions. One might ask, "Do I really want to be able to perform SQL actions such as queries, updates, and transactions from my JSP? Isn't that business logic that belongs in the model?" The answer is yes. Yes, yes, yes. To follow a Model-View-Controller (MVC) architecture, which is the predominant design pattern used in building web applications today, you definitely want to keep your model information in your business logic. This means that you don't want it in your JSPs. Why then are these actions even provided in the JSTL? Good question and one that I've discussed with various members of the JSR-53 expert group. The reason is the "C" or community in the Java Community Process (JCP). The community has asked for it, the community has gotten it.
I don't know about you but I just had the most horrifying flashback to the C++ Standardization process!
One of the tasks that I'm regularly brought in for is to help companies fix their systems which have gotten out of control. One of the fundamental problems that I find is the type of mushed together "solutions" that is so clearly exemplified by this JSTL silliness.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first)
-
Standards, bah!
This was always stupid. The JSTL used the jakarta taglibs after slight modificaton for a badly-thought-through expression language, and that included SQL tags despite the JSP "best pracices" nearly mandating that they NOT be used because they're highly inappropriate for the display layer. Way to thnk things through, JSR 52. "The community" in the form of Jakara wanted them, sort of, althogh I don't know that any of them USED them.
Posted by: epesh on November 28, 2003 at 11:39 AM
-
That's not the correct question.
The correct question to be asking is, "Should Sun accept every request from the JCP?" The answer to that question is an obvious No. Like the customer in your old saw, the community doesn't always fully understand what they're asking for. They tend to make kneejerk reactions, and basically screw themselves when asking for and getting solutions to different or nonexistant problems.
Sun controls Java and its APIs. They should be the ones who make the final decision as to what gets included in Java APIs and what does not. The JCP should give their input and constructive criticism, but they should never be the final arbiter.
For the people who asked for SQL functionality in JSTL, I have another old saw; "Be careful what you wish for, you just might get it."
Posted by: buckstl on November 28, 2003 at 12:25 PM
-
The answer is MVC... now what was the question?
Here, Here....
And I say let's get rid of System.out .println() cause people keep using it for logging which is a known performance bottleneck...
You just can't live with that sort of thinking...
Every time I've blogged about JSTL's SQL tags, some joker always tells you how evil they are and MVC is *the* answer to whatever question your asking.
For prototyping, these tags totally rock. I did a presentation at my local JUG on "Why I am jealous of PHP programmers", then proceded to whip up a SQL-based blog app using JSTL in 20 minutes. That's reason enough for having these tags! And another reason there are 10000 open source PHP webapp projects... and 50 Java ones... (well... you get the picture).
I read something from one of the JSTL spec writers saying basically, "Well, you *can* do evil things with these SQL tags if you get carried away... but it's not our job to impose our ideas on you and stop you doing bad stuff... we're all adults here."
+1 to that thinking.... Come on guys. Let's let people do what they want and develop great software... and let's skip the moral highground..
Glen
http://blogs.bitecode.com/glen/
Posted by: glen_a_smith on November 28, 2003 at 02:53 PM
-
So what does this mean?
Either that the predominant way of using JSP is as a quick hack to integrate some system with the web. The real work is then done with a "grown up" approach.
Or......
The majority of people involved in engineering such systems have little architectural understanding and only care about "cranking code".
Personally, I believe it's the second suggestion. For a long time, we've had a situation where the number of programmers heavily outweighs the number of engineers (yes, there is a difference) the result being that, for companies such as SUN to be successful, they must cater for these masses.....
Thus the decision you dislike so much was made....
I'd have thought the expert group should make an expert decision rather than create a specification which allows for the continued production of poor code/architecture. Unfortunately, that would make them unpopular and likely result in reduced revenues somewhere important to their bosses.
Maybe money *is* the root of all evil ;)
Posted by: dancres on November 29, 2003 at 01:58 AM
-
Cats and skins
Having lived in western europe for about a decade, I sort of understand how this community thing works. I have two problems with your statements. Comparing a JCP process to the formalization of C++ is not entirely right. My problem with the latter was is about how long it took for them to get to a standard. As for having sql tags in the presentation layer, I think its actually kinda cool that the J2EE stack allows you to use different designs to suit your problem or whim. After all there is nothing intrinsically wrong in solving a problem using 2 tier patterns if the end product works and the client is happy. Design patterns are not dogma, to me they are just different ways of skinning the same cat.
happy thoughts
Suhail
Posted by: suhail on November 29, 2003 at 08:52 AM
-
Another "it's for prototyping" argument
Here's another argument that the JSTL support for SQL tags is justified on the grounds of use in prototyping applications.
Posted by: johnm on November 30, 2003 at 09:01 AM
-
Another "it's for prototyping" argument
Sorry, I don't buy it.
First, we all know that it's not uncommon for "working" prototypes to end up as production code, with little or no modification.
Second, why couldn't they just continue to use Java scriptlets for their prototypes?
IMHO, the SQL tags should be deprecated ASAP.
Posted by: kdenehy on December 01, 2003 at 06:41 AM
-
You are right
Iīm very disappointed with de jstl. I canīt understando why the community has lost time designing, writing, documenting it.
Using jstl looks so bad like write all the code on the jsp.
Posted by: dionatan on December 01, 2003 at 07:09 AM
|