Jump to content

  • Log In with Google      Sign In   
  • Create Account

oop question


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
21 replies to this topic

#21 Paradigm Shifter   Crossbones+   -  Reputation: 5442

Like
0Likes
Like

Posted 28 October 2013 - 12:48 PM

Well the public interface should maintain the invariant of the class. Non-public methods can do what they like though since they are only used to implement the public interface.

 

If you must break an invariant you probably want a class that wraps the badly behaved class. (e.g. say we have a requirement you need to call BeginFrame before Draw calls and EndFrame afterwards, you would probably assert in debug mode that the calls are made in the correct order and then wrap the whole lot in a SceneRender class). Simple example off the top of my head...


Edited by Paradigm Shifter, 28 October 2013 - 12:49 PM.

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

Sponsor:

#22 phil67rpg   Members   -  Reputation: 767

Like
0Likes
Like

Posted 28 October 2013 - 03:18 PM

wow what a response, thanks for all the input.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS