Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 3 - 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 
Moblin 
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)


    (Page 3 of 6 )

    This is a bit different from what we examined up to now. If I define a class without specifying any namespace, it generally belongs to a root namespace, which is generally the same as the assembly name itself (or the project name).

    To put it simply, if you define classes which do not belong to any namespace, they straight away belong to assembly. It is quite easy to inherit from these types of classes, as we don't need to specify any name for the namespace during inheriting.

    But there exists a small trick here to learn. We need to understand the "scope" of access. Even though I will not talk about "scope" in a detailed manner, I shall introduce you to a bit of it. In my upcoming articles, I shall explain in detail.

    Every project you create will turn into an assembly at run time. That means, when you hit F5 (or run) to execute the project, it converts all of your code in all of your files into a single file called assembly. The physical and logical name of this assembly would be generally the same name as that of our project name (unless we configure it in a different way). To put it simply, an assembly is physical and a namespace is logical (but both will have the same names). An assembly physically stays in the file system (or at references), but we use namespaces (in our programming) to import/access the content of assembly.

    To access any class/namespace within an assembly, we need to start with the name of the assembly of import first. All our classes and namespaces are encapsulated within this assembly (logically accessed with the root namespace name). If we wanted to inherit a class from a class within the same assembly and within the same root namespace, generally we don't need to specify the assembly name (or root namespace name). This is what we did (unknowingly) in the first few sections of my previous article.

    The next section will give you some practical understanding of the above theory.

    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

    - Movement and Player Statistics in a VB.NET T...
    - Creating and Drawing a Game Map in VB.NET
    - 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...




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