Skip to content

How it works

Matt Dean edited this page Jan 15, 2020 · 2 revisions

BACK > Home


Welcome to kPooling!

This page explains how the functionality behind kPooling works.

alt text Data diagram for kPooling.

1) Gather Processors

When the PoolingSystem is first accessed it uses reflection to gather Processor classes. These classes are used to process Pools as they are created and used. Once Processor classes are gathered they are cached and never gathered again.

2) Create Pools

When the user calls CreatePool<T> the PoolingSystem creates a new Pool using the generic type T. This type argument allows both type specific processing via Processor classes and returning instances directly as T. A Pool can only be created if the type T has an associated Processor class.

3) Get Instances

When the user calls GetInstance<T> the PoolingSystem iterates all Pools to find a Pool of matching type T. When a matching Pool is found a valid instance is returned.

Clone this wiki locally