Skip to content

Infrastructure Components

Egor Tolstoy edited this page Jul 11, 2015 · 7 revisions

#What is an Infrastructure Component?

Infrastructure components are special in the sense that they, if defined, are recognised automatically by the container. These components have a special meaning and purpose in Typhoon and will be picked up and registered separately from your application components.

The current infrastructure components recognised by Typhoon are:

###TyphoonDefinitionPostProcessor

Use this if you want to process reconfigure or mutate definitions after they've been loaded, but before instantiation. As shown in the documentation link above, Typhoon uses several of these post-processors internally. If required you may register one ore more of your own.

The TyphoonConfigPostProcessor is an example of an implementation.

###TyphoonInstancePostProcessor

Use this if you want to process a instance after it has been instantiated by the container, for example you could wrap in instance in a proxy that evaluates permissions before making network requests.

Ordering post processors

The above post processors supports being ordered if needed. In order for your implementation to be ordered implement the TyphoonOrdered protocol. Any post processors registered will be sorted before applied.

###TyphoonTypeConverter

The type converter is also an infrastructure component. When defined it will be picked up and registered automatically as described here.

Quick Start!

Get started in two minutes.

Main Track

Get familiar with Typhoon.

Advanced Topics

Become a Typhoon expert.

Under the Hood

For contributors or curious folks.

Clone this wiki locally