4.3 Using the FCL
“Give a man a fish and you feed him for a day. Teach a man to fish
and you feed him for a lifetime.” The IO stream example in the last section was like me giving you a fish. With the FCL it is much better to learn how to fish, because the Framework Class Library is so expansive and you will use it every time you write managed code. I am going to give you the necessary information for you to learn to learn about the Framework Class Library.
The following is a list of points about the FCL that will help you to learn to use the library.
· The many classes, interfaces, structures and enumerated types in the Framework Class Library are collectively referred to as types.
· The various types in the framework are arranged in a hierarchy of namespaces. This solves the problem of name collisions. But in day-to-day use namespace help programmers to find types that solve a certain kind of problem, and they can help programmers to find more than one type that deal with the same problem (such as IO types that live in the System.IO namespace).
· Namespaces themselves live in a hierarchy and are arranged as words separated by the period “.” character. From the CLR’s point of view a type’s name is its fully qualified name including namespaces. Therefore we may write code that uses a Stream class or a Form class, but in IL these types are represented as System.IO.Stream and System.Windows.Forms.Form respectively.
· Languages such as C# allow you to indicate which namespaces a specific source code file will be using. This way in the source code you can refer to the types in their abbreviated form. The first red source code line in Figure 4‑2 is an example of the using statement in C#. I added this line to the code to indicate to the compiler that the sources included types found in the System.Security.Cryptography namespace of the FCL. In this example these types were the CryptoStream, ToBase64Transform and CryptoStreamMode types.
· The System namespace is a good place to look for types that are useful across a wide number of different types of applications.
· All types must have a base class (including types that you define in your). The exception to this rule is the System.Object type which is the base type for all types in the system. (If you create a class that does not explicitly declare a base class then the compiler implicitly defines its base class to be Object).
· The facts in this list plus comfort with the .NET Framework SDK Documentation will really bootstrap your skills with managed code.
Popular Posts
-
Arguments passed by value and by reference. Until now, in all the functions we have seen, the arguments passed to the functions have been pa...
-
SQL Server Express is a free, easy to use, redistributable version of SQL Server 2005 designed for building simple data-driven applications....
-
Declaration of variables In order to use a variable in C++, we must first declare it specifying which data type we want it to be. The syntax...
-
Syntax of JSP Scriptles are: <% //java codes %> JSP Scriptlets begins with <% and ends %> .We can embed any a...
-
The SQL ORDER BY clause comes in handy when you want to sort your SQL result sets by some column(s). For example if you want to select all t...
-
Java Server Pages JavaServer Pages (JSP) technology is the Java platform technology for delivering dynamic content to web clients in a por...
-
DIFFERENCE BETWEEN STRUCT AND UNION: In structures,each member has its own storage location,whereas all memebers of a union use the same loc...
-
SQL is short for Structured Query Language and is a widely used database language, providing means of data manipulation (store, retrieve, up...
-
Inheritance A key feature of OOP is reusability. It's always time saving and useful if we can reuse something that already exists rather...
-
In this section we are going to implement insert data, delete data, and update data using with JDBC database and also using of JavaScript. ...
No comments:
Post a Comment