Hi all,
Glenn, Craig, I copied you directly to make sure you
are aware of this thread. After this message, I'll
only direct my comments to taglibs-dev, not to you
directly.
As some of you know, I've started up an experimental
area of taglibs called "scopes", where I'd like to
refactor the "request", "application", "page" and
"session" tag libraries into a single combined
library. Glenn was also interested in this effort, so
I'm trying to encourage beginning work on a core set
of tags.
However, I am somewhat concerned about the overlap
between this effort and the tags that already exist in
Struts. Struts has tags for a lot of the things that
the "scopes" tag library will do: tests for equality,
assigning attributes, etc. So it raises the question,
should I press on with refactoring the Taglibs stuff,
or should I just use Struts?
There may be room for both implementations. One
concern I have with the Struts libraries is that the
tag usage is somewhat coupled to the Struts framework.
Using those tags outside the framework does not seem
to be a viable option, and therefore it may make sense
to have a similar implementation, based in the Taglibs
subproject, that is decoupled from Struts.
Also, "scopes" has some features that might be
difficult to reproduce inside of Struts. For example,
by default the scopes tags "parameter",
"initParameter", "attribute", "cookie" etc. tags
simply print their corresponding element to the
JspWriter, iff the element exists. The corresponding
Struts tags are quite different; they seem to assign
the element to a page Attribute, and I don't see a way
to _not_ do that. So it's a fairly different
approach. In general the Struts tags deal in
Attribute Objects, while most scopes tags convert
values to Strings, often in the JSP output.
If we were to refactor our taglibs in the scopes
package, we can take a lot of pointers from the Struts
approach. In particular the Struts logic tags have a
better design than the corresponding tags in Taglibs.
Taglibs has separate logic tags for everything (e.g.
"existsAttribute", "existsParameter",
"existsInitParameter"), while Struts has a single
"present" tag (although I think exists is a better
name) that takes the element to test on as an
attribute. Much more scalable.
Right now, I'm inclined to create a new tag library in
Taglibs that mimics portions of the Struts tags. I
think the duplication is justifiable. Ideally this
would not be necessary, but I think that the Struts
tags are just too, well, Struts-ish for developers who
are not working inside that framework. (This is not a
criticism, just an observation!) And of course, any
new approaches we develop in scopes (e.g. I don't see
any init parameter support in the Struts tags) can be
picked up by Struts too.
Of course, I'm interested in what Craig, Glenn, or
anyone else has to say on the subject. I don't want
anyone to think that I'm falling victim to "Not
Invented Here" syndrome. :) There may be other
viable options (e.g. providing alternative "decoupled"
patterns in the current Struts taglibs, reducing the
apparent barrier to Struts development, etc.) Just
let me know.
- Morgan
=====
Morgan Delagrange
Britannica.com
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/