On Mar 2, 2009, at 4:09 AM, Ricardo Aráoz wrote:

> The suggested way,
> and I guess this is just a matter of personal taste, feels to me like
> over-subclassing.


        That's what I meant by the VFP mindset. Because of the way that VFP  
works, creating a subclass for a single instance is inefficient and  
should be avoided. But Python is very different, and a class is just  
another object; in fact, a class is an instance of a metaclass.

        Look at some of the self-test programs at the bottom of the files in  
the /ui/uiwx directory: most define particular subclasses of the main  
class defined in that file, and pass the class to the test program.  
Think about that in VFP terms for a second: how would you pass a class  
as a parameter? You can't, and as a result a lot of programming goes  
into implementing factory patterns in VFP that is trivial in Python.


-- Ed Leafe




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to