Menu

MultipleRepresentsClauses

Gary T. Leavens

David Cok raised an issue (on the jmlspecs-interest mailing list, May 18, 2013), which can be paraphrased as follows:

It seems that the syntax permits more than one represents clause for a given model field. This raises several questions:

  1. Should we only allow one (non-redundant, i.e., clause that does not use the redundantly keyword) represents clause for each model field?
  2. If multiple represents clauses for a model field are allowed, do all the different represents clauses for a given model need to give the same result for all states? (And if so, in what sense must they be the same?)
  3. Should we allow overriding of the represents clause in a subtype?
  4. If we allow overriding represents clauses in subtypes, what, if anything, needs to be checked?

Some thoughts by Gary Leavens:

1.In the interest of simplicity, there doesn't seem to be a good reason to allow more than one non-redundant represents clause for a given model field in a type. That decision would avoid the need to answer question 2, and also allow the most common usage of represents clauses.
3. It is convenient sometimes to allow overriding of represents clauses in subtypes, particularly to give a more efficient or more clear implementation of a model field.


Related

Wiki: SemanticDiscussionIndex

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.