Skip to content

Improve state management implementation in the GUI #1975

@laim2003

Description

@laim2003

Task summary

The current proposed architecture uses singletons. However, this can lead to problems in the future, e.g. for testing the state and generally, Singletons are not a good design choice for larger projects. Therefore I recommend moving to a different architecture. I recommend:

  • Keep using IdeGuiStateManager, but remove singleton design and make the class and its properties fully read-only.
  • Supply the IdeGuiStateManager to all components via Dependency Injection (including UI controllers.)
  • Create a custom UI Controller class that takes an IdeGuiState as a parameter in the Constructor (and can be extended in individual controller implementations)
  • Create a listener interface that allows components to be notified when changes to the context occur (e.g. switching a context)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    GUIGraphical User Interface of IDEasy (aka dashboard) build with JavaFxcoreFileAccess, ProcessUtil, IdeContext, etc.enhancementNew feature or requestinternalNothing to be added to CHANGELOG, only internal story

    Type

    No fields configured for Task.

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions