Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 30th, 2005, 02:33 PM
Authorized User
 
Join Date: Dec 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default MyBase Keyword

If I use the MyBase keyword in a derived class I understand that I can explicitely use the properties and methods of the base class.

My question is, if I use the MyBase.New command, I can access the base class constructor, but does my accessing the base class constructor imply that the property procedures of the base class will ensure the integrity of the private member variables in the derived class?

Please help,

Little Shell

 
Old May 2nd, 2005, 01:50 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Are you trying to imply the base class can set variables for the derived class? If so, no, you have to, after MyBase.Method() establish any private properties in the derived class, so the derived class then has to go above and beyond, so to speak.

Is that what you were asking?

Brian
 
Old May 2nd, 2005, 05:18 PM
Authorized User
 
Join Date: Dec 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for answering BMains.

I was playing with some code that has three tier inheritance, I limited values for the base instance variables via Set/Get procedures and sure enough the inherited class had to obey limitations as described by the set/get procedures of the base class. I could declare and pass in any variable values I wish. I thought this was great because it allows the base class to remain in a consistent state.

Let me know if you agree with what I am suggesting.

Best Regards,

Little Shell






Similar Threads
Thread Thread Starter Forum Replies Last Post
The "New" Keyword rfarmer VB Components 1 August 16th, 2006 12:18 PM
MyBase.CreateChildControls samvan BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 1 January 15th, 2006 06:26 PM
keyword doesn't appear with result gilgalbiblewheel Classic ASP Databases 2 January 11th, 2005 12:45 AM
this keyword RSteel C# 1 December 18th, 2003 04:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.