KEMBAR78
Introduction To .Net
IMPLEMENTING SYSTEM TYPES  AND  INTERFACES 1
Primary System Types System Types Simple Types and complex types Environments Loosely Typed environment You can store multiple types of data Cannot ensure type safety Strongly Typed environment Variable is explicitly assigned Ensure type safety 2
Common Type System Common set of data type Base type System. Object Value types Contains actual data assigned to them  Built in : simple Primitive data types User Defined Structure: Store logically related values Constant: Store values that need not changed Enumeration: List of named integer constants
System Types Contd… Reference Types Contains references to assigned data. Two types of reference data type Classes Like templates  Interfaces Defines standard behavior for classes Boxing: Conversion of value type to reference Boxing: Explicit conversion of reference to value type
 
Data type conversion in .net framework. Performed either explicitly or implicitly. Implicit: Narrow data to wide data. Explicit: Wide data to narrow data. Generics: Define custom types that are type safe Advantages: Reusability ,Type safety, performance.. Nullable types: You can assign null values . Exceptions: Error conditions. Predefined and User defined Exceptions. Attributes: To convey information to the run time . Predefined and custom Attributes. Casting
Interfaces Interfaces are nothing more than definitions of contracts. Single and multiple interfaces IComparable: Generalized comparison method. IEquitable:Only to generics. Used to check equality. IConvertable: To convert an object to  CLR type IClonable:To create an object and new reference variable Shallow Cloning: Copying  an object without references Deep Cloning: Copying object with references to other objects
Interfaces contd... IFormattable:To format the value of the current instance by specified format. IDisposable:To release unmanaged resources explicitly.
IMPLEMENTING COLLECTIONS AND  GENERICS
Collections You an store several items within one object. Arrays:System.Array.To store any type of data. Non Generic :You could store multiple objects No guarantee in type safety Generic : You can specify the data type you want to store. Making development less error – prone. Collection Interface: Each interface allows collection class to support a different behavior  .
Primary Collection Types For storing multiple unrelated types. ArrayList: Similar to single dimension array. Stack: Retrieve objects in the reverse order which you added them (LIFO). Queue: Retrieve objects in the same order which you added them (FIFO) IEnumerable Interface: To iterate through member of collection. Comparer Class: Compares two objects  to detect if they are less than greater than to one another.
Hash table class: To represent name /value pairs based on hash code. Sorted List Class: To represent name /value pairs accessible either by key or by index. BitArray Class: You can implement bit structures. Generic List Class: Provides methods to sort search and manipulate elements of generic list. Generic Stack Class: Represents a variable size LIFO Collection of objects of same data.  Generic Queue Class: Represents a variable size FIFO Collection of objects of same data.
Generic Linked List class: Nodes that have a common data type. Specialized Collections: To serve a special or highly specific purpose. Collection base class: Represents an abstract class for a strongly typed collection. Read-only Collection Base Class: Represents an abstract base class for a strongly typed non generic  collection. Dictionary Base Class: Represents an abstract base class for a strongly types collection of key value pairs. Dictionary Entry Type: Defines a dictionary key value pair.

Introduction To .Net

  • 1.
    IMPLEMENTING SYSTEM TYPES AND INTERFACES 1
  • 2.
    Primary System TypesSystem Types Simple Types and complex types Environments Loosely Typed environment You can store multiple types of data Cannot ensure type safety Strongly Typed environment Variable is explicitly assigned Ensure type safety 2
  • 3.
    Common Type SystemCommon set of data type Base type System. Object Value types Contains actual data assigned to them Built in : simple Primitive data types User Defined Structure: Store logically related values Constant: Store values that need not changed Enumeration: List of named integer constants
  • 4.
    System Types Contd…Reference Types Contains references to assigned data. Two types of reference data type Classes Like templates Interfaces Defines standard behavior for classes Boxing: Conversion of value type to reference Boxing: Explicit conversion of reference to value type
  • 5.
  • 6.
    Data type conversionin .net framework. Performed either explicitly or implicitly. Implicit: Narrow data to wide data. Explicit: Wide data to narrow data. Generics: Define custom types that are type safe Advantages: Reusability ,Type safety, performance.. Nullable types: You can assign null values . Exceptions: Error conditions. Predefined and User defined Exceptions. Attributes: To convey information to the run time . Predefined and custom Attributes. Casting
  • 7.
    Interfaces Interfaces arenothing more than definitions of contracts. Single and multiple interfaces IComparable: Generalized comparison method. IEquitable:Only to generics. Used to check equality. IConvertable: To convert an object to CLR type IClonable:To create an object and new reference variable Shallow Cloning: Copying an object without references Deep Cloning: Copying object with references to other objects
  • 8.
    Interfaces contd... IFormattable:Toformat the value of the current instance by specified format. IDisposable:To release unmanaged resources explicitly.
  • 9.
  • 10.
    Collections You anstore several items within one object. Arrays:System.Array.To store any type of data. Non Generic :You could store multiple objects No guarantee in type safety Generic : You can specify the data type you want to store. Making development less error – prone. Collection Interface: Each interface allows collection class to support a different behavior .
  • 11.
    Primary Collection TypesFor storing multiple unrelated types. ArrayList: Similar to single dimension array. Stack: Retrieve objects in the reverse order which you added them (LIFO). Queue: Retrieve objects in the same order which you added them (FIFO) IEnumerable Interface: To iterate through member of collection. Comparer Class: Compares two objects to detect if they are less than greater than to one another.
  • 12.
    Hash table class:To represent name /value pairs based on hash code. Sorted List Class: To represent name /value pairs accessible either by key or by index. BitArray Class: You can implement bit structures. Generic List Class: Provides methods to sort search and manipulate elements of generic list. Generic Stack Class: Represents a variable size LIFO Collection of objects of same data. Generic Queue Class: Represents a variable size FIFO Collection of objects of same data.
  • 13.
    Generic Linked Listclass: Nodes that have a common data type. Specialized Collections: To serve a special or highly specific purpose. Collection base class: Represents an abstract class for a strongly typed collection. Read-only Collection Base Class: Represents an abstract base class for a strongly typed non generic collection. Dictionary Base Class: Represents an abstract base class for a strongly types collection of key value pairs. Dictionary Entry Type: Defines a dictionary key value pair.

Editor's Notes

  • #2 Brief speaker notes are included with this deck.
  • #3 Brief speaker notes are included with this deck.