SlideShare une entreprise Scribd logo
1  sur  24
Object-Oriented Programming Using C#
Objectives


               In this session, you will learn to:
                  Implement constructors
                  Implement destructors
                  Identify the life cycle of an object
                  Describe polymorphism
                  Implement function overloading
                  Identify need for operator overloading




    Ver. 1.0                        Session 8              Slide 1 of 24
Object-Oriented Programming Using C#
Implementing Constructors


               A constructor is a special type of method that is invoked
               when you create a new instance of a class.
               A constructor is used to initialize the members of the class.
               The name of a constructor is the same as the name of the
               class that contains it.




    Ver. 1.0                       Session 8                          Slide 2 of 24
Object-Oriented Programming Using C#
The Need of Constructors


               A constructor is special member function within the
               class which is executed when an object of the class is
               created.




    Ver. 1.0                      Session 8                         Slide 3 of 24
Object-Oriented Programming Using C#
Types of Constructors


               The two types of constructors are:
                – Instance constructors: They are called whenever an instance
                  of a class is created. These constructors are used to initialize
                  the data members of the class.
                – Static constructors: They are used to initialize the static
                  variables of a class. These variables are created using static
                  keyword and they store values that can be shared by all the
                  instances of a class.




    Ver. 1.0                        Session 8                            Slide 4 of 24
Object-Oriented Programming Using C#
Constructors with Parameters


               A constructor can be modified to accept the user-supplied
               values at run time.
               Objects can be initialized using the default constructor with
               values hard-coded in the program. But there might be a
               requirement where the variables need to be initialized with
               user supplied values.




    Ver. 1.0                       Session 8                          Slide 5 of 24
Object-Oriented Programming Using C#
Implementing Destructors


               Destructors are special methods that are used to release
               the instance of a class from memory.
               A class can have only one destructor.
               The purpose of the destructor is to perform the required
               memory cleanup action.
               The .NET Framework automatically runs the destructor to
               destroy objects in the memory.




    Ver. 1.0                      Session 8                       Slide 6 of 24
Object-Oriented Programming Using C#
Declaration of Destructors


               A destructor has the same name as its class but is prefixed
               with a ~ , which is the symbol of tilde.
               Destructors cannot be inherited or overloaded.
               Garbage collection is a process that automatically frees the
               memory of objects that are no more in use.
               The decision to invoke the destructor is made by a special
               program of C# known as the garbage collector.
               The process of garbage collection happens automatically. It
               ensures that:
                  Objects get destroyed
                  Only unused objects are destroyed




    Ver. 1.0                       Session 8                        Slide 7 of 24
Object-Oriented Programming Using C#
Declaration of Destructors (Contd.)


               C# provides the following methods to release the instance
               of a class from memory:
               – Finalize(): It is a special method that is called from the class to
                 which it belongs or from the derived classes. The Finalize()
                 destructor is called after the last reference to an object is
                 released from the memory.
               – Dispose(): This method is called to release a resource, such
                 as a database connection, as soon as the object using such a
                 resource is no longer in use. The IDisposable interface
                 contains the Dispose() method. Therefore, to call the
                 Dispose() method, the class must implement the
                 IDisposable interface.




    Ver. 1.0                        Session 8                              Slide 8 of 24
Object-Oriented Programming Using C#
Identifying the Life Cycle of an Object


                Let us understand the life cycle of an object with the help of
                the following code:
                 using System;
                 //Life Cycle of an Object
                 namespace Objects
                 {
                   class TestCalculator
                   {
                     TestCalculator()
                     {
                       Console.WriteLine("Constructor Invoked");
                     }




     Ver. 1.0                       Session 8                          Slide 9 of 24
Object-Oriented Programming Using C#
Identifying the Life Cycle of an Object (Contd.)


                 ~TestCalculator()            The destructor of all
                 {                            the object is invoked
                   Console.WriteLine          when the garbage
                   ("Destructor Invoked");    collector is invoked.
                 }
                 public static void          The Calc1 object has
                 Main(string[] args)         function scope.
                 {                           Therefore, its
                   Console.WriteLine("Main() constructor is executed
                   Begins");                 after the execution of
                   TestCalculator Calc1 =    Main() begins.
                   new TestCalculator();




     Ver. 1.0                 Session 8                     Slide 10 of 24
Object-Oriented Programming Using C#
Identifying the Life Cycle of an Object (Contd.)


                ~Console.WriteLine("Inner Block     The Calc2 object has
                Begins ");                          block scope.
                TestCalculator Calc2 = new          Therefore, its
                TestCalculator();                   constructor is executed
                                                    after the inner block
                Console.WriteLine("Inner Block      begins.
                Ends");
                            }
                Console.WriteLine("Main() ends");

                          }

                      }
                }



     Ver. 1.0                    Session 8                        Slide 11 of 24
Object-Oriented Programming Using C#
Introducing Polymorphism


               In Object-Oriented Programming (OOPs), polymorphism
               allows one interface to be used for multiple functions.
               Polymorphism reduces the complexity within the functions
               of a class of a program.
               Polymorphism can either be static or dynamic.




    Ver. 1.0                      Session 8                      Slide 12 of 24
Object-Oriented Programming Using C#
Static Polymorphism


               Static polymorphism refers to an entity, which exists in
               various forms simultaneously.
               C# uses two approaches to implement static polymorphism.
               These are:
               – Function overloading: This approach allows using the same
                 name for two or more functions. Each redefinition of a function
                 must use different types of parameters, sequence of
                 parameters, or a number of parameters.
               – Operator overloading: This approach allows user-defined
                 types such as structures and classes, to use overloaded
                 operators for easy manipulation of their objects.




    Ver. 1.0                       Session 8                            Slide 13 of 24
Object-Oriented Programming Using C#
Dynamic Polymorphism


               In dynamic polymorphism, the decision about function
               execution is made at run time.
               Dynamic polymorphism is more useful than static
               polymorphism as it provides much more flexibility for
               manipulating the objects.
               C# uses two approaches to implement dynamic
               polymorphism:
                – Abstract classes: Are the special type of base classes that
                  consist of abstract class members.
                – Virtual functions: Are the functions that do not really exist,
                  however, appear to be present in some parts of the program.




    Ver. 1.0                        Session 8                            Slide 14 of 24
Object-Oriented Programming Using C#
Implementing Function Overloading


               Function overloading is implemented by defining two or
               more functions in a class sharing the same name.
               In function overloading, each definition of a function must
               differ in its function signature.




    Ver. 1.0                       Session 8                         Slide 15 of 24
Object-Oriented Programming Using C#
Function Signature


               The signature of a function is defined by:
                – The number of parameters
                – The data types of parameters
                – The sequence of the parameters




    Ver. 1.0                       Session 8                Slide 16 of 24
Object-Oriented Programming Using C#
Constructor Overloading


               Constructors can also be parameterized, and therefore,
               they can be overloaded.
               Overloaded constructors are commonly used in C# to
               provide flexibility while creating an object.




    Ver. 1.0                      Session 8                       Slide 17 of 24
Object-Oriented Programming Using C#
Demo: Displaying Days Using Function Overloading


               Problem Statement:
                  Tim has to develop a software application for a primary school.
                  The application should accept the month entered by the
                  student and display the total number of days of that month.




    Ver. 1.0                        Session 8                            Slide 18 of 24
Object-Oriented Programming Using C#
Demo: Displaying Days Using Function Overloading (Contd.)


               Solution:
                  To develop the required application, Tim needs to perform the
                  following tasks:
                   1. Create a console-based application.
                   2. Build and execute an application.




    Ver. 1.0                         Session 8                          Slide 19 of 24
Object-Oriented Programming Using C#
Operator Overloading


               Operator overloading provides additional capabilities to C#
               operators when they are applied to user-defined data types.
               Only the predefined set of C# operators can be overloaded.




    Ver. 1.0                      Session 8                        Slide 20 of 24
Object-Oriented Programming Using C#
Need for Operator Overloading


               To use operators with user-defined data types, they need to
               be overloaded according to a programmer’s requirement.
               The following table describes the overload ability of the
               operators in C#.
                Operators                Description

                +, -, ! , ~, ++ , --     These unary operators take one operand and can be
                                         overloaded.
                +, -, * , /, %           These binary operators take two operands and can be
                                         overloaded.
                ==, !=, <, >, <=, >=     The comparison operators can be overloaded.

                &&, ||                   The conditional logical operators cannot be overloaded
                                         directly, but they are evaluated using & and | which can be
                                         overloaded.
                +=, -=, *=, /=, %=       The assignment operators cannot be overloaded.
                =, ., ?:, ->, new, is,   These operators cannot be overloaded.
                sizeof, typeof



    Ver. 1.0                               Session 8                                               Slide 21 of 24
Object-Oriented Programming Using C#
Summary


              In this lesson, you learned that:
                 Constructors are member functions of a class and are invoked
                 when an instance of the class to which they belong is created.
                 A constructor has the same name as its class.
                 A destructor is invoked when any instance of a class ceases to
                 exist.
                 A destructor has the same name as its class, but it is prefixed
                 with a ~ (tilde).
                 Constructors are special methods that allow control over the
                 initialization of objects.
                 Destructors are special methods that are used to release the
                 instance of a class from memory.
                 Garbage collection is a process that automatically frees the
                 memory of objects that is no more in use.


   Ver. 1.0                        Session 8                            Slide 22 of 24
Object-Oriented Programming Using C#
Summary (Contd.)


               – The Finalize() destructor is called after the last reference
                 to an object is released from the memory.
               – The Dispose() method is called to release a resource, such
                 as a database connection, when the object using such a
                 resource is no longer in use.
               – The term polymorphism has been derived form the Greek
                 words ‘poly’ and ‘morphos’, which mean ‘many’ and ‘forms’,
                 respectively.
               – Polymorphism allows one interface to be used for multiple
                 functions.
               – Static polymorphism refers to an entity, which exists in different
                 forms simultaneously.
               – In dynamic polymorphism, the decision about function
                 execution is made when code is executed.



    Ver. 1.0                        Session 8                             Slide 23 of 24
Object-Oriented Programming Using C#
Summary (Contd.)


               Function overloading is the process of using the same name
               for two or more functions in a class.
               The number, type, or sequence of parameters of a function is
               called its function signature.
               Overloaded constructors are commonly used in C# to provide
               flexibility while creating an object.
               Operator overloading provides additional capabilities to C#
               operators when they are applied to user-defined data types.
               The predefined C# operators can be overloaded by using the
               operator keyword.
               Operators may be considered as functions internal to the
               compiler.




    Ver. 1.0                    Session 8                           Slide 24 of 24

Contenu connexe

Tendances

08 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_1108 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_11Niit Care
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01Niit Care
 
03 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_0403 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_04Niit Care
 
Java session02
Java session02Java session02
Java session02Niit Care
 
Java session01
Java session01Java session01
Java session01Niit Care
 
02 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_0202 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_02Niit Care
 
Java session11
Java session11Java session11
Java session11Niit Care
 
Win32/Flamer: Reverse Engineering and Framework Reconstruction
Win32/Flamer: Reverse Engineering and Framework ReconstructionWin32/Flamer: Reverse Engineering and Framework Reconstruction
Win32/Flamer: Reverse Engineering and Framework ReconstructionAlex Matrosov
 
NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)Ron Munitz
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of PatternsChris Eargle
 
Oop02 6
Oop02 6Oop02 6
Oop02 6schwaa
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocationRiccardo Cardin
 
Write native iPhone applications using Eclipse CDT
Write native iPhone applications using Eclipse CDTWrite native iPhone applications using Eclipse CDT
Write native iPhone applications using Eclipse CDTAtit Patumvan
 
NDK Primer (Wearable DevCon 2014)
NDK Primer (Wearable DevCon 2014)NDK Primer (Wearable DevCon 2014)
NDK Primer (Wearable DevCon 2014)Ron Munitz
 

Tendances (20)

08 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_1108 iec t1_s1_oo_ps_session_11
08 iec t1_s1_oo_ps_session_11
 
01 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_0101 iec t1_s1_oo_ps_session_01
01 iec t1_s1_oo_ps_session_01
 
03 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_0403 iec t1_s1_oo_ps_session_04
03 iec t1_s1_oo_ps_session_04
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
 
Java session02
Java session02Java session02
Java session02
 
Java session01
Java session01Java session01
Java session01
 
02 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_0202 iec t1_s1_plt_session_02
02 iec t1_s1_plt_session_02
 
Java session11
Java session11Java session11
Java session11
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Win32/Flamer: Reverse Engineering and Framework Reconstruction
Win32/Flamer: Reverse Engineering and Framework ReconstructionWin32/Flamer: Reverse Engineering and Framework Reconstruction
Win32/Flamer: Reverse Engineering and Framework Reconstruction
 
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
 
Csharp
CsharpCsharp
Csharp
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of Patterns
 
Oop02 6
Oop02 6Oop02 6
Oop02 6
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocation
 
Write native iPhone applications using Eclipse CDT
Write native iPhone applications using Eclipse CDTWrite native iPhone applications using Eclipse CDT
Write native iPhone applications using Eclipse CDT
 
NDK Primer (Wearable DevCon 2014)
NDK Primer (Wearable DevCon 2014)NDK Primer (Wearable DevCon 2014)
NDK Primer (Wearable DevCon 2014)
 

Similaire à OOP Using C# Guide

Constructors in C++.pptx
Constructors in C++.pptxConstructors in C++.pptx
Constructors in C++.pptxRassjb
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and DestructorSunipa Bera
 
Constructor destructor.ppt
Constructor destructor.pptConstructor destructor.ppt
Constructor destructor.pptKarthik Sekar
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Soumen Santra
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsakreyi
 
Constructor and Destructor in c++
Constructor  and Destructor in c++Constructor  and Destructor in c++
Constructor and Destructor in c++aleenaguen
 
Module 10 : creating and destroying objects
Module 10 : creating and destroying objectsModule 10 : creating and destroying objects
Module 10 : creating and destroying objectsPrem Kumar Badri
 
Creational Design Patterns.pptx
Creational Design Patterns.pptxCreational Design Patterns.pptx
Creational Design Patterns.pptxSachin Patidar
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in javaagorolabs
 
27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examplesQuang Suma
 

Similaire à OOP Using C# Guide (20)

7494609
74946097494609
7494609
 
C# Unit 2 notes
C# Unit 2 notesC# Unit 2 notes
C# Unit 2 notes
 
Constructors in C++.pptx
Constructors in C++.pptxConstructors in C++.pptx
Constructors in C++.pptx
 
Constructor and Destructor
Constructor and DestructorConstructor and Destructor
Constructor and Destructor
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
C++
C++C++
C++
 
C++
C++C++
C++
 
Constructor destructor.ppt
Constructor destructor.pptConstructor destructor.ppt
Constructor destructor.ppt
 
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
Java basic part 2 : Datatypes Keywords Features Components Security Exceptions
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
C# classes objects
C#  classes objectsC#  classes objects
C# classes objects
 
Oops
OopsOops
Oops
 
Constructor and Destructor in c++
Constructor  and Destructor in c++Constructor  and Destructor in c++
Constructor and Destructor in c++
 
Module 10 : creating and destroying objects
Module 10 : creating and destroying objectsModule 10 : creating and destroying objects
Module 10 : creating and destroying objects
 
Constructor in java
Constructor in javaConstructor in java
Constructor in java
 
Objective c
Objective cObjective c
Objective c
 
C# Unit 1 notes
C# Unit 1 notesC# Unit 1 notes
C# Unit 1 notes
 
Creational Design Patterns.pptx
Creational Design Patterns.pptxCreational Design Patterns.pptx
Creational Design Patterns.pptx
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
 
27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples27418524 design-patterns-dot-net-with-examples
27418524 design-patterns-dot-net-with-examples
 

Plus de Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
 

Dernier

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Dernier (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

OOP Using C# Guide

  • 1. Object-Oriented Programming Using C# Objectives In this session, you will learn to: Implement constructors Implement destructors Identify the life cycle of an object Describe polymorphism Implement function overloading Identify need for operator overloading Ver. 1.0 Session 8 Slide 1 of 24
  • 2. Object-Oriented Programming Using C# Implementing Constructors A constructor is a special type of method that is invoked when you create a new instance of a class. A constructor is used to initialize the members of the class. The name of a constructor is the same as the name of the class that contains it. Ver. 1.0 Session 8 Slide 2 of 24
  • 3. Object-Oriented Programming Using C# The Need of Constructors A constructor is special member function within the class which is executed when an object of the class is created. Ver. 1.0 Session 8 Slide 3 of 24
  • 4. Object-Oriented Programming Using C# Types of Constructors The two types of constructors are: – Instance constructors: They are called whenever an instance of a class is created. These constructors are used to initialize the data members of the class. – Static constructors: They are used to initialize the static variables of a class. These variables are created using static keyword and they store values that can be shared by all the instances of a class. Ver. 1.0 Session 8 Slide 4 of 24
  • 5. Object-Oriented Programming Using C# Constructors with Parameters A constructor can be modified to accept the user-supplied values at run time. Objects can be initialized using the default constructor with values hard-coded in the program. But there might be a requirement where the variables need to be initialized with user supplied values. Ver. 1.0 Session 8 Slide 5 of 24
  • 6. Object-Oriented Programming Using C# Implementing Destructors Destructors are special methods that are used to release the instance of a class from memory. A class can have only one destructor. The purpose of the destructor is to perform the required memory cleanup action. The .NET Framework automatically runs the destructor to destroy objects in the memory. Ver. 1.0 Session 8 Slide 6 of 24
  • 7. Object-Oriented Programming Using C# Declaration of Destructors A destructor has the same name as its class but is prefixed with a ~ , which is the symbol of tilde. Destructors cannot be inherited or overloaded. Garbage collection is a process that automatically frees the memory of objects that are no more in use. The decision to invoke the destructor is made by a special program of C# known as the garbage collector. The process of garbage collection happens automatically. It ensures that: Objects get destroyed Only unused objects are destroyed Ver. 1.0 Session 8 Slide 7 of 24
  • 8. Object-Oriented Programming Using C# Declaration of Destructors (Contd.) C# provides the following methods to release the instance of a class from memory: – Finalize(): It is a special method that is called from the class to which it belongs or from the derived classes. The Finalize() destructor is called after the last reference to an object is released from the memory. – Dispose(): This method is called to release a resource, such as a database connection, as soon as the object using such a resource is no longer in use. The IDisposable interface contains the Dispose() method. Therefore, to call the Dispose() method, the class must implement the IDisposable interface. Ver. 1.0 Session 8 Slide 8 of 24
  • 9. Object-Oriented Programming Using C# Identifying the Life Cycle of an Object Let us understand the life cycle of an object with the help of the following code: using System; //Life Cycle of an Object namespace Objects { class TestCalculator { TestCalculator() { Console.WriteLine("Constructor Invoked"); } Ver. 1.0 Session 8 Slide 9 of 24
  • 10. Object-Oriented Programming Using C# Identifying the Life Cycle of an Object (Contd.) ~TestCalculator() The destructor of all { the object is invoked Console.WriteLine when the garbage ("Destructor Invoked"); collector is invoked. } public static void The Calc1 object has Main(string[] args) function scope. { Therefore, its Console.WriteLine("Main() constructor is executed Begins"); after the execution of TestCalculator Calc1 = Main() begins. new TestCalculator(); Ver. 1.0 Session 8 Slide 10 of 24
  • 11. Object-Oriented Programming Using C# Identifying the Life Cycle of an Object (Contd.) ~Console.WriteLine("Inner Block The Calc2 object has Begins "); block scope. TestCalculator Calc2 = new Therefore, its TestCalculator(); constructor is executed after the inner block Console.WriteLine("Inner Block begins. Ends"); } Console.WriteLine("Main() ends"); } } } Ver. 1.0 Session 8 Slide 11 of 24
  • 12. Object-Oriented Programming Using C# Introducing Polymorphism In Object-Oriented Programming (OOPs), polymorphism allows one interface to be used for multiple functions. Polymorphism reduces the complexity within the functions of a class of a program. Polymorphism can either be static or dynamic. Ver. 1.0 Session 8 Slide 12 of 24
  • 13. Object-Oriented Programming Using C# Static Polymorphism Static polymorphism refers to an entity, which exists in various forms simultaneously. C# uses two approaches to implement static polymorphism. These are: – Function overloading: This approach allows using the same name for two or more functions. Each redefinition of a function must use different types of parameters, sequence of parameters, or a number of parameters. – Operator overloading: This approach allows user-defined types such as structures and classes, to use overloaded operators for easy manipulation of their objects. Ver. 1.0 Session 8 Slide 13 of 24
  • 14. Object-Oriented Programming Using C# Dynamic Polymorphism In dynamic polymorphism, the decision about function execution is made at run time. Dynamic polymorphism is more useful than static polymorphism as it provides much more flexibility for manipulating the objects. C# uses two approaches to implement dynamic polymorphism: – Abstract classes: Are the special type of base classes that consist of abstract class members. – Virtual functions: Are the functions that do not really exist, however, appear to be present in some parts of the program. Ver. 1.0 Session 8 Slide 14 of 24
  • 15. Object-Oriented Programming Using C# Implementing Function Overloading Function overloading is implemented by defining two or more functions in a class sharing the same name. In function overloading, each definition of a function must differ in its function signature. Ver. 1.0 Session 8 Slide 15 of 24
  • 16. Object-Oriented Programming Using C# Function Signature The signature of a function is defined by: – The number of parameters – The data types of parameters – The sequence of the parameters Ver. 1.0 Session 8 Slide 16 of 24
  • 17. Object-Oriented Programming Using C# Constructor Overloading Constructors can also be parameterized, and therefore, they can be overloaded. Overloaded constructors are commonly used in C# to provide flexibility while creating an object. Ver. 1.0 Session 8 Slide 17 of 24
  • 18. Object-Oriented Programming Using C# Demo: Displaying Days Using Function Overloading Problem Statement: Tim has to develop a software application for a primary school. The application should accept the month entered by the student and display the total number of days of that month. Ver. 1.0 Session 8 Slide 18 of 24
  • 19. Object-Oriented Programming Using C# Demo: Displaying Days Using Function Overloading (Contd.) Solution: To develop the required application, Tim needs to perform the following tasks: 1. Create a console-based application. 2. Build and execute an application. Ver. 1.0 Session 8 Slide 19 of 24
  • 20. Object-Oriented Programming Using C# Operator Overloading Operator overloading provides additional capabilities to C# operators when they are applied to user-defined data types. Only the predefined set of C# operators can be overloaded. Ver. 1.0 Session 8 Slide 20 of 24
  • 21. Object-Oriented Programming Using C# Need for Operator Overloading To use operators with user-defined data types, they need to be overloaded according to a programmer’s requirement. The following table describes the overload ability of the operators in C#. Operators Description +, -, ! , ~, ++ , -- These unary operators take one operand and can be overloaded. +, -, * , /, % These binary operators take two operands and can be overloaded. ==, !=, <, >, <=, >= The comparison operators can be overloaded. &&, || The conditional logical operators cannot be overloaded directly, but they are evaluated using & and | which can be overloaded. +=, -=, *=, /=, %= The assignment operators cannot be overloaded. =, ., ?:, ->, new, is, These operators cannot be overloaded. sizeof, typeof Ver. 1.0 Session 8 Slide 21 of 24
  • 22. Object-Oriented Programming Using C# Summary In this lesson, you learned that: Constructors are member functions of a class and are invoked when an instance of the class to which they belong is created. A constructor has the same name as its class. A destructor is invoked when any instance of a class ceases to exist. A destructor has the same name as its class, but it is prefixed with a ~ (tilde). Constructors are special methods that allow control over the initialization of objects. Destructors are special methods that are used to release the instance of a class from memory. Garbage collection is a process that automatically frees the memory of objects that is no more in use. Ver. 1.0 Session 8 Slide 22 of 24
  • 23. Object-Oriented Programming Using C# Summary (Contd.) – The Finalize() destructor is called after the last reference to an object is released from the memory. – The Dispose() method is called to release a resource, such as a database connection, when the object using such a resource is no longer in use. – The term polymorphism has been derived form the Greek words ‘poly’ and ‘morphos’, which mean ‘many’ and ‘forms’, respectively. – Polymorphism allows one interface to be used for multiple functions. – Static polymorphism refers to an entity, which exists in different forms simultaneously. – In dynamic polymorphism, the decision about function execution is made when code is executed. Ver. 1.0 Session 8 Slide 23 of 24
  • 24. Object-Oriented Programming Using C# Summary (Contd.) Function overloading is the process of using the same name for two or more functions in a class. The number, type, or sequence of parameters of a function is called its function signature. Overloaded constructors are commonly used in C# to provide flexibility while creating an object. Operator overloading provides additional capabilities to C# operators when they are applied to user-defined data types. The predefined C# operators can be overloaded by using the operator keyword. Operators may be considered as functions internal to the compiler. Ver. 1.0 Session 8 Slide 24 of 24

Notes de l'éditeur

  1. Students have learnt the structure of different types of dimensions and the importance of surrogate keys in Module I. In this session, students will learn to load the data into the dimension tables after the data has been transformed in the transformation phase. In addition, students will also learn to update data into these dimension tables. Students already know about different types of dimension tables. Therefore, you can start the session by recapitulating the concepts. Initiate the class by asking the following questions: 1. What are the different types of dimensions? 2. Define flat dimension. 3. What are conformed dimension? 4. Define large dimension. 5. Define small dimension. 6. What is the importance of surrogate key in a dimension table? Students will learn the loading and update strategies theoretically in this session. The demonstration to load and update the data in the dimension table will be covered in next session.
  2. Students know the importance of surrogate keys. In this session students will learn the strategy to generate the surrogate key. Give an example to explain the strategy to generate the surrogate keys by concatenating the primary key of the source table with the date stamp. For example, data from a Product table has to be loaded into the Product_Dim dimension table on Feb 09, 2006. The product_code is the primary key column in the Product table. To insert the surrogate key values before loading the data into the dimension table, you can combine the primary key value with the date on which the data has to be loaded. In this case the surrogate key value can be product_code+09022006.
  3. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  4. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  5. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  6. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  7. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  8. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  9. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  10. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  11. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  12. Students know the importance of surrogate keys. In this session students will learn the strategy to generate the surrogate key. Give an example to explain the strategy to generate the surrogate keys by concatenating the primary key of the source table with the date stamp. For example, data from a Product table has to be loaded into the Product_Dim dimension table on Feb 09, 2006. The product_code is the primary key column in the Product table. To insert the surrogate key values before loading the data into the dimension table, you can combine the primary key value with the date on which the data has to be loaded. In this case the surrogate key value can be product_code+09022006.
  13. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  14. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  15. Students know what is the structure of Flat dimension. You can initiate the session by asking the following questions: 1. What are flat dimension tables? 2. What is the structure of flat dimension? 3. Given examples of a flat dimension? Next, tell the strategy to load the data into the flat dimension table. You can explain the loading strategy with the help of the example given in SG. Continue this session by asking the following questions: 4. What are large flat dimension tables? 5. Give examples of large flat dimensions? Then, explain the strategy to load data into the large flat dimension table. Before explaining the strategy to load data into the small dimension table ask the following questions and the tell the strategy to load the data into the dimension table. 6. What are small flat dimension tables? 7. Give examples of small flat dimension tables. With the help of these questions, students will be able to recall about flat dimensions, they have learnt in Module I. Explain this topic with the help of an example given in SG.
  16. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  17. Student already have learnt about type 2 SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 2 SCDs? Given an example to explain type 2 SCDs. This will recapitulate what they have learnt about type 2 SCD in Module 1. Now explain the strategy to update the data into these dimension tables with help the example given in SG. After explaining the examples, you can ask students to think of an example of a type 2 SCD and then tell the strategy to update the data into this dimension table.
  18. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  19. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  20. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  21. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  22. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.
  23. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.
  24. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.