Jump to content

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

oop question

4: Adsense

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   Members   

5832
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

#22 phil67rpg   Members   

405
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.