Search |
||
JSR #277 Follow UpPosted by patrikbeno on December 7, 2006 at 4:13 PM PST
Hi Stanley, I would like to share my opinions on Java module system granularity as well as Java scoping system which (I think) may be helpful to you (JSR#277) or JSR#294 expert group... My humble opinion is that
This is the primary idea, main pont of my email: Do not try to solve resource export/imports. Just stick to module granularity level and leave resource protection to JSR#294 or similar initiative Anything I will write below should be just a reference to JSR 277 because I think it's following problem is not responsibility of #277. If anyone, JSR #294 is closest responsible candidate to resolve this... However, I believe these ideas/suggestions are closely related to what #277 is trying to achieve, although not directly specified or implemented by the #277 spec... But I believe this allows you to reject the explicit (or even implict) export filters as proposed by JSR277 draft... I hope you could evaluate this and possibly forward these ideas to the #294 crew for further review... So, to provide some details in addition to these plain statements: Now that we have annotations, I would deprecate public|protected|private keywords and I would suggest to replace them with new annotations with new better semantics (which also covers the need of new Java Module System). public|protected|private|(default) as we know them are all wrong:
I think we should deprecated these keywords and do it all again
PROPOSED MODEL: @java.lang.Public - public scoping, default!! most widely used... people usualy know better when the want to protect something. on the other hand, when you are not sure, just leave it open and accessible, you will not break anything nor you will prohibit extensibility... this corrresponds with my proposal to use implicit permit / explicit deny policy instead of implicit deny / explit permit @java.lang.Protected - class hierarchy only (declaring class and descendants, no package); the missing piece in current model @java.lang.Package - package protected (currently 'default') @java.lang.Private - declaring class only @java.lang.Module - JSR277 module scoping All these permissions are restrictive and can be combined, e.g:
There are of course some combinations that do not make any sense but they do not hurt or break anything:
As you see, I hope, all your requirements for module contents protection can be satisfied with single @Module scoping restrictive annotation :-) The important conslusion is: Whether this behaviour will be standardized as part of #294 or some other initiative, the JSR#277 spec should not deal with it. Just leave it to be defined by other spec which redesigns Java scoping model. Just stick to the module as the working entity. Hope you find these thought helpful :-) --
»
Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|