I thought "instanceof" was expensive, but I just wrote a performance test that suggests it's not.Wonder if something is being optimised out?
-
-
-
Replying to @mjpt777
@mjpt777@trisha_gee Very cheap vs design smell... Bugger, coin toss? :)2 replies 0 retweets 0 likes -
-
Replying to @mjpt777
@mjpt777@trisha_gee Very true. Harder with 'design smells' though, always good to get a 2nd, 3rd opinion when unsure...2 replies 0 retweets 0 likes -
Replying to @darachennis
@darachennis@mjpt777 (a series of these classes replaces a God class with a series of "if"s and switches)2 replies 0 retweets 0 likes -
Replying to @trisha_gee
@trisha_gee@darachennis Why not user polymorphism?2 replies 0 retweets 0 likes -
Replying to @mjpt777
@mjpt777@darachennis Good question. With the current design I can't, but maybe I need to make more radical changes to the current design1 reply 0 retweets 0 likes -
Replying to @trisha_gee
@trisha_gee@mjpt777@darachennis "A series of ifs and switches" on instanceof /is/ polymorphism! So you're most of the way there.1 reply 0 retweets 0 likes -
Replying to @tastapod
@tastapod@trisha_gee@darachennis switch is a jump table if ordered2 replies 0 retweets 0 likes
@mjpt777 @tastapod @trisha_gee Sounds like an 'if (o instanceof Externable)' use case? I could see myself instanceof'ing there ...
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.