Child pages
  • Code generation in re-motion

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

dbschema.exe is always the first program generator used, because it derives the database schema for persisting domain objects. dbschema.exe inspects domain object assemblies to find domain object classes, their properties and attributes and generates the database schema – tables and views. dbschema.exe can be invoked many times in the course of a project, because the programmer does not modify the generated database schema. (This is in contrast to uigen.exe that can be run only once before making changes. You must start from scratch every time you run uigen.exe.)

uigen.exe

uigen.exe enters the stage as soon as you not only have the properties and attributes for your domain object classes, but also query methods, factory methods and behavior – in short: the "domain". You are ready for the web application.

uigen.exe works like dbschema.exe in that it inspects the domain object classes, properties and attributes in domain object assemblies uigen.exe's use is more delicate, however, because it generates the starting point for programming your web application. You customize and extend that web application by modifying the generated files. uigen.exe is not a round-trip tool. If you change properties (types, constraints) in one or more domain object class, you must uigen.exe again and start over with your modifications.

Both uigen.exe and dbschema.exe inspect domain object assemblies, but...

uigen.exe is more picky than dbschema.exe when it comes to usage. Both program generators must load domain object assembly(s) for discovering
domain object classes, but they resort to different libraries for doing so.

  • uigen.exe (an old program) uses an improvised an fragile mechanism
  • dbschema.exe (a new program) uses a mature and robust mechanism

In practice, you won't have problems with dbschema.exe, because it usually does the right thing. uigen.exe is a robust program that has been in use for years, but that's exactly the problem: it is dated. Don't draw conclusions from dbschema.exe usage to uigen.exe usage, and the other way around. How to avoid uigen.exe assembly discovery failures is explained in detail in using uigen.exe.

...