Open GoogleCodeExporter opened 9 years ago
This should start with a small subset of OCL. The idea is that constraints
should be added that will be injected into any method (such as a setX method)
that affects the value of an attribute or a link of an association.
1. Limit the values of attributes to a certain range or set of values or, for
strings, a certain pattern. The range could be dynamic based on some
calculation, and should be able to navigate associations (like OCL does).
2. Limit what can be added as an association. I.e. checking the object about to
be set or adde in an association to determine whether it fulfils a certain
criterion.
Thorough testing needs to be done, including adding testbed tests. The user
manual also needs to be updated.
Original comment by TimothyCLethbridge
on 13 Jan 2012 at 10:35
See http://code.google.com/p/umple/wiki/OCLConstraints for the draft
specifications.
Original comment by TimothyCLethbridge
on 27 Mar 2012 at 3:55
Some work has been started to implement this. Initial syntax would simply be
initially [attrib < 10] where there would be an operator and a constant. This
would inject a 'before' statement to check before an attribute is set. The
grammar has been prepared, but that is as far as this task has been taken.
Original comment by TimothyCLethbridge
on 15 Jun 2012 at 2:16
Original comment by TimothyCLethbridge
on 12 Oct 2012 at 3:24
This feature has now been partly done. You can inject a constraint such as [age
> 5] into a class, where age is an attribute, and the setter will fail on
attempts to set age <= 5.
However, there are still many things to do.
Important: It is still possible to bypass the constraint in a constructor.
There needs to be a code injection before the constructor to reject attempts to
construct an object that has an invalid attribute.
We also need to increase the set of constraints that are allowed. THis can be
done incrementally. The hard work is done.
Most likely will need to make some fixes to Ruby and PhP generation because it
currently requires the constraint to have parens around them. See my java fix
in r2313
Original comment by TimothyCLethbridge
on 20 Dec 2012 at 3:55
This is being put back on the queue for UCOSP students to work on more in
Jan-April 2013. We need to add a lot more test cases, to allow constraints
relating to associations and state machines, to raise errors when constraints
are incorrect, and many other improvements to constraints.
Original comment by TimothyCLethbridge
on 31 Dec 2012 at 1:32
I am adding the tag 'constraints' to this. I am then going to file other issues
related to constraints. Please look at the entire list of constraints issues.
Original comment by TimothyCLethbridge
on 3 Jan 2013 at 10:23
Original comment by TimothyCLethbridge
on 30 Jan 2013 at 1:57
An ongoing issue, but Quinlan has done her part.
Original comment by TimothyCLethbridge
on 30 Apr 2013 at 1:39
Original comment by TimothyCLethbridge
on 30 Apr 2013 at 1:44
Original comment by RedEyedM...@gmail.com
on 6 May 2013 at 2:58
Original comment by TimothyCLethbridge
on 12 Sep 2013 at 3:10
Original comment by TimothyCLethbridge
on 17 Sep 2013 at 1:09
Original comment by TimothyCLethbridge
on 14 Apr 2014 at 2:20
Original issue reported on code.google.com by
TimothyCLethbridge
on 25 Jun 2011 at 2:53