Visual Basic.NET
  Home arrow Visual Basic.NET arrow Developing Namespaces in VB.NET 2005
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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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

Developing Namespaces in VB.NET 2005
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 8
    2006-09-11

    Table of Contents:
  • Developing Namespaces in VB.NET 2005
  • A simple example of a namespace
  • Accessing a class available in a namespace
  • A namespace with more than one class
  • A simple example for a nested namespace
  • Summary

  • 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


    Developing Namespaces in VB.NET 2005


    (Page 1 of 6 )

    This is the second article in a series focusing on inheritance in VB.NET 2005. In this article, I shall introduce you to developing namespaces in VB.NET 2005, together with inheritance.
    A downloadable file for this article is available here.

    If you are new to inheritance in Visual Basic.NET, I request that you go through my first article in this series titled “Inheritance with VB.NET 2005.”  If you are very new to OOP in VB.NET, I request that you go through my first article in the series “Object Oriented Database Development Using VB.NET.”

    The entire source code for this article is available in the form of a downloadable zip file. The solution was developed using Microsoft Visual Studio 2005 Professional Edition on Microsoft Windows Server 2003 Enterprise Edition. I didn’t really test the solution with any other previous editions. If you have any problems in executing the solution, please post in the discussion area.

    What exactly is a namespace?

    Everybody knows that the fundamental unit of OOPS is a “class.”  In my previous articles (as specified above), I declared, defined and explained several classes with several members in different ways. 

    To develop an application, you are free to declare and define any number of classes. When you are dealing with too many classes, sometimes, it may be necessary for you to categorize them in a meaningful manner. Just like you encapsulate a set of members into a class, you may need to have a “categorization of classes.” 

    A set of classes belonging to a particular category can be grouped into a “namespace.”  It is a logical structure, which contains only classes in it. Just as a class has its own name, a namespace should also be defined with its own name (or instead, the category name of the classes!).

    Did we ever use namespaces before in our previous applications/samples?  Yes, but all of them were pre-defined namespaces available in the huge .NET Framework class library. The .NET Framework Class Library has a huge set of pre-defined “namespaces” with thousands of “classes” hierarchically designed. 

    Let us consider the following statement:

    System.Console.WriteLine("Hello World!");

    According to the above statement, you are trying to execute a method named “WriteLine” (which is “shared”) in the class “Console” available in the namespace “System.”  When we use the statement “imports,” we are actually importing all the classes available within the respective “namespace.” Don’t forget that a “namespace” can also be nested with several other “sub-namespaces” (ex: System.Web.UI etc.).

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hello guys! Expand your knowledge of OOPS to namespaces. thanks and bye
     

    VISUAL BASIC.NET ARTICLES

    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...
    - Movement and Player Statistics in a VB.NET T...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek