Professional Documents
Culture Documents
LectureThe NET Framework VB 2008
LectureThe NET Framework VB 2008
Outline
Namespaces
However, we did NOT use the Inherits keyword when we defined JTrain.
Even though the VB Keyword Inherits is not necessary, for this. ToString() : returns a String representation of the Object (weve used this). GetType() : returns a Type Object, representing the Objects data type
The .NET platform and how it relates to Objects. The Windows O.S. and its interface with developed software.
The Windows Memory Manager is called. The Windows Disk Subsystem is called. The Windows Graphics Subsystem is called.
Examples:
From the APIs Common Dialog Box Library. The APIs User Interface is used, together with the Common Control Library.
So users dont have to deal with the API directly. This was greatly responsible for the big success of VB.
C++ provides lots of control over program function... Java makes programs extremely portable.
e.g., GUI development. Take a really long time in Java, for instance.
Later, Microsoft recast this concept within the larger .NET Framework.
Ex: To to open a file, you use a System Object designed for this purpose.
called the .NET Framework Classes.
This set of objects is actually a huge set of Base Classes (approx. 3500)
Windows, Linux, Pocket PC, Mac Very developer-friendly! VB .NET, C++, C#, J# (.NET version of Java), etc.
First to Microsoft Intermediate language: CIL (Common Intermediate Language; also called MSIL).
This language is NOT dependent on any processor or platform. Then to platform-specific native (machine) code later on
So, the Common Language Infrastructure, CLI = CIL + CLR In this way, Microsoft freed itself from its dependence on Windows
Which then runs in the Java Virtual Machine. .NET started as Many Languages / One Platform (and then expanded).
Application Isolation:
So that they may crash separately from the OS. Idea: Prevent software-based system crashes (Blue Screen of Death) Code requires evidence to run in CLR (determined via programmer-set policies). In contrast, old Windows applications have unlimited access to system data.
Inter-language Interoperability:
Available Data Types are shared by all managed languages Provide appropriate structures for error recovery (weve discussed this).
A JIT Compiler and a Virtual Execution System (VES, or Virtual Machine) The Common Language Runtime (CLR) and Specification (CLS)
Are then freely available to all. So that the Classes will function properly in a C# program (!)
Primitive data types are handled the same in all managed languages
The Common Language Runtime (Actually, the CLI). The .NET Framework Classes.
A huge set (> 3500) of Base Classes for developer use. A bit hard to navigate
Fortunately, the Framework Classes are conveniently divided into related groups.
Each group is associated with a specific Namespace. The overall collection of namespaces is hierarchical:
Created by stringing together the namespaces with the dot (.) operator
System.Windows.Forms Classes for drawing Forms System.Console A Class for designing Console Applications System.Object Here, we see that Object derives from Class System.
Multiple Inheritance
Sounds interestingbut this can cause ambiguity troubles. C++ permits multiple inheritance Java technically does not
Examples:
Each Class must be derived (directly inherit) from exactly one Class.
In other words, only 1 Class can be included in a Classs Inherits Clause. Recall: all Objects ultimately inherit from System.Object JFreightTrain inherited from JTrain
So that you can find the classes of your library with the Object Browser.
Specifically: development for Windows Applications. Along the way, we discussed: The most frequently-used Controls. Basic and Advanced topics in Object Oriented Programming. Advanced OO Topics Creating Class Libraries Creating Custom Controls Custom Graphics. Then, some related technologies: