What I do is basically use reflection to read all properties of a domain object, then decide based on the type of the property what kind of input field to create. Then I have annotations on fields that will tell if the property is required, or list a set of options for dropdowns etc, or even override by specifying the type of control to create. Then the rest is wired together.