Theory
Do not build the button
Think about everything ShopKeeper needs: windows, buttons, textboxes, a bill grid, file saving, a database connection, date handling, string cleanup.
Writing a button from scratch (drawing pixels, tracking clicks, repainting on hover) would take you a month. And it would be YOUR button, with YOUR bugs.
Microsoft already wrote the button. And the grid, the file reader, the connection. The second pillar of .NET is that warehouse: the Framework Class Library.
Theory
The library, formally
The .NET Framework Class Library (FCL) is a comprehensive, object-oriented collection of reusable classes, interfaces and types, available identically to every .NET language.
Its organising system is the namespace: a dotted, hierarchical name that groups related classes, exactly like BCA403's Java packages.
Systemis the root: the everyday types live hereSystem.Windows.Formsholds the desktop UI classesSystem.Dataholds the database machinery
Deep dots mean a more specialised shelf, nothing more.
At a glance
The shelves ShopKeeper will visit
| Namespace | What is on the shelf | ShopKeeper use |
|---|---|---|
| System | Object, String, Int32, Math, Console | Every line of code |
| System.Windows.Forms | Form, Button, TextBox, DataGrid | The billing screen (Unit 3) |
| System.Data | Connection, Command, DataSet | Saving bills (Unit 5) |
| System.IO | File, StreamReader, StreamWriter | Exporting a day's report |
| System.Collections | ArrayList and friends | The list of items in a bill (Unit 2) |
Practical
Imports opens a shelf
' Without Imports: full names everywhere
Dim box1 As System.Windows.Forms.TextBox
' With Imports at the top of the file:
Imports System.Windows.Forms
Public Class BillingForm
Dim box2 As TextBox ' short name now works
Dim total As Integer ' Integer IS System.Int32 underneath
Sub Greet()
MsgBox("Welcome to ShopKeeper")
End Sub
End Class
Quiz
Which namespace must ShopKeeper reach into for its Form, Button and TextBox classes?
- System.Windows.Forms
- System.Data
- System.IO
- Microsoft.VisualStudio
Show the answer
System.Windows.Forms
Desktop UI lives on the System.Windows.Forms shelf; Unit 3 is essentially a guided tour of it. System.Data is the database machinery for Unit 5, System.IO is files and streams. Microsoft.VisualStudio is the trap: Visual Studio is the IDE you sit in, and your running program does not depend on it; confusing the tool with the library is the recurring Unit 1 mistake.
Think first
What is Integer, really?
VB.NET writes Dim total As Integer, C# writes int total. Yesterday's lesson said both languages share one type system. Before tapping: what is Integer underneath, and why does that matter?
Show the answer
Integer is an alias for System.Int32, a class-library type; C#'s int is the SAME System.Int32. Every language keyword-type maps onto one FCL type: String is System.String, Boolean is System.Boolean. That is the CTS made concrete: languages share types by all borrowing from one warehouse. Consequence you will use constantly: Integer has METHODS (total.ToString()), because underneath it was never a bare C-style int at all.
Watch out
Library confusions that cost marks
FCL vs CLR: the library is the parts, the CLR is the engine. "The class library executes MSIL" scores 0.
Imports does not load code: like Java's import, it only lets you write short names; the assembly reference does the actual linking.
Namespace vs class: System.Windows.Forms is a namespace; Form is a class inside it. Writing "the Form namespace" tells the examiner you never touched the IDE.
Theory
Unit 1 in one breath
You can now recite the whole machine: VB.NET source compiles to MSIL + metadata in an assembly; the CLR loads, verifies, JIT-compiles and garbage-collects it; and the code itself is largely assembled from FCL classes reached through namespaces. Say it twice; it answers 4 different exam questions. Next lesson you finally open Visual Studio and meet the room where ShopKeeper gets built.
Summary
Key takeaways
- The FCL is .NET's library of ready-made classes, shared identically by all .NET languages.
- Namespaces organise it hierarchically: System at the root, dots for specialisation.
- Key shelves: System (core types), System.Windows.Forms (UI), System.Data (ADO.NET), System.IO (files), System.Collections.
- Imports brings a namespace into scope for short names, like Java's import.
- VB.NET's Integer/String are aliases for FCL types (System.Int32, System.String): the CTS in practice.
- Library = parts, CLR = engine; never swap their jobs in an answer.
- Memory hook: never build what the warehouse already stocks.