2008-01-16
the paint points of xaml
Pain Point 1: XAML always create the controls by its default constructor
This means, you need to have a default constructor for you control, and the constructor will always be used by XAML. So, you can not use constructor dependency injection to pass things like services, gateways to your control. Also, you will not have chance to pass data in constructor, although the data might be must-have for the specific type of control
Paint Point 2: can not control XAML to create or not to create some part of GUI
Sometimes, the GUI is not static. It could be dynamic because the GUI would be different for the data it is presenting, such as for a meeting in the past it should show a adding note button, for a meeting in the future it should not. And more often, the security control requires the GUI to be different according to the role.
Paint Point 3: XAML is using XML, which contains too many visual noise
compared to things like YAML, XML is definitely not very friendly to our eyes. The things worse than XML I can come up is the braces of Lisp. Also, XML makes it harder to edit manually
Paint Point 4: Layouting in Grid
Using grid layout currently requires you to specify the row and column for all the children of a grid. It is very error-prone when the grid becomes large. But grid is a must-have for any non-trivial GUI, and there is not replacement for it yet.
Paint Point 5: Things not checked in compiling time
There are lots of things not checked by the compiler in XAML. Things like binding, resource looking up for example. And it is harder to cross reference between xaml and code.
Paint Point 6: More files
one file for xaml one file for cs. It requires more steps to create a new user control and is confusing to new comers.
Paint Point 7: Separating concerns
the default way events get handled is in the partial class of the XAML. It is not a good way of separating concerns and not good oo design. the windows and user controls usually doing too much in rich client application. It is not the fault of XAML in general, but it is not promoting a good model either by its weird way of hooking up event in xaml.
Paint Point 8: Hard to test
It is hard to test in many ways. First, not easy to inject dependency means you can not mock those expensive things like network connection. Second, creating a real window is taking more than ten seconds. Third, many things are in a static singleton model like resource looking up and the single instance application object.
This means, you need to have a default constructor for you control, and the constructor will always be used by XAML. So, you can not use constructor dependency injection to pass things like services, gateways to your control. Also, you will not have chance to pass data in constructor, although the data might be must-have for the specific type of control
Paint Point 2: can not control XAML to create or not to create some part of GUI
Sometimes, the GUI is not static. It could be dynamic because the GUI would be different for the data it is presenting, such as for a meeting in the past it should show a adding note button, for a meeting in the future it should not. And more often, the security control requires the GUI to be different according to the role.
Paint Point 3: XAML is using XML, which contains too many visual noise
compared to things like YAML, XML is definitely not very friendly to our eyes. The things worse than XML I can come up is the braces of Lisp. Also, XML makes it harder to edit manually
Paint Point 4: Layouting in Grid
Using grid layout currently requires you to specify the row and column for all the children of a grid. It is very error-prone when the grid becomes large. But grid is a must-have for any non-trivial GUI, and there is not replacement for it yet.
Paint Point 5: Things not checked in compiling time
There are lots of things not checked by the compiler in XAML. Things like binding, resource looking up for example. And it is harder to cross reference between xaml and code.
Paint Point 6: More files
one file for xaml one file for cs. It requires more steps to create a new user control and is confusing to new comers.
Paint Point 7: Separating concerns
the default way events get handled is in the partial class of the XAML. It is not a good way of separating concerns and not good oo design. the windows and user controls usually doing too much in rich client application. It is not the fault of XAML in general, but it is not promoting a good model either by its weird way of hooking up event in xaml.
Paint Point 8: Hard to test
It is hard to test in many ways. First, not easy to inject dependency means you can not mock those expensive things like network connection. Second, creating a real window is taking more than ten seconds. Third, many things are in a static singleton model like resource looking up and the single instance application object.
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 81553 次
- 性别:

- 来自: 北京

- 详细资料
搜索本博客
我的相册
step2
共 6 张
共 6 张
最近加入圈子
最新评论
-
汉语编程,有搞头
就E语言算巴 没用过也没计划用 CHTML不错哈哈
-- by lwwin -
关于estimation的闲言碎语
1. BA是Business Analyst的缩写,就是写story的人.2. ...
-- by taowen -
关于estimation的闲言碎语
请教:1.BA是什么意思?Business Analyzer?2.“好的esti ...
-- by movingboy -
计划经济体制的CMM,市场 ...
有创意,有启发性。顶!!
-- by estest -
贫血的Domain Model
看了这么久的领域模型,争论的真是没完没了。 难道就不能跳开这个领域模型或者还领域 ...
-- by hunter001201






评论排行榜