0

I am getting started with EMF and have completed the EMF tutorial. So far I think I understood the concept. However, I have a class "League" which has a attribute "players" which is a list of Players. I can use the lower and upper bound to restrict the bounds of this list. Lets say I want a league never to have more than 18 Players. I thought setting the upper bound to 18 would do the job. But it does not. I expected the program to throw an exception or not add any more players, when I add more than 18 players.

Or did I understand the upper/lower bounds wrong?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
modmoto
  • 2,901
  • 7
  • 29
  • 54

1 Answers1

2

EMF will not throw an exception but it will report a validation error if you validate the root EObject of your model (Resource) using Diagnostician.INSTANCE.validate(yourRootEObject).

  • Thanks, that helped me look in the right direction =) Is there any option to generate code, that uses the lower/upper bounds as real bounds and then acts like i thought it might act? (Throwing exceptions or something like that) – modmoto Apr 07 '15 at 14:26