Changing Rules of the Game
←Older revision | Revision as of 08:08, 1 February 2018 | ||
Line 154: | Line 154: | ||
I have just find out a trick to prevent the ''victims'' mentioned in the previous paragraph. The [[OpenJDK]] is considering to change the specification of the [[Java]] [[HotSpot|virtual machine]] to allow a class with not fully resolved methods to be loaded into the runtime and work fine. Everything is supposed to work until one calls the method which is not resolvable (for example '''AppletInitializer''' class would be missing for one of '''Beans''' methods), then an exception shall be thrown. | I have just find out a trick to prevent the ''victims'' mentioned in the previous paragraph. The [[OpenJDK]] is considering to change the specification of the [[Java]] [[HotSpot|virtual machine]] to allow a class with not fully resolved methods to be loaded into the runtime and work fine. Everything is supposed to work until one calls the method which is not resolvable (for example '''AppletInitializer''' class would be missing for one of '''Beans''' methods), then an exception shall be thrown. | ||
- | Very useful trick. This shows what one can achieve when thinking without boundaries and also, when one is allowed to ''change the rules of the game''. When I did the modularization of [[NetBeans]] [[API]]s, I obviously could not change the [[HotSpot|virtual machine]] spec. I was left with only one option: I had to ''sneak simplicity'' in. I had to deprecate classes with too large | + | Very useful trick. This shows what one can achieve when thinking without boundaries and also, when one is allowed to ''change the rules of the game''. When I did the modularization of [[NetBeans]] [[API]]s, I obviously could not change the [[HotSpot|virtual machine]] spec. I was left with only one option: I had to ''sneak simplicity'' in. I had to deprecate classes with too large [[conceptual surface]] and replace them with similar classes without unneeded [[dependencies]]. This was fine in case of '''Beans''' like classes that no other [[API]] referred to (in signatures). However as this deprecation is transitive, it becomes quite hard to replace '''java.awt.Image''' - one would need to deprecate also '''java.awt.Toolkit''' and '''java.awt.Graphics''', and so on, so on transitively. It is impossible to get rid of a single method in '''java.lang.String''' using this style, obviously. |
Thus it is good there will be chance to do ''partial resolution'' of classes by the [[HotSpot|virtual machine]]. Especially when one faces a ''sneak in simplicity'' problem with too big transitive closure, this can be very helpful. On the other hand I can imagine problems with complicated (e.g. not enough [[Cluelessness|clueless]]) [[Javadoc]] that will mention ''conditional'' method and conditions when they are allow to work, etc. That is why in the '''Beans''' case, it still may be better to ''sneak the simplicity in'' and classically deprecate the old class and provide a modern replacement. | Thus it is good there will be chance to do ''partial resolution'' of classes by the [[HotSpot|virtual machine]]. Especially when one faces a ''sneak in simplicity'' problem with too big transitive closure, this can be very helpful. On the other hand I can imagine problems with complicated (e.g. not enough [[Cluelessness|clueless]]) [[Javadoc]] that will mention ''conditional'' method and conditions when they are allow to work, etc. That is why in the '''Beans''' case, it still may be better to ''sneak the simplicity in'' and classically deprecate the old class and provide a modern replacement. |