Skip to content

Model logic

JVerbruggen edited this page Jan 11, 2021 · 5 revisions

In a lot of cases, we want to tie some logic to models in our application. This can come in handy, especially if you are working with complex algorithms. But maybe, this isn't the best way to do that.

Models

The application is distributed over several layers. This design allows layers to evolve without breaking any others. Data-holding layers, i.e. the EULYNX and IMSpoor classes are grouped into the Data layer. Logic that exploits and manipulates the data is found in the Services module. Logic interacts with the data through an interface. These interfaces are designed for maximum uncoupling.

Logic for models

Although the statement above is nice and all, we do need some sort of logic with the models. Herefore there is a workaround. For every model that requires some sort of logic in the algorithm, a Manager can be created. Managers are situated in the Services layer and make use of the underlying Models. It is an interface that connects the two together but also allows them to evolve independently of one another.

Managers have some basic functionality built into them, which you can read more of by clicking here.

Because it is set up this way, managers can have very specific functions built right into them, in addition to the logic which it inherits from its base class.