Prism - Invariants, and pre/post conditions - update

Just found out that I can do this too

public invariants
  Overdraft >= 0 : ’OverdraftGreaterThanOrEqualToZero’;
  Balance + Overdraft >= 0 : ’BalancePlusOverDraftGreaterThanOrEqualToZero’;
end;


Then in my handler routine I get that message!

if not IsValid then
  throw new Exception(ErrorMessage);


Excellent :-)

Comments

Popular posts from this blog

Connascence

Convert absolute path to relative path

Printing bitmaps using CPCL