May 2019
Intermediate to advanced
356 pages
5h 18m
English
In a managed language such as C#, the process of creating a new object is simple: Just new it up and forget about it. Well, there’s stackalloc, but we’re talking about objects that need to persist. Now, with the proliferation of dependency injection, another question is whether creating objects manually is still acceptable, or if we should instead defer the creation of all key aspects of our infrastructure to specialized constructs such as factories (more on them in just a moment) or inversion of control containers?
Whichever option you choose, creation of objects can still be a chore, especially if the construction process is complicated or needs to abide by special rules. That’s where creational patterns ...