T
ThatsIT.net.au
I have some inheritance in my classes
I have Administrator class and a Accounts class then inherit from the Staff
class, which in turn inherits from the Person class
I have a function that finds out if the user is a administrator or in
accounts and returns the correct object, I do not know what that will be so
I can not declare the object accounts or administrator, I have to declare it
as a Person or a Staff object like
dim oUser as Person = getUser(userId)
or
dim oUser as Staff = getUser(userId)
either will work of cause, but I wondering if their was a cost, and if you
should always take the base class or as high up in inheritance as you can.
Thanks
I have Administrator class and a Accounts class then inherit from the Staff
class, which in turn inherits from the Person class
I have a function that finds out if the user is a administrator or in
accounts and returns the correct object, I do not know what that will be so
I can not declare the object accounts or administrator, I have to declare it
as a Person or a Staff object like
dim oUser as Person = getUser(userId)
or
dim oUser as Staff = getUser(userId)
either will work of cause, but I wondering if their was a cost, and if you
should always take the base class or as high up in inheritance as you can.
Thanks