[Tutor] Would an OOP approach be simpler?

Liam Clarke cyresse at gmail.com
Mon Oct 18 11:22:22 CEST 2004


Hi all, 

This module (code below), is comprised of functions, which are run by
a main function, which just passes bits of data around.

http://rafb.net/paste/results/mpCxox91.html

Still trying to 'reconfigure my brain' (as several OOP tutorials put
it), to understand
the 'OOP paradigm' as nearly every OOP site puts it. At the very
least, repartition my brain and install an OOP OS in a separate
section. : )

My module is pretty much going to do one thing (get emails, and dump
their attachments in a directory for another module to extract info,
which will pass the info to another module which will generate a csv
of the extracted data, and email it again, all feeding back at
appropriate times to a small GUI), and all the bits of data being
flung from function to function (in quite a linear sequence), will be
self-contained within that module.

I can see two functions which may be used by other modules, but the
values they use won't change, they'll just hand them to different
functions to play with (i.e the load cfg module will load the config
file, and pass the information to a function which allows the user to
change the config, and the second function will then save the config)

I really need a situation that screams 'objects are the only way' to
work on to comprehend why OOP = good I think. The OOP tutorials I've
found tend to be OOP for the sake of OOP...

Thoughts appreciated. (And there are several errors in the posted
code, like my except clause when trying to login, but that's because I
haven't gotten around to that yet. And some are typos. : )  )


More information about the Tutor mailing list