Re: By The Dawn's Normal Light

From: erk <eric.kaun_at_pnc.com>
Date: 1 Nov 2004 13:01:33 -0800
Message-ID: <1099342893.961307.198010_at_c13g2000cwb.googlegroups.com>


I don't. I'd like, for example, to do something like this in Java:

Set<Something> things = {allThings} [type=Type.A_TYPE && otherThings.creationDate < lastMonth];

... rather than doing some combination of these to collect these:

  1. a code block looping through allThings, plus
  2. a code block looping through otherThings, OR
  3. an intermediate Map in which the key is some single attribute or some made-up class which collects two values, and the value is

But note that the above can only cope with existing classes; should I want a few attributes from one class and a few from another, where the instances match based on some criteria, I need to invent (and populate) my own instances of another class.

In other words, what I need is a relational expression language which operates over my GUI and business data as nicely as it can over "persistent" data, since it's all just data. The constraints keep me honest, in a much more expressive and effective way than Java's assert (which has some minimal uses), and even more than preconditions and postconditions a la iContract (since relational constraints are over one or more relations, not on a single class or method).

And, of course, the above doesn't touch the ability of referential constraints to express relationships which imply GUIs that otherwise must be coded manually; and, of course, other constraints for ranges, etc. which could generate some useful boilerplate JavaScript code (in the case of HTML GUIs).

  • erk
Received on Mon Nov 01 2004 - 22:01:33 CET

Original text of this message