Well the method of the receiver can check for the type of the object from which you receive a message, technically you can restrict the access even to a particular instance object. You can enforce a ton of restrictions as the entire system is modifiable and live.
On Wed, Oct 18, 2017 at 8:37 AM Prof. Andrew P. Black <bl...@cs.pdx.edu> wrote: > > On 18 Oct 2017, at 08:32 , James Ladd <ladd.ja...@gmail.com> wrote: > > What if accessors were generated but not mutators? > > > The point is that, once a method exists, there is not way to restrict who > can send a message that will execute it. So if one were forces to generate > a reader method, or a writer method, just to give access to a subclass, > then *every* object n the system would also gain access. > > Andrew > > >