Singleton model mapper

616 views
Skip to first unread message

syed rizwan

unread,
Apr 23, 2013, 3:24:19 AM4/23/13
to model...@googlegroups.com
Hi Jonathan,

It is good that mapping can be reused by having model mapper singleton. Is it thread safe?

How can I create a model mapper instance with existing type maps?

Thanks

--
Syed Rizwan

Jonathan Halterman

unread,
Apr 23, 2013, 12:08:47 PM4/23/13
to model...@googlegroups.com
Hi Syed,

On Tuesday, April 23, 2013 12:24:19 AM UTC-7, syed rizwan wrote:
Hi Jonathan,

It is good that mapping can be reused by having model mapper singleton. Is it thread safe?

Definitely reuse ModelMapper instances when you can. It's considered a best practice. ModelMapper is threadsafe.
 

How can I create a model mapper instance with existing type maps?

There's no way to do this currently. Do you have a use case where this would be helpful?

- jonathan
 

Thanks

--
Syed Rizwan

syed rizwan

unread,
Apr 24, 2013, 1:20:19 AM4/24/13
to model...@googlegroups.com
Hi Jonathan,

Thanks for the confirmation.

I was checking for having an alternative approach for performance and thread safety and that triggered my second question. However this might not be needed now as the first answer would suffice.

Thanks
--
Syed Rizwan
Reply all
Reply to author
Forward
0 new messages