Tuesday, September 11, 2012

The Very First Draft


The idea should be clear enough from the screenshot, but I will add couple of remarks.

As I said, all UI will be rendered on the client by the library. Still you should be able to tell the library what to render. Options are:
- give it an html, which will be 'animated' by js. This will work only in the simplest scenarios. Once we get to the gridview, for example, we will have to generate the rows dynamically, based on the data received from the server.
- give it some kind of html templates, that then be completed by js. But it cannot be just any html. Js will be too dependent on what is exactly in this html to be able to process it correctly.
- use properties and parameters and set everything through the code. This is kind of java way, which has 4 IDE's and not a single one with the visual form editor. WinForms also use this appoach generating tons of ugly code in partial classes. For me it's just too much code that does not do anything.
- and finally, it could be some new markup (xml or json), that describes a UI in terms of windows and controls, similar to XAML.

I like this option because:
- this seems like the right abstraction level. If I am describing the treeview, why should I describe it as a bunch of divs and not call it treeview?
- this makes the markup independent of implementation.
- there is no data in this markup - only presentation. You will need to bind the data to the control before it is rendered.
- customers can customize UI, say, by adding they own fields
- this markup is easy to generate with the tools

Maybe it's too much words, but, as I said, the picture should be enough already.

No comments:

Post a Comment