HOWTO: Map interface declaration to a base class method? - TIA

  • Thread starter Thread starter Ray Dukes
  • Start date Start date
R

Ray Dukes

What I am looking to do is map the implementation of interface
properties and functions to an inherited method of the base class.

Please see below.

'****************************************************************************
' Issues
'****************************************************************************


Note:
1. The abstract class (BaseRemoteDataObject) wants the derived
classes to use it's ConnectString and DataRow properties'
implementation, but requires the data manipulation methods to be
overridden.

2. The interface that the clients will use (IPerson) allows
access to the DataRow, but not the ConnectString. It also edxposes
the data manipulation methods.

3. The public interface for the implementation class (Person)
only allows Write access to the ConnectString (which IPerson doesn't
recognize)

QUESTION: How do I map IPerson.DataRow() to
BaseRemoteDataObject.DataRow through class Person.

In other words, I want BaseRemoteDataObject.DataRow to fulfill the
IPerson.DataRow requirement in Person.DataRow.

Do I have to provide a pass through implementation for each
method/property to mybase.property?
Public Property DataRow() As System.Data.DataRow Implements
IPerson.DataRow
Get
return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

Am I making sense to anyone? TIA


'****************************************************************************
' Sample Code
'****************************************************************************


MY ABSTRACT CLASS
Public MustInherit Class BaseRemoteDataObject
Inherits BaseRemoteObject
Protected mstrConnectString As String
Protected mDataRow As System.Data.DataRow

Public Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property
Public Property ConnectString() As String
Get
Return mstrConnectString
End Get
Set(ByVal Value As String)
mstrConnectString = Value
End Set
End Property

Public MustOverride Function CancelChanges() As Boolean
Public MustOverride Function Clear() As Boolean
Public MustOverride Function Retrieve(ByVal ID As Integer) As
Integer
Public MustOverride Function Save() As Integer
End Class


MY INTERFACE
Public Interface IPerson
Event HasChanged(ByVal DataHasChanged As Boolean)

ReadOnly Property ID() As Int32
Property FirstName() As String
Property LastName() As String
ReadOnly Property IsChanged() As Boolean
Property DataRow() As DataRow

Function Retrieve(ByVal ID As Int32) As Int32
Function Save() As Int32
Function Clear() As Boolean
Function CancelChanges() As Boolean
End Interface

MY IMPLEMENTATION
Public Class Person
Inherits BaseRemoteDataObject
Implements IPerson
Public Event HasChanged(ByVal DataHasChanged As Boolean)
Implements IPerson.HasChanged

'Original Property Values
Protected p_strFirstname As String
Protected p_strLastname As String
Protected p_intID As Int32

'Current Property Values
Protected strFirstname As String
Protected strLastname As String
Protected intID As Int32

Protected blnChanged As Boolean

Public Shadows WriteOnly Property ConnectString() As String
Set(ByVal Value As String)
MyBase.mstrConnectString = Value
End Set
End Property

<< Most Code Omitted>>

End Class
 
Hi Ray,

Please modifiy the DataRow Property in the ABSTRACT CLASS and MY
IMPLEMENTATION as follows.

'MY ABSTRACT CLASS
Public Overridable Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

'MY IMPLEMENTATION
Public Overrides Property DataRow() As DataRow Implements
IPerson.DataRow
Get
DataRow = MyBase.DataRow
End Get
Set(ByVal Value As DataRow)
MyBase.DataRow = Value
End Set
End Property

The Overrides keyword will inherit the DataRow property from the
BaseRemoteDataObject class and it will implements IPerson.DataRow.

