I have a web service that I call that returns an object of type A. I call this web service from a business layer. The business layer needs a few more properties on the object before it can be used by the GUI layer. I was thinking of using inheritance, however, the calls to the web service return an object of A, and there is no clean way (that I know of) to convert a base type to a derived type. So another option I was thinking of was using a class that has an object of type A and then the rest of my properties that I need.
Is there anything wrong with this approach? Is there a way I could use inheritance to get this done?Code:Public Class B Private _A As A Public Property ObjectA() As A Get Return _A End Get Set(ByVal value As A) _A = value End Set End Property Private myNewProperty As String Public Property NewProperty() As String Get Return myNewProperty End Get Set(ByVal value As String) myNewProperty = value End Set End Property End Class




Reply With Quote