Introduction to the .NET Development Environment

The Microsoft .NET initiative involves a change in the fundamental structure of development and deployment. The .NET development platform integrates support for multiple development languages such as Visual Basic .NET and C# (pronounced see-sharp ) with the Common Language Runtime (CLR) and a shared Framework class library (FCL). These allow programmers to perform programmatic development in whatever language they are most comfortable, with a final solution integrating all the various code segments through common classes and runtime library inclusions.

graphics/note_icon.gif

In order to prepare a server to support .NET applications, the Common Language Runtime (CLR) must be present. This is accomplished by loading the .NET Framework available through the Windows Update site or included within the .NET Software Development Kit (SDK) available through the Microsoft MSDN downloads site. Alternatively, if you don't intend to perform development on the server, you can use the smaller .NET Framework redistributable package.


Code development for the .NET environment may be performed using a text editor and the command-line compilers within the .NET SDK, but a more robust solution exists in the form of Microsoft's Visual Studio .NET product. This product includes an Integrated Development Environment (IDE) and advanced editing tools that make it possible to rapidly evaluate code and other .NET structures, use integrated debugging and automation tools, and integrate with the Windows Installer deployment utility in order to simplify application distribution and update.

graphics/alert_icon.gif

You are expected to be able to recognize utilities within the Integrated Development Environment (IDE) and to know how to use the Visual Studio .NET product and to understand code written using the Visual Basic .NET language.


Objects and Classes

Visual Basic .NET is an object-oriented language in which every construct is considered an object that has associated properties and methods and may contain other objects in turn . The abstract concept of a group of objects with common qualities is termed a class .

graphics/tip_icon.gif

The class is a fundamental concept you will encounter throughout this book and is one you should be very familiar with.


A class is a blueprint for an object rather than an object itself. Classes will have many properties, some created by the developer and others derived from the class itself. The properties and methods of a class can be split into two categories:

  • Static members Fields, methods, events, or properties that belong to the class itself rather than to a particular instance of that class

  • Instance members Fields, methods, events, or properties that belong to an individual object (an instance of a class)

A class encapsulates both data and behavior into a single concept. In addition to having its own members, a class may inherit some or all of its members from a parent class.

Class Inheritance

Specific methods of assigning inheritance are discussed later in this chapter, but Figure 1.1 provides an example of the chain of inheritance from a Windows form through its parent and that, in turn, back to the most fundamental classthe Object class.

Figure 1.1. An example of class inheritance in which the Form class inherits from its parent classes.

graphics/01fig01.gif

The properties, or members , of a class that may be inherited can be limited by including an access modifier in their declaration. Within the Visual Studio .NET environment are four access modifiers you should be aware of:

  • Public This member is globally accessible.

  • Private This member is accessible only within its own class. This is the default.

  • Protected This member is accessible within its own class and all classes derived from this class.

  • Friend This member is accessible to all classes within the current project.

Namespace

The Visual Studio .NET development environment includes hundreds of classes, and you will develop many more for each project. In order to provide organization and structure to what could rapidly become an unmanageable number of classes, the development environment makes use of the concept of a namespace . This is a hierarchical naming system in which classes may be grouped as required.

The standard naming convention for creation of a namespace is as follows :

  CompanyName.ApplicationName  

An example of this would be the creation of a namespace for this book: ExamCram2.70306 . Here, 70306 is the child namespace of the parent ExamCram2 namespace. If you created a class, ExamItems , within the 70306 namespace, the class would be designated as ExamCram2.70306.ExamItems . A separate ExamItems class could exist within a different namespace, such as in ExamCram2.70316.ExamItems . These are unrelated classes sharing only the common class name and are separated by the namespace groupings of 70306 and 70316 within the parent ExamCram2 namespace.

The root namespace including all others is the System namespace. This contains the Object class ( System.Object ), which is the parent for all other classes in the .NET Framework. System also includes other objects and namespaces that we will deal with, such as the System.Drawing namespace, which includes classes used to create graphical elements, and the System.Windows namespace, which includes the System.Windows.Forms child namespace that includes the classes used to create Windows form objects.

graphics/note_icon.gif

The namespace hierarchy is simply used to organize classes and is separate from the hierarchy in a chain of class inheritance. A class may inherit members from another class located in any other namespace.


Now that you are familiar with the basics of the conceptual side of the .NET development environment, we will examine the creation of a form within the Windows Form Designer.



Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
Developing and Implementing WindowsR-based Applications with Visual BasicR. NET and Visual StudioR. NET Exam CramT 2 (Exam 70-306)
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 188

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net