Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The beauty of Python is that it supports many different programming paradigms in a very seamless way. Don't worry so much about doing everything in OOP, use the right tool for the job. Not everything is a nail so don't limit yourself to just a hammer.</p> <p>Having said that, if you are just wanting an exercise in OOP, look for patterns. For instance, a Strategy Pattern might be a good solution for your multiple sources of information. I highly recommend the <a href="http://en.wikipedia.org/wiki/Design_Patterns" rel="nofollow">GoF Patterns book</a> to anyone wanting to get a better handle on OOP. It should be required reading IMHO for anyone wanting to move beyond basic programming.</p> <p>For discovering objects, the classic approach is to start looking for nouns in your problem space and make those your objects: movie, feed, imdb, tmdb. Then you start thinking about what attributes and functionality should be associated with each object (adjectives and verbs if you want to continue the analogy). When you start seeing common functionality, like you should with imdb and tmdb, then you might consider a common base class: mdb. The next step is to look at relationships between objects. I'm a visual person so I always make a <a href="http://www.agilemodeling.com/artifacts/classDiagram.htm" rel="nofollow">Class Diagram</a> to help me understand relationships. Read up on <a href="http://en.wikipedia.org/wiki/Class-responsibility-collaboration_card" rel="nofollow">CRC Cards</a> and <a href="http://en.wikipedia.org/wiki/Responsibility-Driven_Design" rel="nofollow">Responsibility-Driven Design</a> for more details on this technique.</p> <p>If you have some basic working knowledge of the common patterns, how they work and where they apply, you will start to notice patterns in your objects. If not, this technique will still help you build useful OO systems. The risk is that you might be reinventing the wheel or your might miss something that could save you a lot of time later.</p>
 

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