uday
uday

Reputation: 211

Usage Pool in C#

In one of the interviews of C#, the guy was asking me are you aware of usagepool in C#.

I asked him is it thread pool that he is talking about, but he said no it is usage Pool

He was giving the hint that we can reuse the same thing without destroying using something like usage pool

Any idea what the guy might be talking about?

Upvotes: 2

Views: 168

Answers (3)

Louis Kottmann
Louis Kottmann

Reputation: 16628

He may have referred to an Inversion of Control.
You can find a basic implementation here: IoC

If you're looking for more in-depth stuff, i recommand MEF (which is a dependency injection as well, and ships with .NET), Unity, Castle Windsor...

EDIT - Comments asked for clarification:

He was giving the hint that we can reuse the same thing without destroying using something like usage pool

Looks a lot like IoC to me.

Upvotes: 0

Steve Wellens
Steve Wellens

Reputation: 20620

It might have been to determine if you ever BS.

In which case the correct answer is, "I've never heard of that."

Upvotes: 1

jdross
jdross

Reputation: 1206

Maybe object pooling?

Object Pooling service enables you to reduce the overhead of creating each object from scratch. When an object is activated, it is pulled from the pool. When the object is deactivated, it is placed back into the pool to await the next request.

Or was he possible talking about an application pool? Where an application pool will not be affected by application problems in other application pools.

Upvotes: 0

Related Questions