• Save
Net framework session02
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Net framework session02

on

  • 448 views

 

Statistics

Views

Total Views
448
Views on SlideShare
440
Embed Views
8

Actions

Likes
0
Downloads
0
Comments
0

1 Embed 8

http://niitcourseslides.blogspot.in 8

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.
  • Initiate the session by explaining the session objectives. Tell the students that the success of a software solution depends largely on how well its various components have been designed. An effort should be made to ensure that the components of the existing software solution can be reused. This can be done by using frameworks and patterns. You need to elaborate the concept of applying patterns and frameworks by using the case study of BlueSeas Inc. This will help students to relate their programming skills with the actual practices followed in the software industry.

Net framework session02 Presentation Transcript

  • 1. Core Development with the Microsoft .NET Framework 2.0 FoundationObjectives In this session, you will learn to: Describe the purpose of collections and collection interfaces Implement the various classes available in the .NET Framework 2.0 Implement generic list types, collections, dictionary types, and linked-list types Implement specialized string and named collection classes Implement collection base classes and dictionary base types Describe the purpose and creation of an assembly Share an assembly by using the Global Assembly Cache Install an assembly by using the Installer, AssemblyInstaller, ComponentInstaller, InstallerCollection, and InstallContext classes and the InstallEventHandler delegate available in the .NET Framework 2.0 Ver. 1.0 Slide 1 of 41
  • 2. Core Development with the Microsoft .NET Framework 2.0 FoundationExamining Collections and Collection Interfaces What are Collections? • Collections are classes used to store arbitrary objects in an organized manner. • Types of collections available in .Net Framework are: Arrays: Are available in the System.Array namespace and can store any type of data. Advanced Collections: Are found in the System.Collections namespace and consist of the following collections: Non-Generic Collections: With a non-generic collection, you could store multiple types of objects in the collection simultaneously. Generic Collections: When you create an instance of a generic collection, you determine and specify the data type you want to store in that collection. Ver. 1.0 Slide 2 of 41
  • 3. Core Development with the Microsoft .NET Framework 2.0 FoundationExamining Collections and Collection Interfaces (Contd.) What are Collection Interfaces? • Collection interfaces specify all the necessary properties and methods for an implementing class to provide the required functionality and behavior of a collection. • Every collection class, non-generic or generic, implements at least one or more collection interfaces. Ver. 1.0 Slide 3 of 41
  • 4. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types Create a Flexible Collection of Reference Types by Using ArrayList class • The ArrayList class is defined in the System.Collections namespace. • An ArrayList represents a list, which is similar to a single- dimensional array that you can resize dynamically. • The ArrayList does not provide type safety. Dynamic Resizing Ver. 1.0 Slide 4 of 41
  • 5. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) The following code snippet creates an ArrayList to store names of countries: ArrayList countries = new ArrayList(); countries.Add("Belgium"); countries.Add ("China"); countries.Add("France"); foreach (string country in countries) { Console.WriteLine (country); } Ver. 1.0 Slide 5 of 41
  • 6. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) Manage Collections by Using Stacks and Queues • You can use Stacks and Queues to store elements when the sequence of storing and retrieving them is an important issue. • Stacks follow the last-in-first-out (LIFO) principle while Queues follow the first-in-first-out (FIFO). Queue FIFO Stack LIFO Ver. 1.0 Slide 6 of 41
  • 7. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) • The following code example shows the implementation of the Stack class: Stack s1 = new Stack(); s1.Push("1"); s1.Push("2"); s1.Push("3"); Console.WriteLine("topmost element: " + s1.Peek()); Console.WriteLine("total elements: " + s1.Count); while (s1.Count > 0) { Console.Write(" " + s1.Pop()); } The output of the code example will be: topmost element: 3 total elements: 3 321 Ver. 1.0 Slide 7 of 41
  • 8. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) • The following code example shows the implementation of the Queue class: Queue q1 = new Queue(); q1.Enqueue("1");q1.Enqueue("2");q1.Enqueue("3"); Console.WriteLine("topmost element: " + q1.Peek()); Console.WriteLine("total elements: " + q1.Count); while (q1.Count > 0) { Console.Write(" " + q1.Dequeue()); } The output of the code example will be: topmost element: 1 total elements: 3 123 Ver. 1.0 Slide 8 of 41
  • 9. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) Enumerate the Elements of a Collection by Using an Enumerator • Iterators are sections of code that return an ordered sequence of values of the same type. • They allow you to create classes and treat those as enumerable types and enumerable objects. Ver. 1.0 Slide 9 of 41
  • 10. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) Access Reference Types Based on Key/Value Pairs and Comparers The Comparer class compares two objects to detect if they are less than, greater than, or equal to one another. The Hashtable class represents a collection of name/value pairs that are organized on the basis of the hash code of the key being specified. The SortedList class represents a collection of name/value pairs that are accessible either by key or by index, but sorted only by keys. Ver. 1.0 Slide 10 of 41
  • 11. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) • The following code example shows the implementation of the Comparer class: string str1 = "visual studio .net"; string str2 = "VISUAL STUDIO .NET"; string str3 = "visual studio .net"; Console.WriteLine("str1 and str2 : " + Comparer.Default.Compare(str1, str2)); Console.WriteLine("str1 and str3 : " + Comparer.Default.Compare(str1, str3)); Console.WriteLine("str2 and str3 : " + Comparer.Default.Compare(str2, str3)); Ver. 1.0 Slide 11 of 41
  • 12. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) The following code example creates a new instance of the Hashtable class, named currency: Hashtable currencies = new Hashtable(); currencies.Add("US", "Dollar"); currencies.Add("Japan", "Yen"); currencies.Add("France", "Euro"); Console.Write("US Currency: {0}", currencies["US"]); Ver. 1.0 Slide 12 of 41
  • 13. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) The following code example shows the implementation of the SortedList class: SortedList slColors = new SortedList(); slColors.Add("forecolor", "black"); slColors.Add("backcolor", "white"); slColors.Add("errorcolor", "red"); slColors.Add("infocolor", "blue"); foreach (DictionaryEntry de in slColors) { Console.WriteLine(de.Key + " = " + de.Value); } Ver. 1.0 Slide 13 of 41
  • 14. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Primary Collection Types (Contd.) Store Boolean Values in a BitArray by Using the BitArray Class The BitArray class implements a bit structure, which represents a collection of binary bits, 1s and 0s. The Set and Get methods can be used to assign Boolean values to a bit structure on the basis of the index of the elements. The SetAll is used to set the same value for all the elements. Ver. 1.0 Slide 14 of 41
  • 15. Core Development with the Microsoft .NET Framework 2.0 FoundationJust a minute If you place a set of dinner plates, one on top of the other, the topmost plate is the first one that you can pick up and use. According to you, which class follows the same principle? Queue BitArray Stack Hashtable Answer Stack Ver. 1.0 Slide 15 of 41
  • 16. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Generic Collections Create Type-Safe Collections by Using Generic List Types The generic List class provides methods to search, sort, and manipulate the elements of a generic list. The generic List class can be used to create a list that provides the behavior of an ArrayList. Ver. 1.0 Slide 16 of 41
  • 17. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Generic Collections (Contd.) The following code example shows the implementation of the generic List: List<string>names = new List<string>(); names.Add("Michael Patten"); names.Add("Simon Pearson"); names.Add("David Pelton"); names.Add("Thomas Andersen"); foreach (string str in names) { Console.WriteLine(str); } Ver. 1.0 Slide 17 of 41
  • 18. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Generic Collections (Contd.) Create Type-Safe Collections by Using Generic Collections The generic Stack class functions similarly to the non-generic Stack class except that a generic Stack class contains elements of a specific data type. The generic Queue class is identical to the non-generic Queue class except that the generic Queue class contains elements of a specific data type. The generic Queue class is used for FIFO applications. The generic Stack class is used for LIFO applications. Ver. 1.0 Slide 18 of 41
  • 19. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Generic Collections (Contd.) Access Reference Types Based on Type-Safe Key/Value Pairs • In generic key/value pairs, the key is defined as one data type and the value is declared as another data type. • The following classes can be used to add name and value pairs to a collection: Dictionary: Represents in the value the actual object stored, while the key is a means to identify a particular object. SortedList: Refers to a collection of unique key/value pairs sorted by a key. SortedDictionary: Uses a faster search algorithm than a SortedList, but more memory. Ver. 1.0 Slide 19 of 41
  • 20. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Generic Collections (Contd.) Create Type-Safe Doubly Linked Lists by Using Generic Collections With the generic LinkedList class, you can define nodes that have a common data type with each node pointing to the previous and following nodes. With a strongly typed doubly linked list you can traverse forward and backward through the nodes to reach a particular node. Doubly LinkedList Ver. 1.0 Slide 20 of 41
  • 21. Core Development with the Microsoft .NET Framework 2.0 FoundationJust a minute What is a doubly linked list? Answer A collection in which each node points to the previous and following nodes is referred to as a doubly linked list. Ver. 1.0 Slide 21 of 41
  • 22. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Specialized Collections What Are Specialized Collections? Specialized collections are predefined collections that serve a special or highly specific purpose. These collections exist in the System.Collections.Specialized namespace The various specialized collections available in .Net Framework are: String classes Dictionary classes Named collection classes Bit structures Ver. 1.0 Slide 22 of 41
  • 23. Core Development with the Microsoft .NET Framework 2.0 FoundationJust a minute What is a specialized string collection? Answer A specialized string collection provides several string-specific functions to create type-safe strings. Ver. 1.0 Slide 23 of 41
  • 24. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Collection Base Classes Create Custom Collections by Using Collection Base Classes Collection base classes provide the abstract base class for strongly typed non-generic collections. The read-only version of the CollectionBase class is the ReadOnlyCollectionBase class. Ver. 1.0 Slide 24 of 41
  • 25. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking with Collection Base Classes (Contd.) Create Custom Dictionary Types by Using Dictionary Base Types Dictionary base types provide the most convenient way to implement a custom dictionary type. Custom dictionary types can be created by using: DictionaryBase class DictionaryEntry structure Ver. 1.0 Slide 25 of 41
  • 26. Core Development with the Microsoft .NET Framework 2.0 FoundationJust a minute Categorize the following features into CollectionBase class and the DictionaryBase type? Helps create custom collections Helps create a custom dictionary Provides the public member Count Is a base collection of key value/pairs Answer Collection Base class Dictionary Base type Helps create custom collections Helps create a custom dictionary Provides the public member Count Is a base collection of key value/pairs Ver. 1.0 Slide 26 of 41
  • 27. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking With An Assembly What Is an Assembly? • An assembly is a self-contained unit of code that contains all the security, versioning, and dependency information. • Assemblies have several benefits like: Resolve conflicts arising due to versioning issues. Can be ported to run on multiple operating systems. Are self-dependant. Ver. 1.0 Slide 27 of 41
  • 28. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking With An Assembly (Contd.) Create an Assembly • You can create the following two types of Assemblies. • Single-file assemblies: are self-contained assemblies. • Multifile assemblies: store different elements of an assembly in different files. • You can create an assembly either at the command prompt by using command-line compilers or by using an IDE such as Visual Studio .NET 2005. Types of Assemblies Single-file Multifile Ver. 1.0 Slide 28 of 41
  • 29. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking With An Assembly (Contd.) To create an assembly with the .exe extension at the command prompt, use the following syntax: compiler command module name For example, if you want to compile a code module called myCode into an assembly you can type the following command: csc myCode.cs Ver. 1.0 Slide 29 of 41
  • 30. Core Development with the Microsoft .NET Framework 2.0 FoundationWorking With An Assembly (Contd.) The three most common forms of assemblies are: .dll : A .dll file is an in-process executable file. This file cannot be run independently and is called by other executable files. .exe: An .exe file is an out-of-process executable file that you can run independently. An .exe file can contain references to the .dll files that get loaded at run time. .netmodule: A .netmodule is a block of code for compilation. It contains only the type metadata and the MSIL code. Ver. 1.0 Slide 30 of 41
  • 31. Core Development with the Microsoft .NET Framework 2.0 FoundationSharing an Assembly by Using the Global Assembly Cache What is Global Assembly Cache? • The global assembly cache is a system-wide code cache managed by the common language runtime. • Any assembly that needs to be shared among other applications is typically installed in the global assembly cache. • On the basis of sharing, assemblies can be categorized into two types, private assemblies and shared assemblies. Ver. 1.0 Slide 31 of 41
  • 32. Core Development with the Microsoft .NET Framework 2.0 FoundationSharing an Assembly by Using the Global Assembly Cache (Contd.) Creating and Assigning a Strong Name to an Assembly • A strong name provides a unique identity to an assembly. • For installing an assembly in the global assembly cache, you must assign a strong name to it. • You can use Sn.exe provided by the .NET Framework to create and assign a strong name to an assembly. • For creating a strong name for an assembly you can open the Visual Studio 2005 Command Prompt and type the following command: • SN -k KeyPairs.snk SN is the command to generate the strong key and Keypairs.snk is the filename where you are storing this key. Ver. 1.0 Slide 32 of 41
  • 33. Core Development with the Microsoft .NET Framework 2.0 FoundationSharing an Assembly by Using the Global Assembly Cache (Contd.) Deploy an Assembly into the Global Assembly Cache • Deploying an assembly in the global assembly cache is necessary when you need to share the assembly with other applications. • There are three methods to deploy an assembly into the global assembly cache: • Windows Explorer • Gacutil.exe • Installers • The syntax to use Gacutil.exe is gacutil –i/assembly name. The -i option is used to install the assembly into the global assembly cache. Ver. 1.0 Slide 33 of 41
  • 34. Core Development with the Microsoft .NET Framework 2.0 FoundationInstalling an Assembly by Using Installation Types What are Assembly Installers? • Assembly installers are used to automate the process of installing assemblies. • You can create installers either by using: Visual Studio: Allows you to create four types of installers: • Setup project • Web Setup project • Merge Module project • CAB project • Command Prompt: Enables more flexibility in customizing your assembly installers. Ver. 1.0 Slide 34 of 41
  • 35. Core Development with the Microsoft .NET Framework 2.0 FoundationInstalling an Assembly by Using Installation Types (Contd.) Create Custom Installation Applications by Using the Installer Class • The .NET Framework provides the Installer class as a base class to create custom installer classes. • To create a custom installer class in your setup code, perform the following steps: Create a class that is inherited from the Installer class. Implement overrides for the Install, Commit, Rollback, and Uninstall methods. Add RunInstallerAttribute to the derived class and set it to true. Invoke the installer. Ver. 1.0 Slide 35 of 41
  • 36. Core Development with the Microsoft .NET Framework 2.0 FoundationInstalling an Assembly by Using Installation Types (Contd.) Install an Assembly by Using the AssemblyInstaller Class You can use the AssemblyInstaller class to load an assembly and run all its installer classes. The AssemblyInstaller class belongs to the System.Configuration.Install namespace. Ver. 1.0 Slide 36 of 41
  • 37. Core Development with the Microsoft .NET Framework 2.0 FoundationInstalling an Assembly by Using Installation Types (Contd.) Copy Component Settings for Runtime Installation ComponentInstaller class that has the ability to let custom installer classes to access information from other running components during the installation process. The installer can access the required information from another component by calling the CopyFromComponent method of the ComponentInstaller class. Custom Installer Running Components Classes Ver. 1.0 Slide 37 of 41
  • 38. Core Development with the Microsoft .NET Framework 2.0 FoundationInstalling an Assembly by Using Installation Types (Contd.) Manage Assembly Installation by Using Installer Classes • The .NET Framework provides the following Installer classes: InstallerCollection: Provides methods and properties that the application will require to manage a collection of Installer objects. InstallContext: Maintains the context of the installation in progress. Ver. 1.0 Slide 38 of 41
  • 39. Core Development with the Microsoft .NET Framework 2.0 FoundationInstalling an Assembly by Using Installation Types (Contd.) Handle Installation Events by Using the InstallEventHandler Delegate • InstallEventHandler delegate can be used to run custom actions at certain points during the installation process. • The various events that can be handled during installation are: BeforeInstall AfterInstall Committing Committed BeforeRollback AfterRollback BeforeUninstall AfterUninstall Ver. 1.0 Slide 39 of 41
  • 40. Core Development with the Microsoft .NET Framework 2.0 FoundationSummary In this session, you learned that: Collections are classes in which you store a set of arbitrary objects in a structured manner. Collection interfaces specify all the necessary properties and methods for an implementing class to provide the required functionality and behavior of a collection. Primary or non-generic collection types can be dynamically resized, but do not provide type safety. Stack and Queue classes are helpful for storing a set of objects in a collection where the sequence of adding objects is important. Type-safe doubly linked lists can be created by using generic collections. Specialized collections are predefined collections that serve a special or highly specific purpose. Ver. 1.0 Slide 40 of 41
  • 41. Core Development with the Microsoft .NET Framework 2.0 FoundationSummary (Contd.) Collection base classes provide the abstract base class for strongly typed non-generic collections. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. The global assembly cache is a system-wide code cache managed by the Common Language Runtime (CLR). An assembly that is installed in the global assembly cache to be used by different applications is known as a shared assembly. Assembly installer is a utility that help automate installation and uninstallation activities and processes. Ver. 1.0 Slide 41 of 41