Singleton Pattern Removal:
Transition away from using the singleton pattern for services and views. Instead, manage services within the DataModel and require content views to take a SharedUIView as an argument, promoting better resource management and future testability.
Dependency Injection:
Implementing dependency injection could resolve issues related to service and view management, enhancing testability. This requires:
App.xaml to maintain a MainWindow property.
MainWindow to contain a SharedUIView property.
Content views to be initialized with SharedUIView, following an interface or abstract class requirement.
DataModel to initialize services like AudioService and InputService, providing access functions for these services.
Singleton Pattern Removal: Transition away from using the singleton pattern for services and views. Instead, manage services within the DataModel and require content views to take a SharedUIView as an argument, promoting better resource management and future testability.
Dependency Injection: Implementing dependency injection could resolve issues related to service and view management, enhancing testability. This requires:
App.xaml
to maintain aMainWindow
property.MainWindow
to contain aSharedUIView
property.SharedUIView
, following an interface or abstract class requirement.