Author Topic: Code Template Framework: add @sort to %list%  (Read 868 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1274
  • Karma: +93/-8
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Code Template Framework: add @sort to %list%
« on: December 09, 2009, 07:44:01 pm »
Hi!


The code generation control macro %list% could use a @sort argument. Things often need to appear in a resulting file in a strict order, defined by the contents of the elements.

The argument should be the name of a macro to be applied in context when the %list% is executed. Examples:
%list="Class" @sort="className"%
%list="Operation" @sort="opAlias"%
%list="Attribute" @sort="attInitial"%
%list="Namespace" @sort="packageTag:%qt%MyTag%qt%"%

It should also be possible to specify a reverse sort by adding an additional argument @reverse="True".

Not specifying a @sort argument results in the model default order (which can still be reversed).

This functionality would be immensely useful for some of the stuff we do over here.

Cheers,


/Uffe
My theories are always correct, just apply them to the right reality.