0

I am sitting reading about Glass.Mapper. It looks nice, and is what I want to use for a project at work. We actually use Glass.Mapper for some projects, but we are in the loop for streamline our toolset, and have decided to use Simple Injector for IoC. Here: http://www.glass.lu/Mapper/Sc/Tutorials/Tutorial1 I can read that there exsists two projects for Glass.Mapper when using it with Sitecore:

  1. Glass.Mapper.Sc
  2. Glass.Mapper.Sc.CastleWindsor

In the tutorials on the Glass.Mapper homepage, they only show howto use Glass.Mapper.Sc.CastleWindsor, and they dont show how to implement a third IoC container that Glass.Mapper can use. But I think it is possible, when they expose the Glass.Mapper.Sc package, but I have not been able to find any explanation on what to do, when I want to implement my own, so I am starting to think that there is to much work in doing this yourself? Should I just depend upon Glass.Mapper.Sc.CastleWindsor, and just do this http://www.glass.lu/Blog/MixingInIoc, so I can use Simple Injector also?

Or have I missed something, and is this infact the easiest to do in the world?

mslot
  • 4,959
  • 9
  • 44
  • 76
  • Or have I just completly misunderstood the http://www.glass.lu/Blog/MixingInIoc, and is this infact completly replacing Windsor? – mslot Apr 16 '15 at 07:48

1 Answers1

5

As a matter of fact, just yesterday I sent a pull request to the Glass project to use Simple Injector as DI library. You can view that pull request here: https://github.com/mikeedwards83/Glass.Mapper/pull/123.

Do note though that the pull request was a theoretical exercise, because I was not able to set up a Sitecore environment and test this. But your feedback to the team is probably very welcome. Please send your comments here.

Do note though that since Glass is a 'simple' reusable library, IMO you should be able to let it use its own DI library and use Simple Injector for your own project. There might be a few cases where you need to register a service both in Glass and in Simple Injector, but in general this should not be a problem.

Steven
  • 166,672
  • 24
  • 332
  • 435