Frank W. Zammetti wrote:

It's ironic to me that I had this same discussion with someone at work just last week :)

I *was* in the "Maps are better" camp until a few months back when I changed my mind, and it comes down to one thing:

Self-documenting code is better.

A bean is self-documenting in that you can immediately tell what its attributes are and what types they are. I'm not even talking about generating javadoc from the source either, but that's certainly a very nice by-product.

Developers HATE documenting. I'm sure there are exceptions, but by and large that is a very fair generalization in my experience. If you trust a developer to document what is going into a Map, your asking for trouble, generally-speaking.

I don't personally use an IDE, but I think Rick's point about auto-completion and the like is important because many people *DO* use IDEs, and if you give them a bean they can be more effective faster than if you give them a map with some documentation on what they may find in it at various points in time, and that's even assuming the documentation is accurate :)

Especially in a team environment, I would always go with a real bean now over a Map-based design, even though I agree with may of the points made on why Maps are good. But in this world of trade-offs, I think you gain more by using a bean than you do by using a Map, again, generally-speaking.

Frank

I personally use map in early stages of development when the bean properties (and their respective form properties) change very often. This gives me flexibility to change easy and fast the jsp-s and to show them to the end user (because most of the time they don't understand abstract models, but they understand screens and forms). When we are ready with such "prototyping" I reafactor the code and start to use "normal" form beans and eventually the validator.

The other trade-off with mapped forms is that the errors you can catch only runtime, which is not true if you use form beans.(excluding the errors in jsp, unless you can pre-compile them before the deployment)

Btw, I'm evangelist about self-documenting code :-) .

Regards
Borislav


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to