commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: [DynaBean] a couple of other existing projects...
Date Thu, 03 Jan 2002 11:12:48 GMT
----- Original Message -----
From: "Paulo Gaspar" <>
> Extending the DynaClass and using Converters would do most of what you
> describe here.

I'm arguing for not putting converters/validators in a DynaClass or a
descendant but in a seperate 'controller'.

> The DynaClass (metadata) part should be the only one having to be
> extended to avoid a complex DynaBean class structure. Then you can have
> helper classes that use the extended metadata information to the tasks
> you talk about (formatting, validation, etc.).
> Trying to include these and other concerns in some DynaBean descendent(s)
> will produce a monster hard to manage class(es). Separating such concerns
> in separated helper classes with the help of extended metadata will have
> the advantages of:
>  - Simpler code;
>  - Easier learning of its use (the user does not have to learn what he is
>    not using).

I agree DynaBean isn't the right place for this, but I don't think DynaClass
is either - I think a seperate 'controller' is better. Think MVC and that
the DynaBean/Class as the 'model' and a controller mediates between a view
(HTTP request/form or Swing controls).

Since converters would have all kinds of optional contexts associated with
them like Locale, Timezone and other stuff like maybe the user id or
HttpSession, keeping such a controller seperate to the DynaClass, like the
BeanController idea I suggested, would seem cleaner.

e.g. a single 'customer' DynaBean instance could have a single DynaClass
instance (which could be shared by other customer DynaBeans) but could be
viewed using various different locales & timezones & users. So having a
seperate 'controller' object for each context would seem to make sense,
which just has-a reference to the DynaBean.

> Craig, I and others discussed several ideas that have a lot to do with
> this stuff during the last couple of weeks.

Just out of interest was this on a struts list or just privately?


Do You Yahoo!?
Get your free address at

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message