On 10/14/19 11:01 PM, Kerim Aydin wrote:
But are the dependencies you've identified truly circular? Many rules have
multiple independent clauses that could very well be separated into smaller
rules. If the "circularity" is created by a link to two entirely separate
clauses within a rule, that could easily be separated without any change of
function, is it really a circular reference to be concerned about?
In the dependency cycle [869, 2141, 1051, 1006],
rule 869 uses the definition of rule from 2141,
rule 2141 uses the definition of Rulekeepor from 1051,
rule 1051 uses the definition of Office from 1006, and
rule 1006 uses the definition of person from 2141.
In three of these cases, the dependency lies not in the definition of
what is being referenced, but in phrases outside of the definition
itself. For me, it helped to model these as header files.
869.h
~~~~~~~
#include "2141.h"
...
struct person; // doesn't reference rules here
~~~~~~~
2141.h
~~~~~~~
#include "1051.h"
...
struct rule; // doesn't reference rulekeepor here
~~~~~~~
1051.h
~~~~~~~
#include "1006.h"
...
struct office rulekeepor;
~~~~~~~
1006.h
~~~~~~~
#include "869.h"
...
struct office; // doesn't reference persons here
~~~~~~~
In this case, it's obvious that these dependencies are circular. If we
do as G. suggests and separate the definition of an entity completely
from what we can do with that entity, perhaps by moving the last three
paragraphs of rule 2141 to a new rule called "Tracking the Ruleset" most
of the dependency cycles should go away. This may give rise to new
dependency cycles, but I doubt the new situation could possibly be
worse. 2141 depending on 1051 is the cause of well over half of our
current dependency cycles.
--
Trigon