Best Practices question re: Mapper files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Best Practices question re: Mapper files

Jon_E
Quick question: Is there any reason to have separate mapper.xml
files?

We started this project with many mapper.xml files, but now are
thinking it is better to have one larger, all-encompassing mapper file
instead of many small ones.

Any "Best Practice" insights?
Reply | Threaded
Open this post in threaded view
|

Re: Best Practices question re: Mapper files

Nathan Maves
Here are my thoughts off the cuff.

One giant mapper means one giant cache, not good.

Massive files are hard to read / maintain. 

Mapper method names have to be unique.  With only one you would have to prefix everything.  savePerson() vs. just a save().

Nathan

On Mon, Oct 25, 2010 at 9:45 PM, Jon_E <[hidden email]> wrote:
Quick question: Is there any reason to have separate mapper.xml
files?

We started this project with many mapper.xml files, but now are
thinking it is better to have one larger, all-encompassing mapper file
instead of many small ones.

Any "Best Practice" insights?

Reply | Threaded
Open this post in threaded view
|

Re: Best Practices question re: Mapper files

Larry Meadors
Yeah, I'd agree with Nathan - unless you're never going to have more
than a dozen or so mapped statements, I'd break them up too.

Curious - what's the advantage to having one big one instead of separate ones?

Larry