https://github.com/9elements/datamill-extra
https://github.com/9elements/datamill-extra
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/9elements/datamill-extra
- Owner: 9elements
- License: mit
- Created: 2017-11-17T13:05:55.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-22T16:49:46.000Z (about 8 years ago)
- Last Synced: 2025-06-22T09:55:08.343Z (6 months ago)
- Language: Ruby
- Size: 14.6 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Datamill::Extra
This gem contains things related to the datamill gem which have not proven to be
useful or stable enough to go into the main gem.
## Cell cultures and cell runs
Recall these datamill concepts first:
A "behaviour" is an implementation of how cells of a certain kind need to be
operated. For Datamill, a Behaviour is just an object that implements the
`Datamill::Cell::Behaviour` interface.
Behaviours implement functions managing the cell's `State`, which
encapsulates all the state of and information about the cell, and contains no behaviour
of itself. The behaviour functions themselves are stateless.
This is a rather functional approach and not always nice to operate with.
To give this a more object-oriented flavour,
you can implement a *cell culture* using `Datamill::Extra::CellCulture`.
A cell culture provides the behaviour object, the interface toward the reactor, for
you. Inside the cell culture you describe what a *cell run* looks like,
a class instantiated by the behaviour to handle a single invocation
for the cell. On this cell run you can implement general handling
around all method calls (like logging, exception handling,
presenting a cell's id in a more suitable way...) as well as respond
to cell messages.
## Model events
Model events allow for hooking into the lifecycle events of classic ORMs
to emit Events. These events are managed by corresponding `Datamill::Event` subclasses.