[Tutor] The python implementation of the "class relationship".
Alan Gauld
alan.gauld at btinternet.com
Fri Nov 11 09:58:23 CET 2011
On 11/11/11 02:39, Jerry Zhang wrote:
> Composition implementation: you may need to do 5 job with C++, but only
> 2 job with python, the other 3 job is done by python implicitly.
> association implementation: You need 3 job with C++, but 1 with python.
> it seems python's object's lifecycle handling has reached this level,
> all you should do is just "associating and de-association".
I have no idea what you mean by that.
What kind of "job" are you talking about?
> Code_Zero. 1 job(by you) + 4(by python) does NOT work.
> Code_one. 2 job(by you) + 3(by python) works. That is the best one.
> Code_two. 3 job( by you) + 2 (by python) works too,
> Code_three. 4 job(by you) + 1(by python) works too.
>
> Since i am not familiar with python yet, my code most likely would gets
> into Code_two or Code_three(Code_Zero is also possible for new guys like
> me), though they also work, they are bad code.
Again, I don't understand your references to Code_one, Code_two etc?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list