Skip to content

SafeContainer

undergroundwires edited this page Feb 4, 2020 · 8 revisions

SafeContainer

SafeContainer is a dependency container that detects injections to its instances.

How to use

Change security settings

The security mode any of the SafeContainer can be disabled via calling container.SetProtectionMode(SafeContainerProtectionMode.NonProtection) for the instance. It can also be re-enabled by calling container.SetProtectionMode(SafeContainerProtectionMode.FullProtection).

This class is used widely in SafeOrbit for dependency injection pattern, you can change the inner injection protection of SafeOrbit as well.

How it works internally

SafeContainer saves the information (code, state) of the object. This operation is called stamping (IStamp) and handled by IStamper.

Each stamp is hashed with salts. Stamps are created depending of the instance life time.

SafeContainer protects the stamps via SafeObject instance.

It uses InjectionProtector to protect its instances and instance creation logic.

See also

Clone this wiki locally