The main differences between vanilla MVC (ala original SmallTalk design pattern) and MVCCE are:
- Commands and Events are added to the list of first class citizens (along with Models, Views, Controllers)
- Components are explicitly expected to often be Compound and/or Composite,
but methods are still segregated into Model, View, Controller, Command, Event interfaces;They are separate components with separate interfaces, to cover the separate aspects of a widget. (e.g. the View that renders a particular piece of DOM is not combined with the Controller that listens to events from that same piece of DOM). - Controllers are very restricted, moving "business/app" logic into Commands,
with controller logic limited to handling events in order to decide which Command to call, and which parameters to pass to it. - Commands mirror semantically-high-level User Actions rather than being low level event handlers
I reproduce the two diagrams below (click to expand) created for a client as "cheat sheets" for the pattern I call MVCCE (MVC + Commands and Events)
Click to Expand |
Click to Expand
No comments:
Post a Comment