What is your downgrade prospect? Is it ALWAYS wrong, or are there cases where it is acceptable, or even more preferable or desirable?
Is there any good measure / recommendation we can give that tells us when the demotion is “evil” and when it is “good” / “good”?
(I know a similar question exists , but this question arises from a specific case. I would like him to answer from a general point of view.)
No, this is definitely not always wrong.
, , # - sender, . , , . sender Button .
sender
Button
- . API, - , . , Dictionary<Type, object>, , . - , , .
Dictionary<Type, object>
, , - . , . API- Pre-Generics ( ), , downcasting . , , , , downcast - .
"" Java pre 5.0, . . : , , . Java 5.