title: OCL - Need some clarification on Invariants?
body: <p>I had a discussion with a professor today on OCL. He believes invariants, post-conditions, and pre-conditions are allowed within the defined contexts of functions.</p>
  
  <p>The software developer in me leads me to want to believe OCL would allow general constraints to be placed on the model. Constraints like All objects of class Person in this model have a sex of male, or all objects of class car have four wheels seem incredible useful and using a declarative paradigm against my model feels right.</p>
  
  <p>I kind of view it like the physical world. If we screw a nut on a bolt the nut is allowed to fit on in one way. These are physical constraints that hold no matter what action we take like screwing the nut on the bolt, and cannot be violated or we have invalidated our model in a fundamental way. </p>
  
  <p>His view is that in OCL we can only define constraints (pre and post conditions/invariants) within functions that are provided a context.</p>
  
  <p>Can someone clear this up for me?</p>