Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag/attribute/trait system #388

Open
mikron-ia opened this issue May 19, 2024 · 1 comment
Open

Add flag/attribute/trait system #388

mikron-ia opened this issue May 19, 2024 · 1 comment
Assignees
Labels
blocking Blocks another task importance: should Optional, but useful or needed, but not critically; should be done internal Without much influence on the interface producer Creates a base to be used later
Milestone

Comments

@mikron-ia
Copy link
Owner

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.

@mikron-ia mikron-ia added internal Without much influence on the interface importance: should Optional, but useful or needed, but not critically; should be done blocking Blocks another task labels May 19, 2024
@mikron-ia mikron-ia added this to the v1.2.0 milestone May 19, 2024
@mikron-ia mikron-ia self-assigned this May 19, 2024
@mikron-ia mikron-ia added the producer Creates a base to be used later label May 19, 2024
@mikron-ia
Copy link
Owner Author

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:

  • Not all objects need the same flags (Display as tab for 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 behavior
  • Once this solution gets values, it becomes essentially a new version of Parameter, creating a pointless redundancy - keeping it as on/off is necessary, and simplifies interface, too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocking Blocks another task importance: should Optional, but useful or needed, but not critically; should be done internal Without much influence on the interface producer Creates a base to be used later
Projects
No open projects
Status: To Do
Development

No branches or pull requests

1 participant