You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Folashade Adeyosoye <sh...@gmail.com> on 2005/07/03 06:45:59 UTC

Advantage of Map over Bean as a parameterObject?

What are they?


Re: Advantage of Map over Bean as a parameterObject?

Posted by Larry Meadors <la...@gmail.com>.
On 7/3/05, netsql <ne...@roomity.com> wrote:
> 
> 
> 2nd one:
> 2)You don't have to change or maintain it.
> As project evolves and front end and back end evolve... there is no
> maitanance or CRUFT or duplication.

CRUFT -  (n) The results of shoddy construction.

Hmm, every application I have ever had to work on that used Maps for
domain objects exhibited plenty of CRUFT. ;-)

Larry

Re: Advantage of Map over Bean as a parameterObject?

Posted by Larry Meadors <la...@gmail.com>.
Yes, there are many examples using Maps. You have convinced me to try
not to do another one with a Map; Beans are truly the better way to
go.

Larry

On 7/3/05, Folashade Adeyosoye <sh...@gmail.com> wrote:
>  
>  
> 
> Thanks the reason I asked was because all the examples I have seen online
> seems to be using the maps. 
>

RE: Advantage of Map over Bean as a parameterObject?

Posted by Folashade Adeyosoye <sh...@gmail.com>.
Thanks the reason I asked was because all the examples I have seen online
seems to be using the maps.

 

  _____  

From: Clinton Begin [mailto:clinton.begin@gmail.com] 
Sent: Sunday, July 03, 2005 11:08 AM
To: user-java@ibatis.apache.org
Subject: Re: Advantage of Map over Bean as a parameterObject?

 


>> You don't have to change or maintain it.

That's an exaggeration.  All software requires maintenance, perhaps Maps
require less...but the end result is less as well.

A bicycle requires less maintenance than a sports car too....but I know what
I'm driving home from work.  ;-)

Cheers,
Clinton






On 7/3/05, netsql <ne...@roomity.com> wrote:


>
> 1) You don't have to write a JavaBean class.
>
>

;-)

2nd one:
2)You don't have to change or maintain it.
As project evolves and front end and back end evolve... there is no 
maitanance or CRUFT or duplication.

I used to do beans for many years. Then I started w/ Groovy, CoR, C#,
Flash, etc... They all are Map and Collections based. Even when I make a
JTable it needs a collection. I my case, I have no needs for a bean. All 
my API only takes Map args and sometimes return Lists. (A silly little
varargs). After all how often do you get a class cast exception!

.V

 


Re: Advantage of Map over Bean as a parameterObject?

Posted by Clinton Begin <cl...@gmail.com>.
>> You don't have to change or maintain it.

That's an exaggeration. All software requires maintenance, perhaps Maps 
require less...but the end result is less as well.

A bicycle requires less maintenance than a sports car too....but I know what 
I'm driving home from work. ;-)

Cheers,
Clinton





On 7/3/05, netsql <ne...@roomity.com> wrote:
> 
> 
> >
> > 1) You don't have to write a JavaBean class.
> >
> >
> 
> ;-)
> 
> 2nd one:
> 2)You don't have to change or maintain it.
> As project evolves and front end and back end evolve... there is no
> maitanance or CRUFT or duplication.
> 
> I used to do beans for many years. Then I started w/ Groovy, CoR, C#,
> Flash, etc... They all are Map and Collections based. Even when I make a
> JTable it needs a collection. I my case, I have no needs for a bean. All
> my API only takes Map args and sometimes return Lists. (A silly little
> varargs). After all how often do you get a class cast exception!
> 
> .V
> 
>

Re: Advantage of Map over Bean as a parameterObject?

Posted by netsql <ne...@roomity.com>.
> 
> 1) You don't have to write a JavaBean class.
> 
> 

;-)

2nd one:
2)You don't have to change or maintain it.
As project evolves and front end and back end evolve... there is no 
maitanance or CRUFT or duplication.

I used to do beans for many years. Then I started w/ Groovy, CoR, C#, 
Flash, etc... They all are Map and Collections based. Even when I make a 
JTable it needs a collection. I my case, I have no needs for a bean. All 
my API only takes Map args and sometimes return Lists. (A silly little 
varargs). After all how often do you get a class cast exception!

.V


Re: Advantage of Map over Bean as a parameterObject?

Posted by Clinton Begin <cl...@gmail.com>.
There's only one advantage:

1) You don't have to write a JavaBean class.

But JavaBeans have many advantages over Maps:

1) Performance. Beans are fast, Maps are slow.

2) Type safety. Beans are typesafe, Maps are ambiguous.

3) Predictability. Beans are predictable, Maps are like a box of chocolates, 
you never know what you're going to get.

4) Compatibility. Beans are compatible with many frameworks and tools, Maps 
may or may not be.

5) Safety. Beans can be written to encapsulate the data and behaviors that 
you want.

6) ....

Could go all day. Use beans. Maps are supported for convenience only.

Clinton



On 7/2/05, Folashade Adeyosoye <sh...@gmail.com> wrote:
> 
>  What are they?
>