1) The current state of UI frameworkAs you know, UI framework is complicated with event pump, buttons, panel classes.I worked on them before. My Button code was thousand lines (and still inherit from Flash MovieClip)It was a night mare to debug, read code in UI framework.
--> Is the Button code handling too many use cases at the same time?
2) The UI Behavior in WPF (DCI alike)In WPF, they have concept of reuse behavior which is working like DCI.In WPF UI behavior, they have object like Roles, and register event from those Roles and when UI event get triggered they trigger the interaction between Roles to do UI work like drag and drop...This behavior can be injected to any suitable UI Control for reuse. So people actually need and do DCI some forms different somewhere.3) The State Chart bookMr Horrock has the idea to use State Chart to model the Controller in the MVC.The state chart is visual of state machine with Concurrent States, Nested State, State with history....4) The DCI: Capture the System Operation at Use case level, the missing piece for Readable Code5) My humble View of how everything should work together- When I think about all the above ideas, it turns out that a UI Control like Button itself is a MVC: Button Data, ButtonController, Button View.- So I am think why we cannot use all of these idea together to make code more readable at all levels.(Trygve already did try this in Prokon.)And it may open a chance to make visual programming that really works.- The DCI Baby Editor is the missing piece of the entire Visual programming field. People are using flow chart for it which is more like procedural programming.
Attached is my sketch for the idea.- On the left we have Render thread that can look at Data and render the UI Control: Mouse, Button, Panel- The Data layer have Native Data, Data Context and data binding to avoid manually pull and push data from View to Model.- The Data should be dump like DCI Data- If the Data is changed it will send Changed Event to Event Bus ( there a lot of things to discuss how to implement the event bus in UI, domain, application...)- The Controller is the most interesting part of this View:+ In DCI we still just say Controller will start the Context (construct objects, context, run....) but no more than that.+ Here I model Controller as a state machine for more control and better to handle different states of the View+ We have decision table with take an Event, State as Input and out put a DCI Context, then trigger the Context ( This table can be reused and extended as will, this can be a GREAT deal of code reuse and extensibility like Open Close Principle )+ The Context then will run interaction of Roles to change Data+ Data will then trigger next cycle of interaction....- So the loop start with:
(0) Hardware Event (Event Bus)-> (1) Decision Table (event, state, context) ( in Controllers)-> (2) DCI Context -> (3) Change Data (Decision Table)-> (4) Changed Event ( In Data, to Event Bus)-> (0) for higher level of objects. (Event Bus)