The present invention enables a user to build user-interfaces and
applications based on a policy that contains metadata. The user can build
an application through the user-interface, in which the user-interface
and the generated computer-executable instructions are consistent with
the policy. A user-interface has a toolbox that indicates the discovered
components and a design surface that displays applicable stages. The
policy determines the stages, where each stage provides a grouping of
components having related tasks. The user selects components from the
toolbox so that the selected components are associated with the selected
stages on the design surface. After the user has completed building an
application, a representation of the application may be compiled in order
to generate a set of computer-executable instructions. Moreover, the
compiler is coupled to the policy so that the set of computer-executable
instructions is consistent with the policy.