-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Summary
The NoTransientInstancesOfPersistentClass conditional define should be removed and the check should always be enforced.
Background
Currently, creating transient instances of persistent classes is conditionally prevented via {$IFDEF NoTransientInstancesOfPersistentClass} in BoldSystem.pas. This define is enabled under the Attracs configuration but disabled otherwise.
Problem
There is no valid use case for creating transient instances of persistent classes:
- Temporary objects can use undo/rollback or separate DTO classes
- Preview/simulation scenarios should use separate in-memory systems
- Template objects can be stored in DB or use non-persistent classes
The conditional define:
- Implies the feature might be useful (it isn't)
- Allows bugs in builds without the define
- Adds unnecessary complexity
- The
AddTransientFromSystemprocedure in BoldObjectListControllers.pas becomes dead code
Proposed Solution
- Remove
{$DEFINE NoTransientInstancesOfPersistentClass}from Bold.inc - Remove
{$UNDEF NoTransientInstancesOfPersistentClass}from non-Attracs block - Make the check in BoldSystem.pas unconditional
- Remove dead code
AddTransientFromSystemfrom BoldObjectListControllers.pas - Update tests that relied on this feature
Metadata
Metadata
Assignees
Labels
No labels