Best Design Pattern for Generating the UI dynamically
I am planning to generate the UI from database. The platfrom will be ASP.net.
Can anyone help in identifying the best design pattern/Architecture开发者_开发百科 that suits for generating the UI and events dynamically.
See ASP.NET Dynamic Data on MSDN, that's my best bet. But some more info about your project would help. :)
Sometimes, the answer is, "Don't Try To Do That." Magically generating UI from your data structures is an old idea. I've seen teams try to do it in DBase 4, in Java, in C++/MFC, and in old-style ASP; also, OS/2 included an implementation of the idea. All of those implementations were practical failures, all following a similar pattern: the coder ends up with something that makes a vertical list of textboxes or whatever, and then the thing stalls.
If you had a brilliant enough idea to get around that problem, you wouldn't be asking a question this general. Since you don't, stay out of this particular cactus patch.
Check out the "two-step process" in the Orchard CMS:
http://whereslou.com/2010/09/12/orchard-moving-along-nicely
精彩评论