The Lounge is rated PG. If you're about to post something you wouldn't want your
kid sister to read then don't post it. No flame wars, no abusive conduct, no programming
questions and please don't post ads.
That would be my focus also, as we are using Unity here.
So far, the author is covering the aspects of DI that I've noticed and questioned but not seen touched upon in such a clear way in other places. There are some things you get from Unity for example (like object lifetime that you can just take for granted).
Also, his simple first explanation of the decorator pattern was very cool.
I like books that give me a fresh angle like this.
(like object lifetime that you can just take for granted).
Yes, but I like to specify the ContainerControlledLifetimeManager whenever it is not too restrictive. With this lifetime manager, it is just easier to implement the IDisposable interface in your classes. As far as I know it is the only option you have in Unity to guarantee the Dispose() method will fire when you dispose of the container.
Interestingly, the Asp.Net Core DI container is slightly faster than Munq, and while not a full featured as some, is sufficient for at least 80% of what you want to do. If it isn't, then you are probably over architecting your app. Dependency Injection in ASP.NET Core | Microsoft Docs[^]
"Time flies like an arrow. Fruit flies like a banana."
Thanks for posting this. I have bookmarked your response for further study. My application is strictly a desktop app using Prism.Unity. Munq definitely seems faster than Unity, but I wonder how much difference it will make in my case?
May the 5th (not original)
Most people don’t know that back in 1912, Hellmann’s mayonnaise was manufactured in England. In fact, the Titanic was carrying 12,000 jars of the condiment scheduled for delivery in Vera Cruz, Mexico, which was to be the next port of call for the great ship after its stop in New York.
This would have been the largest single shipment of mayonnaise ever delivered to Mexico. But as we know, the great ship did not make it to New York. The ship hit an iceberg and sank, and the cargo was forever lost.
The people of Mexico, who were crazy about mayonnaise, and were eagerly awaiting its delivery, were disconsolate at the loss. Their anguish was so great, that they declared a National Day of Mourning, which they still observe to this day.
The National Day of Mourning occurs each year on May 5th and is known, of course, as Sinko de Mayo.
Arguing with a woman is like reading the Software License Agreement. In the end, you ignore everything and click "I agree".
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun