O'Reilly logo

Object Constraint Language, The: Getting Your Models Ready for MDA, Second Edition by Anneke Kleppe, Jos Warmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix D. Example Implementation

This appendix provides an example of the implementation of OCL expressions as explained in Chapter 4. The class CustomerCard, together with all OCL expressions given as examples in this book, is implemented by the following Java code:

 package royalAndLoyal; import java.util.HashSet; import java.util.Iterator; import java.util.Set; public class CustomerCard /**************************************************************** * Attributes, and their get and set operations * ****************************************************************/ boolean valid = true; // implements initial value // definition from page 24 Date validFrom; Date goodThru; Color color; public void setValid(boolean v) { valid = v; } public boolean ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required