-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The DisplayErrorMessage and DisplayConfirmationMessage methods in Utilities.cs directly interact with MessageBox, which is a UI component. These methods represent UI-specific logic and should not reside in a core utility class.
To achieve a clean UI/Core split, the responsibility for displaying messages should be handled by the UI layer. The core logic should not have direct dependencies on UI elements like MessageBox.
Action:
- Create an interface in the core layer that defines the methods for displaying error and confirmation messages (e.g.,
IMessageDisplayService). These methods should accept the necessary message content but not have UI-specific parameters or return types. - Implement this interface in the UI layer (e.g.,
MessageDisplayService.cs) usingMessageBoxor another appropriate UI mechanism. - Inject or provide an instance of the UI-specific
IMessageDisplayServiceimplementation to the parts of the core logic that need to trigger message displays. - Modify the core logic to call the methods on the injected
IMessageDisplayServiceinstead of directly callingDisplayErrorMessageandDisplayConfirmationMessage. - Remove
DisplayErrorMessageandDisplayConfirmationMessagefrom theUtilitiesclass. - Add or update tests to ensure that the core logic correctly calls the message display service interface.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request