views:

56

answers:

5

What i want is to describe a form (fields with types, names, validation rules) via some xml or dsl. Then, in the runtime my code feeds this tool with metadata, it generates form (web, win forms, whatever), it's shown to a user, user inputs data, pushes OK, tool calls my code via some delegate with values as key-value dictionary. Of course, I can write such a thing by myself, but maybe I don't need to?

+1  A: 

Dynamic Data will do it from an model eg Linq to SQL or EntityFramework, but not xml. It drives from the data and uses templates.

Click

Hope this helps.

WestDiscGolf
+2  A: 

If you look at the code behind for WinForms, the controls are assembled and configured in code.

If you decompile (e.g. via Reflector) the assembly generated from web .aspx or .ascx in WebForms it is just code that outputs the HTML (lots of Response.Write calls via an HtmlTextWriter.

XAML is just a way to define an object graph.

It is all just code.

There is no reason you can't:

  1. Create your own code generator to create UI code at compile time.
  2. Create the "controls" you need from some DSL at runtime.
Richard
I have no doubt I can write some code to get what i want. My question is about already written code, which i can reuse.
fspirit
A: 

I know only one tool from MS world which is close to your requirements - MS InfoPath. My experience is that everything including custom development is better than InfoPath.

Ladislav Mrnka
A: 

Ironspeed does what you're after. I've heard of some having poor experiences with it, however.

Paul Suart
A: 

You might want to take a look at NakedObjects. That works the right way: from code to data, not the other way around. Otherwise you will not be able to adequately model behavior. For other platforms (Bamboo, java, Smalltalk) there are other implementations.

Stephan Eggermont