[Tutor] Help with Object Oriented Programming

Knacktus knacktus at googlemail.com
Mon Aug 30 20:43:20 CEST 2010


Am 30.08.2010 20:13, schrieb Tino Dai:
> Hi Everybody,
>
>         I'm beefing up my Object-Oriented Analysis and Design - getting
> the gaps in my
> knowledge filled in through the Head First OOAD book
> (http://headfirstlabs.com/books/hfooad/).
>   That book focuses on Java - is there a comparable book for Python? I
> have already read the
> Alan Gauld's intro on classes, but I'm looking for more. My goal is to
> be able to design
> and code in Python in an OO fashion exploiting the OO paradigm as it related to
> Python at the level of  Kent Johnston (hey, if I'm going to dream,
> might as well dream big! :)  ).
> Currently, some of the things such as inheritance and encapsulation
> apply across OO languages
> but interfaces (I know that Zope has this) and mixin's are language
> specific constructs.
> If anybody could point me in the right direction, that would be great!
>
> TIA,
> Tino
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
Hi Tino,

I've started in a very simliar fashion. My first OO-app was a procedural 
Fortran-style Java application ;-)
Then I stumbled over Python but was aware that I had no clue about 
OO-Programming. I read the book Head First OOAD, too. And also stuff 
about design patterns.
At the beginning, it's a bit confusing. There's a lot of overhead 
involved due to Java's static typing. You have to use inheritance, 
interfaces, abstract classes etc. to achieve certain things, e.g. make 
code general ("develop for interface not implementation ...") With 
Python the same things can be achieved a loooooot easier and in the end 
clearer (at least to me). One example are the iterator and visitor 
patterns. Those can be done so smoothly in Python thanks to "everything 
is a first class object". It would be fatal to try to translate Java 
Code from the DP book to python.
Overall, Java OO and DP are helpful to know and understanding the ideas 
behind them will help you with Python. But things are done differently 
with Pyhton (don't try to mimick Java!) and you will be very very happy 
about that.


More information about the Tutor mailing list