Identifying Inherited Classes Properties and Methods seperately form inheriting classes P's and M's 
Author Message
 Identifying Inherited Classes Properties and Methods seperately form inheriting classes P's and M's

I have a class B that contains B1 and B2 properties

I have class BPlus that inherits B and adds properties B3 and B4

I want to save the 4 values to 1:1 tables in my DB...I have two data access
layer functions InsertB and InsertBPlus, how can I pass B as a class and
BPlus as a class seperately? I'm just thinking its a waste of resources to
pass the whole thing to both functions...thoughts?

Thanks



Sat, 15 May 2004 10:44:05 GMT  
 Identifying Inherited Classes Properties and Methods seperately form inheriting classes P's and M's
Mike,
Simple. BPlus does not inherit from B. Then you can pass both classes
separately! ;-)

Seriously. There is no real waste of resources, as when you pass an object
to a function, even using ByVal, you are actually passing a reference to the
object, the object itself is really on the heap. Passing an Object ByRef
really passes a reference to the variable holding the reference to the
object on the heap. This is why they are called 'Reference Types'!

Also, shouldn't InsertBPlus call InsertB first, as a "BPlus" object IS A "B"
object, by virtue of BPlus inherits from B.

Hope this helps
Jay


Quote:
> I have a class B that contains B1 and B2 properties

> I have class BPlus that inherits B and adds properties B3 and B4

> I want to save the 4 values to 1:1 tables in my DB...I have two data
access
> layer functions InsertB and InsertBPlus, how can I pass B as a class and
> BPlus as a class seperately? I'm just thinking its a waste of resources to
> pass the whole thing to both functions...thoughts?

> Thanks



Sat, 15 May 2004 11:43:48 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Form Inheritance / inheriting properties and methods

2. Hiding methods in inherited classes

3. Hide property in inherited class?

4. Using SQL Server 7.0 with SQLConnection and inheriting from Form Classes

5. major speed decrease when class inherits from Winform.Form

6. Problem with a vb.Net class inheriting from a c# class

7. Properties changed in an inherited form

8. Access control property on inherited form

9. nested class inherits containing class accessing private instance members

10. Masking Inherited Properties in a property grid

11. custom form control: Cannot view design view of forms that inherit this form

12. Add Inherited Form - not all existing forms shown

 

 
Powered by phpBB® Forum Software