Break OO privacy: Difference between revisions
Content added Content deleted
m (→Child Packages) |
|||
Line 116: | Line 116: | ||
Another way to bypass privacy is using a child package. Ada child packages have access to their parents' private data structures (somewhat similar to "friends" in C++"): |
Another way to bypass privacy is using a child package. Ada child packages have access to their parents' private data structures (somewhat similar to "friends" in C++"): |
||
<lang Ada>package OO_Privacy.Friend is -- |
<lang Ada>package OO_Privacy.Friend is -- child package of OO.Privacy |
||
function Get_Password(Secret: Confidential_Stuff) return String; |
function Get_Password(Secret: Confidential_Stuff) return String; |