variable type that can be declared in a base class this is accessible only to classes that inherit t

D

Dan

Is there a variable type that can be declared in a base class this is accessible only to classes that inherit the base class.

For example.

In a base class we have a bunch of Read Only properties.. The ReadOnly properties are populated via private variables fthat get their data from a dataset.

In a class that inherits this baseclass we do a similar thing, except we change our load function to grab data from a different location and fill up the private variables.

In this case say we want to populate the m_sFullName string variable in the base class without exposing it. It can't be a friend because we inherit this class from many different projects.

Any ideas on a solution?


Example :


the base class
---------------------
Private m_sFullName As String

Public ReadOnly Property FullName() As String

Get

Return m_sFullName

End Get

End Property
 
K

Kevin Spencer

Protected

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

Is there a variable type that can be declared in a base class this is
accessible only to classes that inherit the base class.

For example.

In a base class we have a bunch of Read Only properties.. The ReadOnly
properties are populated via private variables fthat get their data from a
dataset.

In a class that inherits this baseclass we do a similar thing, except we
change our load function to grab data from a different location and fill up
the private variables.

In this case say we want to populate the m_sFullName string variable in the
base class without exposing it. It can't be a friend because we inherit
this class from many different projects.

Any ideas on a solution?


Example :


the base class
---------------------
Private m_sFullName As String

Public ReadOnly Property FullName() As String

Get

Return m_sFullName

End Get

End Property
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top