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

netsql wrote:
Larry Meadors wrote:

Hmm, of course, who needs things like refactoring, and compile time
name and type checking? That's why you have users, eh? They'll find
the bugs eventually. ;-)

Larry



Get/Set, Get/Set.... Half the time I have no idea what the db date will come back as. Look, I think some of you will belive me that I know well the benefits of beans and that I have done at least several deployed projects w/ beans. It was a best aproach for the time. Now I have an alternative.

It does not change jUnit testing in anyway, I fire a populate/CRUDs and assert. So using maps does not make me insane. :-P

Compile time type checking? Like in dynamic langs?
Most of the sucessfull p-langs are dynamic. In flash, array and map are same class even. I envy their sucess. For example, the home page of Spring is done in Plone.

So I just duplicate their aproach to get their Cost of Operation.

.V







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






--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com


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

Reply via email to