Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your problem is that you are trying to address the wrong problem. One of the major points of Object oriented design is <strong>robustness and flexibility</strong> in terms of how much you can change certain implementation without changing/breaking other code.</p> <p>You are trying to ask if a certain pattern is ideal or not? But the problem is: what is "Ideal" ? I'll will quote from Scot Meyers article <a href="http://www.drdobbs.com/cpp/how-non-member-functions-improve-encapsu/184401197" rel="nofollow">How Non-Member Functions Improve Encapsulation: When it comes to encapsulation, sometimes less is more.</a> This article is about C++, but the concepts he was trying to conduct applies regardless of the language.</p> <blockquote> <p>Encapsulation is a means, not an end. There's nothing inherently desirable about encapsulation. Encapsulation is useful only because it yields other things in our software that we care about. In particular, it yields flexibility and robustness.</p> </blockquote> <p>The question that you should be asking is: </p> <blockquote> <p>how much code might be broken is to count the functions that might be affected. That is, if changing one implementation leads to more potentially broken functions than does changing another implementation.</p> </blockquote> <p>Regarding your example it is not particularly easy for someone else to tell you what is ideal. Should you expose <code>ITexture</code> interface? should you introduce a new interface called <code>IDrawable</code> that the Texture extends ? The current approach is ok. But I don't actually know, because I don't know the implementation! maybe everything will break if you changed the texture implementation! **This is a question only you are able to answer while taking into account the points I mentioned above:</p> <ul> <li>How much code need to be changed or will break if you changed the ITexture implementation ?</li> <li>Is the current implementation robust enough.</li> <li>How much can you extend the system with the current implementation ?</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload