Re: subclassing and generics



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

Henry Townsend schreef:
Dale King wrote:
While it is cleaner it is probably more work for the OP because he
would have to implement a bunch of Map methods and have them delegate
to the contained map. Judging by the OP's skill level I wasn't ready
to bite off that additional bit of instruction.

While comments on my skill level are probably correct, it may be worth
pointing out that much of my code uses delegation as well. My tendency
(I hesitate to say "philosophy" because I'm not that experienced) is to
start out with inheritance while roughing out the design precisely
because it doesn't require generating lots of delegation methods, then
doing a refactoring exercise and converting to delegation as appropriate
when things are more stable. At which point I can just remove the
"extends" clause and Eclipse is happy to point out (with error messages)
the exact set of delegation methods required. The alternative is to
generate a bunch of delegators up front, which again Eclipse is happy to
help me with, but I've gone that route before and find myself spending a
lot of time adding and subtracting methods as the design changes[*]. Is
this such a bad plan?

I agree that goes in the right direction, but really, if I think of it I
have never needed to extend a java base class. Most of the time, you
only need two or three methods, in which case the delegation is not much
of a problem.

[*] Of course you could go to the next step and say that coding
shouldn't start till the design is more stable, but this is a personal
project I'm working on in my spare time and I don't have time for the
waterfall method.

I won’t start commenting on such things until I have had the discipline
myself to follow it...

H.
- --
Hendrik Maryns

==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEfboxe+7xMGD3itQRArHrAJkBQZyqoT9mY5fkSAp7oXFvwZIolQCfQRST
bEZlMowgeZTz+Nps17vpWio=
=lcyi
-----END PGP SIGNATURE-----
.