oo problem

Nils Oliver Kröger NO_Kroeger at gmx.de
Sun Dec 10 14:45:42 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tool69 wrote:
> It was a matter of choice : in my earlier version, all primitives know
> how to draw themselves, but they needed to have a parent and I found it
> was not good for aesthetic reasons.

Why should a parent reference not be aesthetic? OOD is all about Objects
and their relationships.


> I want now to draw an x-axis on it with some ticks and maybe lables, I
> need to catch the xlowleft and xupright variables of the Paper inside
> my primitive, ok ?

This sentence describes the relationship between the paper and your
Rectangle (to stick to your first example) as an association:

The Rectangle needs to access information from the Paper. Moreover, the
relationship could be named "Rectangle lies on Paper" this is perfect
OOD in my opinion.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFfGPmRQeuB6ws8wERAgBgAKCiNlNU5vuVmUQQWy/Trqv2/hfd2gCg39Sh
WC2+yoWA+lpJ4PNQ1sfiFTU=
=UIww
-----END PGP SIGNATURE-----



More information about the Python-list mailing list