Simplifying Access Controls
After getting rid of 'static' members, I am currently watching for other C++/Java legacies that I could get rid of. And I found access controls. Until today, Eek used a C++ label syntax with C++'s 'private/protected/public' modes and additionally 'protected api' and 'public api'. The new modes were needed to make a member accessible to other
assemblies. This became much too complicated, but because I think that the 'api' modes are important, I decided to drop the rarely used 'protected' modes. 'protected' can be useful sometimes, but most of the time it is just bad API design that tries to combine extensibility and real functionality into a single interface. The remaining modes were 'private', 'public' and 'api'. Because 'public' was already default, I switched from a C++ label system to a Java modifier system and got rid of 'public' as well. A member without a modifier is 'public', and the remaining access control modifiers are 'private' and 'api'.
written at 18:47. (0 Comments, Permalink)