Breaking changes in Visual C++ 2015
Kagamin via Digitalmars-d
digitalmars-d at puremagic.com
Wed May 13 01:26:34 PDT 2015
On Monday, 11 May 2015 at 09:31:34 UTC, Chris wrote:
> Hm, I was thinking of something like that, however, it gets
> more and more complicated if you have e.g. a class that uses
> another class etc.
>
> class Data // A singleton
> {
> // stores paths to resources etc.
> }
>
> class Loader
> {
> this()
> this.data = Data.getInstance();
> // Loads files and caches them in memory
> }
>
> class Process
> {
> // Uses cached data
> }
>
> It ain't easy to unit test Process, but even Loader and Data
> can be tricky to unit test, because all of them depend on input
> from the outside.
That's the reason for IoC design; it's similar to ranges in a
sense that you feed the range with data instead of letting it
figure out where to get that data on its own.
More information about the Digitalmars-d
mailing list