ContainerInstance
What are Container Instances ?
Container Intances are configured types of containers (see Techne.ContainerType).
To give some of the most visible characteristics first:
- They are produced by the Techne.Builder. You can think of an instance produced by a factory.
- They are persistent
- They are intend to "live long"
- But they change their inner structure regularly (Mutability) --> Emerging Behaviour
- Those changes are versioned
Lifecycle
Birth
ContainerInstances are created by a separate component called Techne.Builder.
After this, a containerinstance can be freezed (FAR) to be stored (or transported over the wire) or just loaded by a Techne.Runtime.
Running
A ContainerInstance runs inside a Techne.Runtime. There is exactly one active ContainerInstance but more than one can be "loaded" to collaborate to the active one)
The Techne Runtime uses the Builder to change the state of the running instance as wanted.
There are two common change patterns
change type
A container type is kind of a meta profile for a ContainerInstance.
So you can change the type from "web" to "console" for example.
For a common web app (possible) types are:
- ajaxweb
- web1.0 (webapp with static html only)
- debugmode
Basically those types are abstract ContainerInstances that can be switched easily.
Thus they "batch"-change some of the inner architecture to match a particular pattern (maybe ui or just the persistent logic)
There can be just active type per ContainerInstance but types support the composition model so they can be assembled from other types. (This notion of composition is very important in techne).
Of cause those ContainerTypes must be developed specificly for a application.
But that why techne defines the notion of a Fragment.
Those fragments are the buts and bolts of any techne driven app.
Fragments can have a variety of forms:
- pure osgi bundles
- pure java jar files
- war files
- static resources
- classes
- xml files
- other..
They are declaratively (assembly decription file) or interactively (through Techne.Console assembled to one of the following
- ContainerInstance
- ContainerType
The notion of instances and types at assembly time is not clear.. i think
Integrate other instances (merge)
You can mix and match instances to new instances (emerging behaviour)
Sleep
A ContainerInstance can be shutdown (freezed) at any time.
A wakeup call re-starts the old state (just like osgi profiles)
Death
ContainerInstances can be removed of cause but it's more likely they go to some kind of an archive or reopsitory to come back when time goes by ..