Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When your model is defined as an XML Schema, you are able to specify constraints on the values of data types by adding facets to simple type restrictions. EMF knows how to interpret the restrictions and how to convert them to annotations representing Ecore constraints. You can mix these built-in schema-based constraints with your own named constraints that are defined as described in Section 18.1.
Although we haven’t highlighted them yet, we can find a couple of examples in the PrimerPO schema that we introduced in Chapter 4: