signoff_id binds a persistent DB object to a piece of code with business logic for the signoff.
If a Signoff is deleted, but there are signets in DB with its ID, that causes a crash when the registry returns None for the signoff type. The behaviour of a signet with no associated signoff is undefined, but the system should degrade predictably, not crash.
2 fixes required:
-
Documentation: add a warning, like: deprecate signoffs, don't delete them from code base! Before deleting a signoff, update or delete all Signets from DB that store its signoff_id.
-
Code: use Null Object pattern to return a Null signoff with very restrictive behaviours defined as a placeholder so system can continue to function despite data inconsistency.
signoff_idbinds a persistent DB object to a piece of code with business logic for the signoff.If a Signoff is deleted, but there are signets in DB with its ID, that causes a crash when the registry returns None for the signoff type. The behaviour of a signet with no associated signoff is undefined, but the system should degrade predictably, not crash.
2 fixes required:
Documentation: add a warning, like: deprecate signoffs, don't delete them from code base! Before deleting a signoff, update or delete all Signets from DB that store its
signoff_id.Code: use Null Object pattern to return a Null signoff with very restrictive behaviours defined as a placeholder so system can continue to function despite data inconsistency.