G
GroZZleR
Hey all,
I have 3 classes. Let's call them Plane, Pilot and Passenger.
I'm trying to restrict Passenger's access to Plane's more intimate
methods, but allow Pilot to use 'em.
Right now I have this "useless" interface that creates basic methods,
then Plane implements that interface to add more.
For example:
PlaneInterface
- Enter()
- Exit()
Plane : PlaneInterface
- TakeOff()
- Land()
When the passenger needs to use the Plane, I downcast the object to a
PlaneInterface so that Passenger only sees the Enter and Exit methods.
Is there a better method to restricting access of certain methods to
certain classes?
I have 3 classes. Let's call them Plane, Pilot and Passenger.
I'm trying to restrict Passenger's access to Plane's more intimate
methods, but allow Pilot to use 'em.
Right now I have this "useless" interface that creates basic methods,
then Plane implements that interface to add more.
For example:
PlaneInterface
- Enter()
- Exit()
Plane : PlaneInterface
- TakeOff()
- Land()
When the passenger needs to use the Plane, I downcast the object to a
PlaneInterface so that Passenger only sees the Enter and Exit methods.
Is there a better method to restricting access of certain methods to
certain classes?