O'Reilly logo

Dependency Injection in .NET by Mark Seemann

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Object Lifetime

Menu

  • Managing DEPENDENCY LIFETIME
  • Disposable DEPENDENCIES
  • SINGLETON
  • TRANSIENT
  • PER GRAPH
  • WEB REQUEST CONTEXT
  • POOLED

The passing of time has a profound effect on most foods and drinks, but the consequences vary. Personally, I find 12-month-old Gruyère much more interesting than 6-month-old Gruyère, but I prefer my asparagus much fresher than either of those. In many cases, it’s easy to assess the proper age of an item; but in certain cases, doing so becomes very complex. This is most notable when it comes to wine (see figure 8.1).

Figure 8.1. Wine, cheese, and asparagus. Although the combination may be a bit off, their age greatly affects their overall qualities.

Wines tend to get better with age—until they ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required