Sure I'll join...  ;-)

In my opinion, using a Map is one step below using a class with public
fields (a.k.a. C-style struct).  Both lose the advantage of
encapsulation.  However, a Map is worse still in that you also lose
type definition (which fields are on a domain object) and type safety
(which type is each field).

I don't write getters and setters either....I hit alt-insert-enter. 
Less time spent than debugging a loosely coupled Map domain model.

Cheers,  ;-)
Clinton


On Sat, 05 Feb 2005 16:13:00 -0600, Vic Cekvenich <[EMAIL PROTECTED]> wrote:
> Huy wrote:
> 
> >
> >
> > I see what you mean but I need my domain objects because my apps are
> > used by different clients with different databases with different
> > schemas (similar but not exact; it's a legacy thing). The domain
> > objects help me to keep all my other layers independent of the
> > database schema. I know I can do "select column as blah" but I really
> > don't like doing this in all my selects (it could get error prone).
> >
> > I really do believe that resultmaps is required for my situation. I
> > just think it's a good idea to make it just that little bit more
> > flexible.
> >
> > . However, unless you can help me overcome the problem above, I can't
> > see how I can use it effectively.
> >
> 
> So...  your domain object can be a Map, just like a bean, read
> http://groovy.codehaus.org/Quick+Start
> Old:
> class person { // at domain level, we do not know if this is one or 2
> tables, it's a logical enity; nothing phsycial
> get/setName{}
> get/setAddress{}
> }
> 
> New:
> Map person ....
> 
> person.get("name")
> person.get("address")
> 
> SAME THING, you'll get used to it to have a collections for a domain.
> 
> Anytime you have a hard coded bean.. use a losley typed map. If you have
> to make a custom map... no big deal**. I learned to let go using
> actionscript, it was not easy.
> The 2nd thing that helped me let go of beans is CoR (commons chains)...
> it allways uses Map as an argument.
> 
> **side benefit... if you need to add, remove coluns on view or sql...
> less code.
> 
> .V
> (join us CB, the water is warm ;-) )
> --
> Forums, Boards, Blogs and News in RiA <http://www.boardVU.com>
>

Reply via email to