Non of the existing UI frameworks/philosophies - MVC, MVVM, MVU etc. - fulfills all of the following requirements:
- allow creation/maintenance of the actual UI by a non-programmer completely
- separate properly between code that serves only UI specifics (for example, expanding/collapsing a treenode or a panel, or defining what selection means in a given context) from code that has to do with the domain directly or indirectly (eg, calls to a server)
Two roles (may be assumed by the same person, or each by multiple, does not matter):
UX: a designer who knows HTML, CSS and has a little bit of understanding for declarative scriptingDEV: a programmer/Developer
assumption: user stories/specs are given and clear to everyone involved
DEVundUXagree whichoutputs and COMMANDs the model will expose. After this step, they will each work completely separately and independently.DEVworks on the model, exposingoutputs and COMMANDs;UXcreates HTML/CSS, with all the moveable parts- once both are done, the whole thing works
Typical scenarios:
- a form should be split into a wizard/step by step thing: doable completely by
UX - a list should be made client-side pageable: doable completely by
UX - a textbox for input of tags should offer client-side auto-completion:
DEVadjusts model to expose anoutput"AllAvailableTags";UXcan do all the rest - a list which so far allowed only single selections and certain actions on the selected item, should switch to multiple selection:
DEVadjusts all COMMANDs to take list arguments instead of single arguments;UXcan do all the rest
data the model exposes; can be bound from the UI, never changed; if it updates in the model, it updates in the UI automatically
declared in the UI; written only by other UI declarations; read only by other UI declarations; serve for stuff like "selectedItem(s)"
commands are exposed by model only; are async by default/always; may have parameters; never have a return value; UI can call a command and pass in arguments referring to UI variables (or constants)
declared in the UI and invoked from the UI only
- SPA always
UXnever interacts with JS or any other programming language; only with declarative syntax, DSL for themDEVcan choose whatever language they want: JS, TS, WebAssembly (C#, F#, whatever); if language-specific adapters are necessary to enable support, so be it- UI declarations must be completely doable by
UX - all UI logic (
outputs,variables,actions, calling ofcommands) is hot-reloadable (and, of course, CSS, too), soUXcan work the way they usually like to - UI components: have no model, are written by
DEV, used only byUX; add new declaration elements usable byUX - template components: have no model, encapsulate a combination of existing HTML, CSS, declaration elements, are written and used by
UXonly - ability to easily create
mock modelforUX: ideally, doable by somewhat more advancedUX - debugging support for
UX- easily switch to
mock model-> try if problem still present? -> no: problem is in model implementation, forward issue toDEV - enable debug output that writes to console what is happening in terms of declaration calls
- easily switch to
UXcan define client-side routes, pages withoutDEVsupport- out-of-the-box
commands for calling APIs, for OAuth authentication, for passing OAuth tokens with API calls - ability to wrap existing UI components from 3rd-party for use by
UX
- Todo App
- single selection vs multiple selection
- tag auto-completion client-side
- tag auto-completion server-side
- paging
- trigger commands via keyboard shortcuts, alternatively to buttons
- split one view/page into multiple
- login/logout flow with protected views/pages
- ?how to wrap existing datetimepicker?
typedeclaration for model-properties, if denoting primitives likestringorboolean, mean the UI-relevant type; ie, anidproperty may be a long or a Guid or whatever in code, but in the UI can have the typenone, meaning it's not going to be displayed at all, or it could havestringmeaning it will be displayed as text etc.
Use of the contents of this repository is governed by the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License.