| View previous topic :: View next topic |
| Author |
Message |
amoralis
Joined: 22 Jun 2006 Posts: 21
|
| martinar_kauaro, why is it bad? |
| |
|
|
|
|
Gladis
Joined: 24 May 2006 Posts: 108
|
| martinar_kauaro, It does what we want it to do. how is that bad? |
| |
|
|
Aaron Zapashniy
Joined: 04 Jun 2006 Posts: 17 Location: Hungary
|
| I'd think it'd basically just say "hey compiler, make sure whatever i throw at this method contains Parents in one form or another" |
| |
|
|
martinar_kauaro
Joined: 18 Jun 2006 Posts: 4
|
| amoralis, Because you're again killing the typesafety. I've seen quite some code snippets that relied on generics to find "wrong object type inserted" exceptions. |
| |
|
|
amoralis
Joined: 22 Jun 2006 Posts: 21
|
martinar_kauaro, no you're not
you should be able to pass in a child class |
| |
|
|
Aaron Zapashniy
Joined: 04 Jun 2006 Posts: 17 Location: Hungary
|
If the method in question operates on the param as Parent, what harm could there be?
It'd provide exactly the level of type safety i desire.
(but WOW is that ugly and verbose syntax..) |
| |
|
|
Gladis
Joined: 24 May 2006 Posts: 108
|
| Aaron Zapashniy, Well, Java as a whole is ugly and verbose syntax. |
| |
|
|
Aaron Zapashniy
Joined: 04 Jun 2006 Posts: 17 Location: Hungary
|
Ah well. i guess i'll just declare my collections with <Parent>.
Thanks fellas.  |
| |
|
|
|