Using dot To Access Object Attribute and Proper abstraction

Posted by cobie on Programmers See other posts from Programmers or by cobie
Published on 2012-10-31T10:42:05Z Indexed on 2012/10/31 11:13 UTC
Read the original article Hit count: 303

I have been programming in python and java for quite a number of years and one thing i find myself doing is using the setters and getters from java in python but a number of blogs seem to think using the dot notation for access is the pythonic way. What I would like to know is if using dot to access methods does not violate abstraction principle. If for example I implement an attribute as a single object and use dot notation to access, if I wanted to change the code later so that the attribute is represented by a list of objects, that would require quite some heavy lifting which violates abstraction principle.

© Programmers or respective owner

Related posts about java

Related posts about object-oriented