Design by Contract

Design by Contract was propounded by Bertrand Meyer at program language Eiffel. It is an advanced assert which a programmer can write the condition on functions and the methods. The contract consists of the following conditions:

  • Pre-conditions.
  • Post-conditions.
  • Consistency checks.

If a case does not meet these conditions, an exception is thrown. A developer can find problems of the program easily by an exception. And he always keeps cool because he can write down the code’s spec on the source code.

“Design by Contract” is tried in many program languages. We can use it in C++? We can implement Pre-conditions with assert(). Post-conditions and Consistency checks are difficult in C++. We can get many sample codes from the internet because many programers try it in C++.

This entry was posted in Game Programing and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s