amichair commented on PR #98: URL: https://github.com/apache/aries-rsa/pull/98#issuecomment-4387092750
Regarding direct access to the Shared class fields: - This is a private class, so encapsulation via getters/setters is moot - it's all internal implementation details anyway, so doesn't conflict with OOP design principals. This is similar to a class accessing its own private fields directly and not via accessors, which is how the majority of classes are written in OOP (I made up that statistic, but stand by it :-) ) - This is very common even in the Java platform itself - nearly all of the collections we know and love access their inner class fields directly, along with many utilities: HashMap, TreeMap, LinkedList, Hashtable, regex.Pattern, ThreadPoolExecutor and many more (these are just the first ones that came to mind). If it's good enough for Java it's good enough for us ;-) - Adding getters+setters to all the fields would add 30-40 sloc to the class without a clear benefit - all else being equal, I would prefer less code to do the same functionality. Is any of this convincing? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
