A colleague and I designed a system for our customer, and in our opinion we created a nice clean design. But I\'m having problems with some coupling we\'ve introduced. I could t
I'd have to assume that the business logic that requires Soluble requires other things too. If so, can some part of it be incapsulated in Medicine in a meaningful way (more meaningful than Medicine.isSoluble())?
Another possibility (probably an overkill and not complete solution at the same time) would be to present the business rule as object of its own and use double dispatch/Visitor pattern:
RuleCompilator
{
lookAt(Protocol);
lookAt(Medicine);
lookAt(AdminstrationProcedure)
}
MyComplexRuleCompilator : RuleCompilator
{
lookaAt(Protocol)
lookAt(AdminstrationProcedure)
}
Medicine
{
applyRuleCompilator(RuleCompilator c) {
c.lookAt(this);
AdministrationProtocol.applyRuleCompilator(c);
}
}