ui factory - what should it do?
Aaron Bentley
aaron.bentley at utoronto.ca
Wed Feb 22 16:43:08 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> In that particular case it's clearly working for only the duration of
> __init__. (Which is perhaps not an ideal idiom; other job-type classes
> have an explicit "do it" method, and perhaps we should standardize
> that.)
While it's a bit weird the first time you see it, it seems quite a handy
way of doing it, and it's the way I did the TreeTransform mergers (e.g.
Merge3Merger).
Because if I were to convert fetcher to have a do-it method, I'd put the
entire body of the __init__ method there. And then I'd have to restore
the members to safe values afterward, so no unsafe member functions
could be called.
There is definitely a need for an idiom represent a procedure with
multiple phases and shared data, where that shared data becomes obsolete
at the end of the procedure, and this way didn't seem so bad, on reflection.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFD/JSc0F+nu1YWqI0RAvjWAJ91CeN5uaf2C/tFgtFMOxRR4BeQqQCfWK6e
laTPku35ZZS9PlMzXLzyJc0=
=z2Ez
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list