Reinhard Poetz wrote:

Daniel Fagerstrom wrote:

<snip/>

I still think that "macros" can be usable for reusable "model definitions" but IMO the problem that you describe is a symptom of model/view mixup in widget definitions, and we should start to do something about that.

hmmm, what about this: In a former project (not done with cForms) we had many places with order numbers, customer numbers, email adresses, credit-card-numbers and many other repeating domain specific field types.


In cForms you always have to write

<fd:field id="order-number">
  <fd:label>order number</fd:label>
  <fd:datatype base="string"/>
  <fd:validation>
     ...
  </fd:validation>
</fd:field>

or the creditcard field definition would be a more verbose example (think of the agrregation/splitting part, validation, ...). The problem is not verbosity (sooner or later we will use GUIs to work on cForms definitions) but consistency. If for some reason any free mailer e-mail adresses shold be valid (hotmail, yahoo, gmx, ...) I only want to change it at a *single* place.

Macros as reusable data types is OK in my (model view SoC fundamentalistic ;) ) opinion. Just wanted to point out that your first usesace could be attaced from a different POV.

/Daniel




Reply via email to