How object pooling in .NET is done
COM+ reduces overhead by creating object from scratch. Thus in COM+ when object is activated its activated from pool and when its deactivated it's pushed back to the pool. Object pooling was configured by using the "ObjectPoolingAttribute" to the class.
ObjectPooling(MinPoolSize := 2, MaxPoolSize := 5, CreationTimeout := 20000)> _
Public Class testingclass
Public Sub DoWork()
'Method contents go here.
The sample Code above has the "ObjectPooling" attribute defined. Below is a sample code which uses the class.
App Overloads Public Shared Sub Main(args() As String)
Dim xyz As New TestObjectPooling()