CSC/ECE 517 Fall 2011/ch1 2b qu: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
= Access Control in o-o Languages =
== Access Control in o-o Languages ==
<i> O-o languages have different approaches to controlling access to variables and methods.  Ruby, for example, doesn't allow an object to access the private features of another object, even if the other object is an instance of the same class.  Java 1.0 had a "private protected" access specifier that allowed subclasses to access a variable, but not non-subclasses in the same package.  It was dropped, probably because it was confusing.  Have philosophies about allowing access become more restrictive over the years, as accessor methods have become more prominent?</i>
<i> O-o languages have different approaches to controlling access to variables and methods.  Ruby, for example, doesn't allow an object to access the private features of another object, even if the other object is an instance of the same class.  Java 1.0 had a "private protected" access specifier that allowed subclasses to access a variable, but not non-subclasses in the same package.  It was dropped, probably because it was confusing.  Have philosophies about allowing access become more restrictive over the years, as accessor methods have become more prominent?</i>


= Introduction =
== Introduction ==
= Why Access Control? =
== Why Access Control? ==
= Access control in different o-o languages =
== Access control in different o-o languages ==
===<b>C++</b>===
===<b>C++</b>===
===<b>JAVA</b>===
===<b>JAVA</b>===
Line 10: Line 10:
===<b>Eiffel</b>===
===<b>Eiffel</b>===
===<b>Ruby</b>===
===<b>Ruby</b>===
= What are accessor methods? =
== What are accessor methods? ==
= Accessor methods in different o-o languages =
== Accessor methods in different o-o languages ==
===<b>C++</b>===
===<b>C++</b>===
===<b>JAVA</b>===
===<b>JAVA</b>===
Line 17: Line 17:
===<b>Eiffel</b>===
===<b>Eiffel</b>===
===<b>Ruby</b>===
===<b>Ruby</b>===
= How has access control changed in the recent years? =
== How has access control changed in the recent years? ==
= Conclusion =
== Conclusion ==
= References =
== References ==

Revision as of 14:16, 17 September 2011

Access Control in o-o Languages

O-o languages have different approaches to controlling access to variables and methods. Ruby, for example, doesn't allow an object to access the private features of another object, even if the other object is an instance of the same class. Java 1.0 had a "private protected" access specifier that allowed subclasses to access a variable, but not non-subclasses in the same package. It was dropped, probably because it was confusing. Have philosophies about allowing access become more restrictive over the years, as accessor methods have become more prominent?

Introduction

Why Access Control?

Access control in different o-o languages

C++

JAVA

Smalltalk

Eiffel

Ruby

What are accessor methods?

Accessor methods in different o-o languages

C++

JAVA

Smalltalk

Eiffel

Ruby

How has access control changed in the recent years?

Conclusion

References