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
DEV
undUX
agree whichoutput
s and COMMANDs the model will expose. After this step, they will each work completely separately and independently.DEV
works on the model, exposingoutput
s and COMMANDs;UX
creates 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:
DEV
adjusts model to expose anoutput
"AllAvailableTags";UX
can 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:
DEV
adjusts all COMMANDs to take list arguments instead of single arguments;UX
can 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)"
command
s 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 variable
s (or constants)
declared in the UI and invoked from the UI only
- SPA always
UX
never interacts with JS or any other programming language; only with declarative syntax, DSL for themDEV
can 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 (
output
s,variable
s,action
s, calling ofcommand
s) is hot-reloadable (and, of course, CSS, too), soUX
can 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
UX
only - ability to easily create
mock model
forUX
: 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
UX
can define client-side routes, pages withoutDEV
support- out-of-the-box
command
s 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?
type
declaration for model-properties, if denoting primitives likestring
orboolean
, mean the UI-relevant type; ie, anid
property 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 havestring
meaning 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.