Did I misunderstand your meaning?
If you have any further related question, please feel free to let me know.


Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Ray Dukes <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: HOWTO: Map interface declaration to a base class method? - TIA
Message-ID: <[email protected]>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 127
NNTP-Posting-Host: 64.57.103.130
X-Complaints-To: (e-mail address removed)
X-Trace: newssvr25.news.prodigy.com 1062538299 ST000 64.57.103.130 (Tue, 02 Sep 2003 17:31:39 EDT)
NNTP-Posting-Date: Tue, 02 Sep 2003 17:31:39 EDT
Organization: SBC http://yahoo.sbc.com
X-UserInfo1: Q[R_PJONGBWYR_LXIRHFJFTBTR\B@GXLN@GZ_GYO^ZWZUYICD^RAQBKZQTZTX\_I[^G_KGFNON[Z
OE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MNMG_
Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM
Date: Tue, 02 Sep 2003 21:31:39 GMT
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!npeer.de.kpn-eurorings.net!in.100proofnews.com!in.100proofnews.com!prod
igy.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.p
rodigy.com!newssvr25.news.prodigy.com.POSTED!fbab4d1e!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:133630
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

What I am looking to do is map the implementation of interface
properties and functions to an inherited method of the base class.

Please see below.

'************************************************************************** **
' Issues
'**************************************************************************
**


Note:
1. The abstract class (BaseRemoteDataObject) wants the derived
classes to use it's ConnectString and DataRow properties'
implementation, but requires the data manipulation methods to be
overridden.

2. The interface that the clients will use (IPerson) allows
access to the DataRow, but not the ConnectString. It also edxposes
the data manipulation methods.

3. The public interface for the implementation class (Person)
only allows Write access to the ConnectString (which IPerson doesn't
recognize)

QUESTION: How do I map IPerson.DataRow() to
BaseRemoteDataObject.DataRow through class Person.

In other words, I want BaseRemoteDataObject.DataRow to fulfill the
IPerson.DataRow requirement in Person.DataRow.

Do I have to provide a pass through implementation for each
method/property to mybase.property?
Public Property DataRow() As System.Data.DataRow Implements
IPerson.DataRow
Get
return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

Am I making sense to anyone? TIA


'************************************************************************** **
' Sample Code
'************************************************************************** **


MY ABSTRACT CLASS
Public MustInherit Class BaseRemoteDataObject
Inherits BaseRemoteObject
Protected mstrConnectString As String
Protected mDataRow As System.Data.DataRow

Public Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property
Public Property ConnectString() As String
Get
Return mstrConnectString
End Get
Set(ByVal Value As String)
mstrConnectString = Value
End Set
End Property

Public MustOverride Function CancelChanges() As Boolean
Public MustOverride Function Clear() As Boolean
Public MustOverride Function Retrieve(ByVal ID As Integer) As
Integer
Public MustOverride Function Save() As Integer
End Class


MY INTERFACE
Public Interface IPerson
Event HasChanged(ByVal DataHasChanged As Boolean)

ReadOnly Property ID() As Int32
Property FirstName() As String
Property LastName() As String
ReadOnly Property IsChanged() As Boolean
Property DataRow() As DataRow

Function Retrieve(ByVal ID As Int32) As Int32
Function Save() As Int32
Function Clear() As Boolean
Function CancelChanges() As Boolean
End Interface

MY IMPLEMENTATION
Public Class Person
Inherits BaseRemoteDataObject
Implements IPerson
Public Event HasChanged(ByVal DataHasChanged As Boolean)
Implements IPerson.HasChanged

'Original Property Values
Protected p_strFirstname As String
Protected p_strLastname As String
Protected p_intID As Int32

'Current Property Values
Protected strFirstname As String
Protected strLastname As String
Protected intID As Int32

Protected blnChanged As Boolean

Public Shadows WriteOnly Property ConnectString() As String
Set(ByVal Value As String)
MyBase.mstrConnectString = Value
End Set
End Property

<< Most Code Omitted>>

End Class
 
My question is this:
When implementing an interface in a derived class, is there a way to
map the interface method definition (Implements IPerson.DataRow)
directly to the INHERITED function call, without having to provide an
implementation in the derived class.

In other words, I want to map IPerson.DataRow to
BaseRemoteDataObject.DataRow WITHOUT overriding with a new
implementation in the Person class. I want the interface to use the
inherited behavior, not redefine the behavior.

(I've seen nothing in the documentation that indicates that this is
possible.)

Thanks very much for responding.

Ray Dukes

Hi Ray,

Please modifiy the DataRow Property in the ABSTRACT CLASS and MY
IMPLEMENTATION as follows.

'MY ABSTRACT CLASS
Public Overridable Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

'MY IMPLEMENTATION
Public Overrides Property DataRow() As DataRow Implements
IPerson.DataRow
Get
DataRow = MyBase.DataRow
End Get
Set(ByVal Value As DataRow)
MyBase.DataRow = Value
End Set
End Property

The Overrides keyword will inherit the DataRow property from the
BaseRemoteDataObject class and it will implements IPerson.DataRow.

Did I misunderstand your meaning?
If you have any further related question, please feel free to let me know.


Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Ray Dukes <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: HOWTO: Map interface declaration to a base class method? - TIA
Message-ID: <[email protected]>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 127
NNTP-Posting-Host: 64.57.103.130
X-Complaints-To: (e-mail address removed)
X-Trace: newssvr25.news.prodigy.com 1062538299 ST000 64.57.103.130 (Tue, 02 Sep 2003 17:31:39 EDT)
NNTP-Posting-Date: Tue, 02 Sep 2003 17:31:39 EDT
Organization: SBC http://yahoo.sbc.com
X-UserInfo1: Q[R_PJONGBWYR_LXIRHFJFTBTR\B@GXLN@GZ_GYO^ZWZUYICD^RAQBKZQTZTX\_I[^G_KGFNON[Z
OE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MNMG_
Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM
Date: Tue, 02 Sep 2003 21:31:39 GMT
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!npeer.de.kpn-eurorings.net!in.100proofnews.com!in.100proofnews.com!prod
igy.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.p
rodigy.com!newssvr25.news.prodigy.com.POSTED!fbab4d1e!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:133630
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

What I am looking to do is map the implementation of interface
properties and functions to an inherited method of the base class.

Please see below.

'************************************************************************** **
' Issues
'**************************************************************************
**


Note:
1. The abstract class (BaseRemoteDataObject) wants the derived
classes to use it's ConnectString and DataRow properties'
implementation, but requires the data manipulation methods to be
overridden.

2. The interface that the clients will use (IPerson) allows
access to the DataRow, but not the ConnectString. It also edxposes
the data manipulation methods.

3. The public interface for the implementation class (Person)
only allows Write access to the ConnectString (which IPerson doesn't
recognize)

QUESTION: How do I map IPerson.DataRow() to
BaseRemoteDataObject.DataRow through class Person.

In other words, I want BaseRemoteDataObject.DataRow to fulfill the
IPerson.DataRow requirement in Person.DataRow.

Do I have to provide a pass through implementation for each
method/property to mybase.property?
Public Property DataRow() As System.Data.DataRow Implements
IPerson.DataRow
Get
return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

Am I making sense to anyone? TIA


'************************************************************************** **
' Sample Code
'************************************************************************** **


MY ABSTRACT CLASS
Public MustInherit Class BaseRemoteDataObject
Inherits BaseRemoteObject
Protected mstrConnectString As String
Protected mDataRow As System.Data.DataRow

Public Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property
Public Property ConnectString() As String
Get
Return mstrConnectString
End Get
Set(ByVal Value As String)
mstrConnectString = Value
End Set
End Property

Public MustOverride Function CancelChanges() As Boolean
Public MustOverride Function Clear() As Boolean
Public MustOverride Function Retrieve(ByVal ID As Integer) As
Integer
Public MustOverride Function Save() As Integer
End Class


MY INTERFACE
Public Interface IPerson
Event HasChanged(ByVal DataHasChanged As Boolean)

ReadOnly Property ID() As Int32
Property FirstName() As String
Property LastName() As String
ReadOnly Property IsChanged() As Boolean
Property DataRow() As DataRow

Function Retrieve(ByVal ID As Int32) As Int32
Function Save() As Int32
Function Clear() As Boolean
Function CancelChanges() As Boolean
End Interface

MY IMPLEMENTATION
Public Class Person
Inherits BaseRemoteDataObject
Implements IPerson
Public Event HasChanged(ByVal DataHasChanged As Boolean)
Implements IPerson.HasChanged

'Original Property Values
Protected p_strFirstname As String
Protected p_strLastname As String
Protected p_intID As Int32

'Current Property Values
Protected strFirstname As String
Protected strLastname As String
Protected intID As Int32

Protected blnChanged As Boolean

Public Shadows WriteOnly Property ConnectString() As String
Set(ByVal Value As String)
MyBase.mstrConnectString = Value
End Set
End Property

<< Most Code Omitted>>

End Class
 
Hi Ray,

I will do some research and update you with new information ASAP.

Have a nice day.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Ray Dukes <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: Re: HOWTO: Map interface declaration to a base class method? - TIA
Message-ID: <[email protected]>
References: <[email protected]>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 221
NNTP-Posting-Host: 64.57.103.130
X-Complaints-To: (e-mail address removed)
X-Trace: newssvr25.news.prodigy.com 1062601764 ST000 64.57.103.130 (Wed, 03 Sep 2003 11:09:24 EDT)
NNTP-Posting-Date: Wed, 03 Sep 2003 11:09:24 EDT
Organization: SBC http://yahoo.sbc.com
X-UserInfo1: OX][R\KG\ZWOR^I]^JKBOW@@YJ_ZTB\MV@BZMVMHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_D
_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW_
F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM
Date: Wed, 03 Sep 2003 15:09:24 GMT
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!skynet.be!skynet.be!newsgate.cistron.nl!amsnews01.chello.com!in.100proo
fnews.com!in.100proofnews.com!prodigy.com!newsmst01.news.prodigy.com!prodigy
..com!postmaster.news.prodigy.com!newssvr25.news.prodigy.com.POSTED!fbab4d1e!
not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:133817
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

My question is this:
When implementing an interface in a derived class, is there a way to
map the interface method definition (Implements IPerson.DataRow)
directly to the INHERITED function call, without having to provide an
implementation in the derived class.

In other words, I want to map IPerson.DataRow to
BaseRemoteDataObject.DataRow WITHOUT overriding with a new
implementation in the Person class. I want the interface to use the
inherited behavior, not redefine the behavior.

(I've seen nothing in the documentation that indicates that this is
possible.)

Thanks very much for responding.

Ray Dukes

Hi Ray,

Please modifiy the DataRow Property in the ABSTRACT CLASS and MY
IMPLEMENTATION as follows.

'MY ABSTRACT CLASS
Public Overridable Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

'MY IMPLEMENTATION
Public Overrides Property DataRow() As DataRow Implements
IPerson.DataRow
Get
DataRow = MyBase.DataRow
End Get
Set(ByVal Value As DataRow)
MyBase.DataRow = Value
End Set
End Property

The Overrides keyword will inherit the DataRow property from the
BaseRemoteDataObject class and it will implements IPerson.DataRow.

Did I misunderstand your meaning?
If you have any further related question, please feel free to let me know.


Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Ray Dukes <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: HOWTO: Map interface declaration to a base class method? - TIA
Message-ID: <[email protected]>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 127
NNTP-Posting-Host: 64.57.103.130
X-Complaints-To: (e-mail address removed)
X-Trace: newssvr25.news.prodigy.com 1062538299 ST000 64.57.103.130 (Tue, 02 Sep 2003 17:31:39 EDT)
NNTP-Posting-Date: Tue, 02 Sep 2003 17:31:39 EDT
Organization: SBC http://yahoo.sbc.com
X-UserInfo1:
Q[R_PJONGBWYR_LXIRHFJFTBTR\B@GXLN@GZ_GYO^ZWZUYICD^RAQBKZQTZTX\_I[^G_KGFNON [Z
OE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MNM G_
Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM
Date: Tue, 02 Sep 2003 21:31:39 GMT
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onl in
e.de!npeer.de.kpn-eurorings.net!in.100proofnews.com!in.100proofnews.com!pr od
igy.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news ..p
rodigy.com!newssvr25.news.prodigy.com.POSTED!fbab4d1e!not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:133630
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

What I am looking to do is map the implementation of interface
properties and functions to an inherited method of the base class.

Please see below.

'************************************************************************
**
**
' Issues
'************************************************************************
**
**
Note:
1. The abstract class (BaseRemoteDataObject) wants the derived
classes to use it's ConnectString and DataRow properties'
implementation, but requires the data manipulation methods to be
overridden.

2. The interface that the clients will use (IPerson) allows
access to the DataRow, but not the ConnectString. It also edxposes
the data manipulation methods.

3. The public interface for the implementation class (Person)
only allows Write access to the ConnectString (which IPerson doesn't
recognize)

QUESTION: How do I map IPerson.DataRow() to
BaseRemoteDataObject.DataRow through class Person.

In other words, I want BaseRemoteDataObject.DataRow to fulfill the
IPerson.DataRow requirement in Person.DataRow.

Do I have to provide a pass through implementation for each
method/property to mybase.property?
Public Property DataRow() As System.Data.DataRow Implements
IPerson.DataRow
Get
return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

Am I making sense to anyone? TIA


'************************************************************************
**
**
' Sample Code
'************************************************************************
**
**
MY ABSTRACT CLASS
Public MustInherit Class BaseRemoteDataObject
Inherits BaseRemoteObject
Protected mstrConnectString As String
Protected mDataRow As System.Data.DataRow

Public Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property
Public Property ConnectString() As String
Get
Return mstrConnectString
End Get
Set(ByVal Value As String)
mstrConnectString = Value
End Set
End Property

Public MustOverride Function CancelChanges() As Boolean
Public MustOverride Function Clear() As Boolean
Public MustOverride Function Retrieve(ByVal ID As Integer) As
Integer
Public MustOverride Function Save() As Integer
End Class


MY INTERFACE
Public Interface IPerson
Event HasChanged(ByVal DataHasChanged As Boolean)

ReadOnly Property ID() As Int32
Property FirstName() As String
Property LastName() As String
ReadOnly Property IsChanged() As Boolean
Property DataRow() As DataRow

Function Retrieve(ByVal ID As Int32) As Int32
Function Save() As Int32
Function Clear() As Boolean
Function CancelChanges() As Boolean
End Interface

MY IMPLEMENTATION
Public Class Person
Inherits BaseRemoteDataObject
Implements IPerson
Public Event HasChanged(ByVal DataHasChanged As Boolean)
Implements IPerson.HasChanged

'Original Property Values
Protected p_strFirstname As String
Protected p_strLastname As String
Protected p_intID As Int32

'Current Property Values
Protected strFirstname As String
Protected strLastname As String
Protected intID As Int32

Protected blnChanged As Boolean

Public Shadows WriteOnly Property ConnectString() As String
Set(ByVal Value As String)
MyBase.mstrConnectString = Value
End Set
End Property

<< Most Code Omitted>>

End Class
 
Hi Ray,

Based on my experience, you can not I want to implement IPerson.DataRow by
mappting to the Base class without overriding with a new implementation in
the Person class.

You may do it as what I post in the last post.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
X-Tomcat-ID: 236409730
References: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: (e-mail address removed) (Peter Huang [MSFT])
Organization: Microsoft
Date: Thu, 04 Sep 2003 09:15:29 GMT
Subject: Re: HOWTO: Map interface declaration to a base class method? - TIA
X-Tomcat-NG: microsoft.public.dotnet.languages.vb
Message-ID: <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Lines: 240
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:134106
NNTP-Posting-Host: TOMCATIMPORT2 10.201.218.182

Hi Ray,

I will do some research and update you with new information ASAP.

Have a nice day.

Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Ray Dukes <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: Re: HOWTO: Map interface declaration to a base class method? - TIA
Message-ID: <[email protected]>
References: <[email protected]>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 221
NNTP-Posting-Host: 64.57.103.130
X-Complaints-To: (e-mail address removed)
X-Trace: newssvr25.news.prodigy.com 1062601764 ST000 64.57.103.130 (Wed, 03 Sep 2003 11:09:24 EDT)
NNTP-Posting-Date: Wed, 03 Sep 2003 11:09:24 EDT
Organization: SBC http://yahoo.sbc.com
X-UserInfo1: OX][R\KG\ZWOR^I]^JKBOW@@YJ_ZTB\MV@BZMVMHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_
D
_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW
_
F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM
Date: Wed, 03 Sep 2003 15:09:24 GMT
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onli
n
e.de!skynet.be!skynet.be!newsgate.cistron.nl!amsnews01.chello.com!in.100pro
o
fnews.com!in.100proofnews.com!prodigy.com!newsmst01.news.prodigy.com!prodig
y
.com!postmaster.news.prodigy.com!newssvr25.news.prodigy.com.POSTED!fbab4d1e
!
not-for-mail
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:133817
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

My question is this:
When implementing an interface in a derived class, is there a way to
map the interface method definition (Implements IPerson.DataRow)
directly to the INHERITED function call, without having to provide an
implementation in the derived class.

In other words, I want to map IPerson.DataRow to
BaseRemoteDataObject.DataRow WITHOUT overriding with a new
implementation in the Person class. I want the interface to use the
inherited behavior, not redefine the behavior.

(I've seen nothing in the documentation that indicates that this is
possible.)

Thanks very much for responding.

Ray Dukes

Hi Ray,

Please modifiy the DataRow Property in the ABSTRACT CLASS and MY
IMPLEMENTATION as follows.

'MY ABSTRACT CLASS
Public Overridable Property DataRow() As System.Data.DataRow
Get
Return mDataRow
End Get
Set(ByVal Value As System.Data.DataRow)
mDataRow = Value
End Set
End Property

'MY IMPLEMENTATION
Public Overrides Property DataRow() As DataRow Implements
IPerson.DataRow
Get
DataRow = MyBase.DataRow
End Get
Set(ByVal Value As DataRow)
MyBase.DataRow = Value
End Set
End Property

The Overrides keyword will inherit the DataRow property from the
BaseRemoteDataObject class and it will implements IPerson.DataRow.

Did I misunderstand your meaning?
If you have any further related question, please feel free to let me know.


Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure! www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
From: Ray Dukes <[email protected]>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: HOWTO: Map interface declaration to a base class method? - TIA
Message-ID: <[email protected]>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 127
NNTP-Posting-Host: 64.57.103.130
X-Complaints-To: (e-mail address removed)
X-Trace: newssvr25.news.prodigy.com 1062538299 ST000 64.57.103.130 (Tue,
02 Sep 2003 17:31:39 EDT)
NNTP-Posting-Date: Tue, 02 Sep 2003 17:31:39 EDT
Organization: SBC http://yahoo.sbc.com
X-UserInfo1:
Q[R_PJONGBWYR_LXIRHFJFTBTR\B@GXLN@GZ_GYO^ZWZUYICD^RAQBKZQTZTX\_I[^G_KGFNO
N
[Z
OE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MN
M
G_
Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM
Date: Tue, 02 Sep 2003 21:31:39 GMT
Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-on
l
r
s
*
*
*
*
 
Back
Top