Open mikron-ia opened 4 months ago
A possible solution: a 1:1
to Epic
and any other object that needs it ConfigPack
object containing a JSON packed-configuration, unpacked in entity, accessed via getters, with all variables expected there (fed with defaults if absent).
Alternatively, not even a separate DB entry but just a JSON field within the object (with the same name across all objects), unpacked on use and packed on save by a trait-driven mechanism with a method ensured by HasConfig
interface.
Possible issues:
Group
is a good example, nothing else needs that, perhaps except Thread
once they exist) - this can be solved by getters returning false
if absent regardless of sense, returning null
if absurd, or just having two versions that have either behaviorParameter
, creating a pointless redundancy - keeping it as on/off is necessary, and simplifies interface, too
Currently, the only ways to add a configuration variable per object is to either introduce a 0/1 flag into the database (which would clutter the record) or to use a
Parameter
(which is not the intended use, is hardly intuitive, and clutters a different place).Consider adding some flag/attribute/trait system that would allow an on/off configuration per object. First use could be in #58 for display as tab for
Group
functionality.