I won’t describe the project details or the framework I am using because the question is more general.
What is the best way to create flexible interaction between the user interface and the logic.
I am struggling because constantly it turns out that I have to make some feature available for the user to change via some ui but the code for the feature is somewhere deep deep in the code so I have to do lots of refactoring.
What is your approach in such situation? Maybe to model event based system where events are dispatched/handled? In my case the requirements change very often.
Use a MVx design pattern such as MVC, MVP, MVVM.
Basically:
* UI should not call BL.
* UI should raise events (or better yet, use commands).
* UI-raised-events/commands should be handled outside UI and call BL.
* BL should not call UI.
* Either modified data should raise events or BL should raise events.
* UI should know how to present data (preferably uses composition to present any type of data and not have entire UI rely on data types not changing).
* UI should refresh on events.