Distributing methods of a class across multiple files

Neil Cerutti neilc at norwich.edu
Wed Jan 25 10:42:29 EST 2012


On 2012-01-25, lh <lhughes42 at gmail.com> wrote:
> First, thanks for all the thoughtful replies. I am grateful.
> Second, I figured I'd get a lot of judgement about how I really
> shouldn't be doing this. Should have pre-empted it :-) oh well.
> There is a place IMHO for filename as another structuring
> element to help humans in search. Also it can be convenient to
> have two people who are working on methods for one class that
> have different directions to have different files (even if
> modern tools can handle distinct edits on the same file by
> multiple folks).

Of the three solutions Steven presented, the latter two leave
very strong coupling between the code in your separate files.
This makes working with the files independently impractical.
Stick with mixin classes and pay heed to the Law of Demeter if
you want to de-couple them enough to work on independently.

-- 
Neil Cerutti



More information about the Python-list mailing list