[EMAIL PROTECTED] wrote:
> If I want to save all addresses to disk, I can have a method, say,
> save() of AddressBook. But then what? What is a good object oriented
> approach? Should each Address object take care of saving itself to the
> file, with a method like writetofile(filename), or should the class
> AddressBook take care of the saving and ask each object for its data?

The OO religion likes to provide a big ego to objects. And be aware! All these 
egos then want to itch the programmer with question marks for years! And there 
are programming languages which draw more attention to what some unsolicited 
objects want, than to what the programmer wants. Python is not so.

Remember, you are the boss. You say: "I want to save all addresses to disk". 
I'd say: Just dump them to disk unless you feel a functional need in order to 
make it more indirect. 


Robert
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to