O'Reilly logo

EMF: Eclipse Modeling Framework Second Edition by Frank Budinsky, Ed Merks, Marcelo Paternostro, Dave Steinberg

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

Chapter 18. The Validation Framework

One problem we have not yet addressed is how we can define what constitutes a valid state for objects modeled in EMF. As we will see in this chapter, you can declare, right in your model, constraints and invariants to be verified when a validation is performed against the instances of your classes. Also, we’ll detail how the code generated by EMF is affected by these new elements and how you can invoke validation either from your code or through the generated editors.

18.1 Constraints and Invariants

EMF’s notion of constraints and invariants is inspired by their definition in UML. There, a constraint is a statement that must be valid at some point in time, whereas an invariant is an assertion that should always ...

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