|
From: Seth L. <se...@eh...> - 2004-04-14 18:47:59
|
Baum, Karl wrote:
> There is one other slight issue I noticed with mapped properties. In
> addition to supporting get/set methods that work with a Map object,
> Struts suports methods that take key value pairs. For example:
>
> public void setValue(String key, String value);
>
> public String getValue(String key);
>
> This feature allows the developer to abstract the underlying
> implementation. It also guards against external code overwriting your
> Map. Spring does not support this because it only uses java bean
> introspection to find all properties in a bean. These Map methods are
> not properties to Java.
Just MHO, but I never liked that above Struts idiom. It's easy to think
about objects as object graphs and beans. To me, the above breaks that
simple object graph notation. If what I'm trying to say is "object foo
has a Map called bar" then the above way doesn't say that very clearly.
Here's where I think Spring does a better job than Struts in mapping
properties and objects together. Also, I'm -1 on adding then '('
support. While I am sympathetic (I, too, am migrating Struts apps to
Spring MVC) I'd like to take steps forward, not just simply port. I
think the more standard '[' makes more sense.
Seth
|