Question

like this https://github.com/seesharper/LightInject/blob/master/LightInject/LightInject.cs

It's hard to reading, is there any deep meaning?

Was it helpful?

Solution

Being the author of LightInject, I feel I should comment on this :)

Say that you are a library developer and want to be able to utilize an IoC framework internally without taking a dependency on a third party assembly. By using the source version of LightInject, this can be done quite easily and you can still ship your library as a single assembly.

Many framework developers choose not to use an IoC framework just because they don't want that extra dependency.

The alternative to this would be to use tools like ILMerge that is capable of merging two or more assemblies into a single assembly.

This is a far more advanced option and would also require an extra build step that performs the merging.

Note that LightInject comes in two flavors, the source version where all the types are internal and the binary version that acts just like any other third party dependency.

Taking on a dependency might not seem so bad at first, but if you are a framework developer, you could easily run into issues if the consumer of your framework uses another version of the same dependency

Best regards

Bernhard Richter

OTHER TIPS

It makes integration as source in another project easier: simply add one file to your project and forget about it. This is a supported installation scenario according to the official website of LightInject, there's even a NuGet package for it.

If you want to read it, I'd strongly suggest opening it in Visual Studio and using the code navigation features to find what you want, e.g. VS 2013's Solution Explorer can display the classes inside of a file as children of that file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top