Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 4 - Practical Examples of Namespaces in VB.NET...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Actuate Whitepapers 
VeriSign Whitepapers 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Practical Examples of Namespaces in VB.NET 2005
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 22
    2006-09-18

    Table of Contents:
  • Practical Examples of Namespaces in VB.NET 2005
  • Inheriting a class from another namespace: continued
  • Inheriting a class from a root namespace (or assembly)
  • Inheriting a class from a root namespace (or assembly) in practice
  • Inheriting a class from a root namespace (or assembly): example
  • Inheriting a class from root namespace (or assembly): example continued

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Practical Examples of Namespaces in VB.NET 2005 - Inheriting a class from a root namespace (or assembly) in practice


    (Page 4 of 6 )

    This section proceeds based on the theory explained in the previous section.  Let us start from the beginning again. In this scenario, the name of the project (or assembly) is "SampleInheritance." Let us define a class (without any namespace) as follows:

    PublicClass First
          .
          .
          .
    EndClass

    In the case above, without your understanding, it would be treated as something like the following (internally):

    PublicClass SampleInheritance.First
          .
          .
          .
    EndClass

    Now, if you wanted to define a new class by inheriting from the above, you can define it in any of the ways as follows:

    PublicClass Second
        Inherits First
          .
          .
          .
    EndClass
    PublicClass Second
        Inherits SampleInheritance.First
          .
          .
          .
    EndClass

    This type of usage or naming would be essential when you have same class names in root namespace and in your own created namespace. To make it simple, if you want to inherit from a class which doesn't belong to any namespace, kindly include the name of the assembly (or project name) to eliminate confusion and to attain better readability.

    Finally, if you defined your own namespace as follows:

    NamespaceNamespace2
          .
          .
          .
    EndNamespace

    it would also be treated something like the following (internally):

    NamespaceSampleInheritance.Namespace2
          .
          .
          .
    EndNamespace

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hello guys! I am extending the series on OOPS with Visual Basic 2005 with this...
     

    VISUAL BASIC.NET ARTICLES

    - Working with Classes and Properties for Game...
    - Working with Loops, Arrays, and Collections ...
    - Learning Loops in VB.NET for Game Development
    - Learning VB.NET: Working with Variables, Con...
    - The Basics of VB.NET Through Text Game Devel...
    - Learning VB.NET Through Text Game Development
    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway