SlideShare a Scribd company logo
1 of 31
Object-Oriented Programming Using C#
Objectives


                In this session, you will learn to:
                   Implement multiple threads
                   Identify the thread priority
                   Use synchronization in threads
                   Identify communication between processes
                   Declare delegates
                   Instantiate delegate




     Ver. 1.0                        Session 16               Slide 1 of 31
Object-Oriented Programming Using C#
Demo: Hangman Game


               Problem Statement:
                  The next door children request you to create the Hangman
                  game for them. The game asks a user to enter a category as
                  Book or Movie. Based on the category, a book name or movie
                  name is extracted and the user is asked to guess the name by
                  giving the character and its position in a string. A user will get
                  60 seconds to play the game.
                  Develop the Hangman game application.




    Ver. 1.0                        Session 16                              Slide 2 of 31
Object-Oriented Programming Using C#
Demo: Hangman Game (Contd.)


               Solution:
                  To solve the preceding problem, you need to perform the
                  following tasks:
                   1. Identify the data source where the name of the book or movie is
                      stored.
                   2. Create a console-based application for the Hangman game.
                   3. Build and execute the application.




    Ver. 1.0                         Session 16                               Slide 3 of 31
Object-Oriented Programming Using C#
Introducing Multithreading


                Multithreading helps to perform various operations
                simultaneously and saves users’ time.
                Multithreading allows you to achieve multitasking in a
                program.
                Multitasking is the ability to execute more than one task at
                the same time.
                Multitasking can be divided into the following categories:
                   Process-based multitasking
                   Thread-based multitasking


                Let us understand multithreading with the help of an
                example.



     Ver. 1.0                       Session 16                         Slide 4 of 31
Object-Oriented Programming Using C#



                 A lady is working on a computer.




   Ver. 1.0            Session 16                   Slide 5 of 31
Object-Oriented Programming Using C#



              The lady is eating an apple, reading a book, and working on a
                                computer simultaneously.




   Ver. 1.0                        Session 16                       Slide 6 of 31
Object-Oriented Programming Using C#
Advantages of Multithreading


                The advantages of multithreading are:
                   Improved performance
                   Minimized system resource usage
                   Simultaneous access to multiple applications
                   Program structure simplification




     Ver. 1.0                       Session 16                    Slide 7 of 31
Object-Oriented Programming Using C#
Limitations of Multithreading


                The limitations of multithreading are:
                   Race condition
                   Deadlock condition
                   Lock starvation




     Ver. 1.0                       Session 16           Slide 8 of 31
Object-Oriented Programming Using C#
Creating Multiple Threads


                • You can create multiple threads in a program by extending
                  the Thread class.




     Ver. 1.0                        Session 16                      Slide 9 of 31
Object-Oriented Programming Using C#
Identifying the Thread Priority


                One of the attributes that controls the behavior of a thread is
                its priority.
                The .NET Runtime Environment executes threads based on
                their priority.
                The threads are fixed-priority scheduled. Each thread with
                its priority has its position in the thread queue of the
                processor.




     Ver. 1.0                       Session 16                         Slide 10 of 31
Object-Oriented Programming Using C#
Defining Thread Priority


                Thread priority is the property that specifies the priority of
                one thread with respect to the priority of another thread.
                Thread priority can be defined as:
                 –   Above normal
                 –   Below normal
                 –   Highest
                 –   Lowest
                 –   Normal
                A thread with higher priority runs before threads, which
                have lower priority.
                If C# encounters another thread with higher priority, the
                current thread is pushed back, and the thread with the
                higher priority is executed.


     Ver. 1.0                       Session 16                           Slide 11 of 31
Object-Oriented Programming Using C#
Setting the Thread Priority


                • You can set the thread priority after it is created using the
                  Priority property of the Thread class.
                • The following syntax shows how to set the thread priority:
                   NewThread.Priority =
                   ThreadPriority.Highest;




     Ver. 1.0                          Session 16                         Slide 12 of 31
Object-Oriented Programming Using C#
Setting the Thread Priority (Contd.)


                NewThread.Priority =           ThreadPriority.Highest
                ThreadPriority.Highest;        Property
                                               Specifies the new
                                               priority setting for a
                                               thread




     Ver. 1.0                     Session 16                   Slide 13 of 31
Object-Oriented Programming Using C#
Setting the Thread Priority (Contd.)


                If multiple threads with the same priority are available, the
                scheduler cycles through the threads in that priority, giving
                each thread a fixed time slice in which to execute.
                As long as a thread with a higher priority is available to run,
                lower priority threads do not get to execute.
                When there are no more runnable threads at a given
                priority, the scheduler moves to the next lower priority and
                schedules the threads at that priority for execution.




     Ver. 1.0                       Session 16                          Slide 14 of 31
Object-Oriented Programming Using C#
Using Synchronization in Threads


                In a multithreaded application, when threads need to share
                data with each other, the application should ensure that one
                thread does not change the data used by the other thread.
                C# enables you to coordinate the actions of multiple threads
                by using synchronized methods or synchronized
                statements.




     Ver. 1.0                      Session 16                       Slide 15 of 31
Object-Oriented Programming Using C#
Synchronizing Threads


                • Synchronization of threads ensures that if two or more
                  threads need to access a shared resource then that
                  resource is used by only one thread at a time.
                • You can synchronize your code using the synchronized
                  keyword.
                • Synchronization is based on the concept of monitoring. A
                  monitor is an object that is used as a lock to the data
                  members and methods of a class.




     Ver. 1.0                        Session 16                     Slide 16 of 31
Object-Oriented Programming Using C#
Synchronizing Threads (Contd.)


                The following figure shows how synchronization is
                maintained among threads.




     Ver. 1.0                     Session 16                        Slide 17 of 31
Object-Oriented Programming Using C#
Locking Code Using the Monitor Locks


                • The System.Monitor class enables you to serialize the
                  access to blocks of code by means of locks and signals.




     Ver. 1.0                        Session 16                     Slide 18 of 31
Object-Oriented Programming Using C#
Using Monitor Locks with the C# Lock Statement


                • The other way to lock code is by using the C# lock
                  statement.
                • Although the C# lock statement does not support the full
                  array of features found in the Monitor class, it enables you
                  to obtain and release a monitor lock.
                • To use the lock statement, simply specify the lock statement
                  with the code being serialized in braces.
                • The braces indicate the starting and stopping point of code
                  being protected.




     Ver. 1.0                        Session 16                       Slide 19 of 31
Object-Oriented Programming Using C#
Communication Between Processes


               A process is a running instance of a program.
               The communication between the processes at run time
               within the same computer or over a network is called the
               interprocess communication.
               To allow communication between various processes with a
               unique address space, the operating system's kernel acts
               as the communication channel.




    Ver. 1.0                     Session 16                      Slide 20 of 31
Object-Oriented Programming Using C#
Application Domain


                In .NET, threads execute in an application domain. A thread
                in one process cannot invoke a method in a thread that
                belongs to another process.
                In .NET, however, threads can cross the application domain
                boundaries, and a method in one thread can call a method
                of another application domain.
                The application domain is a logical process inside a
                physical process.




     Ver. 1.0                      Session 16                      Slide 21 of 31
Object-Oriented Programming Using C#
Application Domain (Contd.)


                The following figure shows application domains interacting
                with each other.




     Ver. 1.0                      Session 16                       Slide 22 of 31
Object-Oriented Programming Using C#
Application Domain (Contd.)


                • The main purpose of application domain is to isolate your
                  applications from other applications.
                • Application domains run on a single process.
                • You use the System.AppDomain class to manage
                  application domains.




     Ver. 1.0                        Session 16                       Slide 23 of 31
Object-Oriented Programming Using C#
Introducing Delegates


                Delegates in C# allow you to dynamically change the
                reference to the methods in a class.
                A delegate is a reference type variable, which holds the
                reference to a method.
                Delegates are a general-purpose mechanism for indirectly
                calling methods at runtime. Primary use of delegates in C#
                programming is for implementing events and the call-back
                methods.
                To implement delegates in your application you need to
                declare delegates, instantiate delegates and use delegates.




     Ver. 1.0                      Session 16                       Slide 24 of 31
Object-Oriented Programming Using C#
Declaring Delegates


                The methods that can be referenced by a delegate are
                determined by the delegate declaration.
                The delegate can refer to the methods, which have the
                same signature as that of the delegate.




     Ver. 1.0                     Session 16                       Slide 25 of 31
Object-Oriented Programming Using C#
Declaring Delegates (Contd.)


                Following is the syntax of delegate declaration:
                 delegate<return type><delegate-
                 name>(<parameter list>)




     Ver. 1.0                      Session 16                      Slide 26 of 31
Object-Oriented Programming Using C#
Instantiating Delegates


                Assign the address of the required method to the delegate
                object.
                This can be done by calling the constructor of the delegate
                class and passing the method name.




     Ver. 1.0                      Session 16                        Slide 27 of 31
Object-Oriented Programming Using C#
Instantiating Delegates (Contd.)


                The following example shows how to assign the address of
                a method to a delegate variable:
                 public void DelegateFunction(string
                 PassValue)
                 {
                 // Method implementation Here
                 }
                 //Delegate Declaration
                   public delegate void MyDelegate(string
                   ArgValue);
                 public void UseMethod()
                 {
                 //Delegate Instantiation
                   MyDelegate DelegateObject = new
                   MyDelegate(DelegateFunction);
                 }
     Ver. 1.0                     Session 16                      Slide 28 of 31
Object-Oriented Programming Using C#
Summary


               In this session, you learned the text format would be
               All the information stored in that:
               displayed on of screen as text.
                    The types a multitasking are:
               This means 'A' will be written as 'A' in the files.
                     • Process-based multitasking
                     • Thread-based multitasking
               Similarly, the number –12345.678 will be written as the
               string "-12345.678". multithreading are:
                    The advantages of
                     • Improved performance
               This means that you can directly display the contents of the
                     • Minimized system resources usage
               file on the screen. access to multiple applications
                     • Simultaneous
                  The limitations of multithreading are:
                      Race condition
                      Deadlock condition
                      Lock starvation




    Ver. 1.0                        Session 16                      Slide 29 of 31
Object-Oriented Programming Using C#
Summary (Contd.)


                 – The System.Threading the text format would be
               All the information stored in class is used to construct and
               displayed on a screen as text. multithreaded application.
                    access individual threads in a
                 – Thread priority is the property that in the files.
               This means 'A' will be written as 'A'specifies the priority of one
                    thread with respect to the priority of another thread.
               Similarly, the number –12345.678 will be written as the
                 – Synchronization of threads ensures that if two or more threads
               string "-12345.678".shared resource then that resource is used
                    need to access a
               This means that you at a time.
                    by only one thread can directly display the contents of the
               file on the screen.
                 – The System.Monitor class enables you to serialize the
                  access to blocks of code by means of locks and signals.
                – The communication between processes at runtime within the
                  same computer or over a network is called interprocess
                  communication.




    Ver. 1.0                        Session 16                           Slide 30 of 31
Object-Oriented Programming Using C#
Summary (Contd.)


               All the informationdomain is athe textprocess inside abe
                    The application stored in logical format would physical
               displayed on a screen as text. the application domain is to
                    process. The main purpose of
                    isolate your applications from the other applications.
               This means 'A' will be written as 'A' in the files.
                    Delegates allow you to write code that can dynamically change
               Similarly, the numbercalls.
                    the methods that it –12345.678 will be written as the
               string "-12345.678".
               This means that you can directly display the contents of the
               file on the screen.




    Ver. 1.0                        Session 16                           Slide 31 of 31

More Related Content

What's hot

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
 
09 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_1309 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_13Niit 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
 
01 gui 01
01 gui 0101 gui 01
01 gui 01Niit 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 session02
Java session02Java session02
Java session02Niit Care
 
Java session01
Java session01Java session01
Java session01Niit 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
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 cNiit Care
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 aNiit Care
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of PatternsChris Eargle
 
Fudcon D programming
Fudcon D programmingFudcon D programming
Fudcon D programmingJonathan Mercier
 
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
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusingumlAPU
 
Oop02 6
Oop02 6Oop02 6
Oop02 6schwaa
 
NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)Ron Munitz
 

What's hot (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
 
09 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_1309 iec t1_s1_oo_ps_session_13
09 iec t1_s1_oo_ps_session_13
 
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
 
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 session02
Java session02Java session02
Java session02
 
Java session01
Java session01Java session01
Java session01
 
Java session11
Java session11Java session11
Java session11
 
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-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of Patterns
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
 
Csharp
CsharpCsharp
Csharp
 
Fudcon D programming
Fudcon D programmingFudcon D programming
Fudcon D programming
 
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
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusinguml
 
Oop02 6
Oop02 6Oop02 6
Oop02 6
 
NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)
 

Viewers also liked

02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02Pooja Gupta
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02Niit Care
 
C# Advanced L04-Threading
C# Advanced L04-ThreadingC# Advanced L04-Threading
C# Advanced L04-ThreadingMohammad Shaker
 
Intro To .Net Threads
Intro To .Net ThreadsIntro To .Net Threads
Intro To .Net Threadsrchakra
 
Threading in C#
Threading in C#Threading in C#
Threading in C#Medhat Dawoud
 
Threading in c#
Threading in c#Threading in c#
Threading in c#gohsiauken
 

Viewers also liked (7)

02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 
C# Advanced L04-Threading
C# Advanced L04-ThreadingC# Advanced L04-Threading
C# Advanced L04-Threading
 
Threads c sharp
Threads c sharpThreads c sharp
Threads c sharp
 
Intro To .Net Threads
Intro To .Net ThreadsIntro To .Net Threads
Intro To .Net Threads
 
Threading in C#
Threading in C#Threading in C#
Threading in C#
 
Threading in c#
Threading in c#Threading in c#
Threading in c#
 

Similar to 11 iec t1_s1_oo_ps_session_16

09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13Niit Care
 
09 gui 13
09 gui 1309 gui 13
09 gui 13Niit Care
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13Vivek chan
 
Enabling Cloud Native Buildpacks for Windows Containers
Enabling Cloud Native Buildpacks for Windows ContainersEnabling Cloud Native Buildpacks for Windows Containers
Enabling Cloud Native Buildpacks for Windows ContainersVMware Tanzu
 
MERIMeeting du 27 mai 2014 - Parallel Programming
MERIMeeting du 27 mai 2014 - Parallel ProgrammingMERIMeeting du 27 mai 2014 - Parallel Programming
MERIMeeting du 27 mai 2014 - Parallel ProgrammingOlivier NAVARRE
 
New Features in Dotnet Niku Software
New Features in Dotnet Niku SoftwareNew Features in Dotnet Niku Software
New Features in Dotnet Niku SoftwareJaganathRao
 
[iOS] Multiple Background Threads
[iOS] Multiple Background Threads[iOS] Multiple Background Threads
[iOS] Multiple Background ThreadsNikmesoft Ltd
 
Concurrency in c#
Concurrency in c#Concurrency in c#
Concurrency in c#RezaHamidpour
 
Neural Networks with Google TensorFlow
Neural Networks with Google TensorFlowNeural Networks with Google TensorFlow
Neural Networks with Google TensorFlowDarshan Patel
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaSteve Fort
 
Training course lect1
Training course lect1Training course lect1
Training course lect1Noor Dhiya
 
Java lab zero lecture
Java  lab  zero lectureJava  lab  zero lecture
Java lab zero lecturevishal choudhary
 

Similar to 11 iec t1_s1_oo_ps_session_16 (20)

09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
 
09 gui 13
09 gui 1309 gui 13
09 gui 13
 
Multithreading
MultithreadingMultithreading
Multithreading
 
09 intel v_tune_session_13
09 intel v_tune_session_1309 intel v_tune_session_13
09 intel v_tune_session_13
 
Enabling Cloud Native Buildpacks for Windows Containers
Enabling Cloud Native Buildpacks for Windows ContainersEnabling Cloud Native Buildpacks for Windows Containers
Enabling Cloud Native Buildpacks for Windows Containers
 
MERIMeeting du 27 mai 2014 - Parallel Programming
MERIMeeting du 27 mai 2014 - Parallel ProgrammingMERIMeeting du 27 mai 2014 - Parallel Programming
MERIMeeting du 27 mai 2014 - Parallel Programming
 
Sucet os module_2_notes
Sucet os module_2_notesSucet os module_2_notes
Sucet os module_2_notes
 
New Features in Dotnet Niku Software
New Features in Dotnet Niku SoftwareNew Features in Dotnet Niku Software
New Features in Dotnet Niku Software
 
Concept of thread
Concept of threadConcept of thread
Concept of thread
 
[iOS] Multiple Background Threads
[iOS] Multiple Background Threads[iOS] Multiple Background Threads
[iOS] Multiple Background Threads
 
Java multi thread programming on cmp system
Java multi thread programming on cmp systemJava multi thread programming on cmp system
Java multi thread programming on cmp system
 
C# note
C# noteC# note
C# note
 
Concurrency in c#
Concurrency in c#Concurrency in c#
Concurrency in c#
 
Neural Networks with Google TensorFlow
Neural Networks with Google TensorFlowNeural Networks with Google TensorFlow
Neural Networks with Google TensorFlow
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Mini Project- Internet Security Mechanisms
Mini Project- Internet Security MechanismsMini Project- Internet Security Mechanisms
Mini Project- Internet Security Mechanisms
 
Training course lect1
Training course lect1Training course lect1
Training course lect1
 
Java lab zero lecture
Java  lab  zero lectureJava  lab  zero lecture
Java lab zero lecture
 
Hack the whale
Hack the whaleHack the whale
Hack the whale
 
Resume
ResumeResume
Resume
 

More from Niit Care

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

More from 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
 

Recently uploaded

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
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
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
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
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
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
 
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
 
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
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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...
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

11 iec t1_s1_oo_ps_session_16

  • 1. Object-Oriented Programming Using C# Objectives In this session, you will learn to: Implement multiple threads Identify the thread priority Use synchronization in threads Identify communication between processes Declare delegates Instantiate delegate Ver. 1.0 Session 16 Slide 1 of 31
  • 2. Object-Oriented Programming Using C# Demo: Hangman Game Problem Statement: The next door children request you to create the Hangman game for them. The game asks a user to enter a category as Book or Movie. Based on the category, a book name or movie name is extracted and the user is asked to guess the name by giving the character and its position in a string. A user will get 60 seconds to play the game. Develop the Hangman game application. Ver. 1.0 Session 16 Slide 2 of 31
  • 3. Object-Oriented Programming Using C# Demo: Hangman Game (Contd.) Solution: To solve the preceding problem, you need to perform the following tasks: 1. Identify the data source where the name of the book or movie is stored. 2. Create a console-based application for the Hangman game. 3. Build and execute the application. Ver. 1.0 Session 16 Slide 3 of 31
  • 4. Object-Oriented Programming Using C# Introducing Multithreading Multithreading helps to perform various operations simultaneously and saves users’ time. Multithreading allows you to achieve multitasking in a program. Multitasking is the ability to execute more than one task at the same time. Multitasking can be divided into the following categories: Process-based multitasking Thread-based multitasking Let us understand multithreading with the help of an example. Ver. 1.0 Session 16 Slide 4 of 31
  • 5. Object-Oriented Programming Using C# A lady is working on a computer. Ver. 1.0 Session 16 Slide 5 of 31
  • 6. Object-Oriented Programming Using C# The lady is eating an apple, reading a book, and working on a computer simultaneously. Ver. 1.0 Session 16 Slide 6 of 31
  • 7. Object-Oriented Programming Using C# Advantages of Multithreading The advantages of multithreading are: Improved performance Minimized system resource usage Simultaneous access to multiple applications Program structure simplification Ver. 1.0 Session 16 Slide 7 of 31
  • 8. Object-Oriented Programming Using C# Limitations of Multithreading The limitations of multithreading are: Race condition Deadlock condition Lock starvation Ver. 1.0 Session 16 Slide 8 of 31
  • 9. Object-Oriented Programming Using C# Creating Multiple Threads • You can create multiple threads in a program by extending the Thread class. Ver. 1.0 Session 16 Slide 9 of 31
  • 10. Object-Oriented Programming Using C# Identifying the Thread Priority One of the attributes that controls the behavior of a thread is its priority. The .NET Runtime Environment executes threads based on their priority. The threads are fixed-priority scheduled. Each thread with its priority has its position in the thread queue of the processor. Ver. 1.0 Session 16 Slide 10 of 31
  • 11. Object-Oriented Programming Using C# Defining Thread Priority Thread priority is the property that specifies the priority of one thread with respect to the priority of another thread. Thread priority can be defined as: – Above normal – Below normal – Highest – Lowest – Normal A thread with higher priority runs before threads, which have lower priority. If C# encounters another thread with higher priority, the current thread is pushed back, and the thread with the higher priority is executed. Ver. 1.0 Session 16 Slide 11 of 31
  • 12. Object-Oriented Programming Using C# Setting the Thread Priority • You can set the thread priority after it is created using the Priority property of the Thread class. • The following syntax shows how to set the thread priority: NewThread.Priority = ThreadPriority.Highest; Ver. 1.0 Session 16 Slide 12 of 31
  • 13. Object-Oriented Programming Using C# Setting the Thread Priority (Contd.) NewThread.Priority = ThreadPriority.Highest ThreadPriority.Highest; Property Specifies the new priority setting for a thread Ver. 1.0 Session 16 Slide 13 of 31
  • 14. Object-Oriented Programming Using C# Setting the Thread Priority (Contd.) If multiple threads with the same priority are available, the scheduler cycles through the threads in that priority, giving each thread a fixed time slice in which to execute. As long as a thread with a higher priority is available to run, lower priority threads do not get to execute. When there are no more runnable threads at a given priority, the scheduler moves to the next lower priority and schedules the threads at that priority for execution. Ver. 1.0 Session 16 Slide 14 of 31
  • 15. Object-Oriented Programming Using C# Using Synchronization in Threads In a multithreaded application, when threads need to share data with each other, the application should ensure that one thread does not change the data used by the other thread. C# enables you to coordinate the actions of multiple threads by using synchronized methods or synchronized statements. Ver. 1.0 Session 16 Slide 15 of 31
  • 16. Object-Oriented Programming Using C# Synchronizing Threads • Synchronization of threads ensures that if two or more threads need to access a shared resource then that resource is used by only one thread at a time. • You can synchronize your code using the synchronized keyword. • Synchronization is based on the concept of monitoring. A monitor is an object that is used as a lock to the data members and methods of a class. Ver. 1.0 Session 16 Slide 16 of 31
  • 17. Object-Oriented Programming Using C# Synchronizing Threads (Contd.) The following figure shows how synchronization is maintained among threads. Ver. 1.0 Session 16 Slide 17 of 31
  • 18. Object-Oriented Programming Using C# Locking Code Using the Monitor Locks • The System.Monitor class enables you to serialize the access to blocks of code by means of locks and signals. Ver. 1.0 Session 16 Slide 18 of 31
  • 19. Object-Oriented Programming Using C# Using Monitor Locks with the C# Lock Statement • The other way to lock code is by using the C# lock statement. • Although the C# lock statement does not support the full array of features found in the Monitor class, it enables you to obtain and release a monitor lock. • To use the lock statement, simply specify the lock statement with the code being serialized in braces. • The braces indicate the starting and stopping point of code being protected. Ver. 1.0 Session 16 Slide 19 of 31
  • 20. Object-Oriented Programming Using C# Communication Between Processes A process is a running instance of a program. The communication between the processes at run time within the same computer or over a network is called the interprocess communication. To allow communication between various processes with a unique address space, the operating system's kernel acts as the communication channel. Ver. 1.0 Session 16 Slide 20 of 31
  • 21. Object-Oriented Programming Using C# Application Domain In .NET, threads execute in an application domain. A thread in one process cannot invoke a method in a thread that belongs to another process. In .NET, however, threads can cross the application domain boundaries, and a method in one thread can call a method of another application domain. The application domain is a logical process inside a physical process. Ver. 1.0 Session 16 Slide 21 of 31
  • 22. Object-Oriented Programming Using C# Application Domain (Contd.) The following figure shows application domains interacting with each other. Ver. 1.0 Session 16 Slide 22 of 31
  • 23. Object-Oriented Programming Using C# Application Domain (Contd.) • The main purpose of application domain is to isolate your applications from other applications. • Application domains run on a single process. • You use the System.AppDomain class to manage application domains. Ver. 1.0 Session 16 Slide 23 of 31
  • 24. Object-Oriented Programming Using C# Introducing Delegates Delegates in C# allow you to dynamically change the reference to the methods in a class. A delegate is a reference type variable, which holds the reference to a method. Delegates are a general-purpose mechanism for indirectly calling methods at runtime. Primary use of delegates in C# programming is for implementing events and the call-back methods. To implement delegates in your application you need to declare delegates, instantiate delegates and use delegates. Ver. 1.0 Session 16 Slide 24 of 31
  • 25. Object-Oriented Programming Using C# Declaring Delegates The methods that can be referenced by a delegate are determined by the delegate declaration. The delegate can refer to the methods, which have the same signature as that of the delegate. Ver. 1.0 Session 16 Slide 25 of 31
  • 26. Object-Oriented Programming Using C# Declaring Delegates (Contd.) Following is the syntax of delegate declaration: delegate<return type><delegate- name>(<parameter list>) Ver. 1.0 Session 16 Slide 26 of 31
  • 27. Object-Oriented Programming Using C# Instantiating Delegates Assign the address of the required method to the delegate object. This can be done by calling the constructor of the delegate class and passing the method name. Ver. 1.0 Session 16 Slide 27 of 31
  • 28. Object-Oriented Programming Using C# Instantiating Delegates (Contd.) The following example shows how to assign the address of a method to a delegate variable: public void DelegateFunction(string PassValue) { // Method implementation Here } //Delegate Declaration public delegate void MyDelegate(string ArgValue); public void UseMethod() { //Delegate Instantiation MyDelegate DelegateObject = new MyDelegate(DelegateFunction); } Ver. 1.0 Session 16 Slide 28 of 31
  • 29. Object-Oriented Programming Using C# Summary In this session, you learned the text format would be All the information stored in that: displayed on of screen as text. The types a multitasking are: This means 'A' will be written as 'A' in the files. • Process-based multitasking • Thread-based multitasking Similarly, the number –12345.678 will be written as the string "-12345.678". multithreading are: The advantages of • Improved performance This means that you can directly display the contents of the • Minimized system resources usage file on the screen. access to multiple applications • Simultaneous The limitations of multithreading are: Race condition Deadlock condition Lock starvation Ver. 1.0 Session 16 Slide 29 of 31
  • 30. Object-Oriented Programming Using C# Summary (Contd.) – The System.Threading the text format would be All the information stored in class is used to construct and displayed on a screen as text. multithreaded application. access individual threads in a – Thread priority is the property that in the files. This means 'A' will be written as 'A'specifies the priority of one thread with respect to the priority of another thread. Similarly, the number –12345.678 will be written as the – Synchronization of threads ensures that if two or more threads string "-12345.678".shared resource then that resource is used need to access a This means that you at a time. by only one thread can directly display the contents of the file on the screen. – The System.Monitor class enables you to serialize the access to blocks of code by means of locks and signals. – The communication between processes at runtime within the same computer or over a network is called interprocess communication. Ver. 1.0 Session 16 Slide 30 of 31
  • 31. Object-Oriented Programming Using C# Summary (Contd.) All the informationdomain is athe textprocess inside abe The application stored in logical format would physical displayed on a screen as text. the application domain is to process. The main purpose of isolate your applications from the other applications. This means 'A' will be written as 'A' in the files. Delegates allow you to write code that can dynamically change Similarly, the numbercalls. the methods that it –12345.678 will be written as the string "-12345.678". This means that you can directly display the contents of the file on the screen. Ver. 1.0 Session 16 Slide 31 of 31

Editor's Notes

  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. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. 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.
  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. 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.
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  22. 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.
  23. 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.
  24. 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.
  25. 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.
  26. 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.
  27. 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.
  28. 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.
  29. 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.