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


                In this session, you will learn to:
                   Use delegate
                   Types of delegates
                   Use events with delegates
                   Apply attributes
                   Use predefined attributes




     Ver. 1.0                        Session 17       Slide 1 of 27
Object-Oriented Programming Using C#
Using Delegate


                You can call the delegate by giving the name of the
                delegate and by passing parameters, if required.
                Using delegates is similar to calling methods.




     Ver. 1.0                      Session 17                         Slide 2 of 27
Object-Oriented Programming Using C#
Using Delegate (Contd.)


                The following example shows how to use a delegate:
                using System;
                using System.IO;
                // Program to write the data to the console and
                  file
                namespace Chapter12_Ex1
                {
                public class PrintToDevice
                {
                  //Creating the variables of Stream classes
                  static FileStream FStream;
                  static StreamWriter SWriter;
                  //Defining a Delegate
                  //Method to send the string data to respective
                  methods
     Ver. 1.0                     Session 17                         Slide 3 of 27
Object-Oriented Programming Using C#
Using Delegate (Contd.)


                    //removing the content from the buffer
                   SWriter.Flush();
                   SWriter.Close();
                   FStream.Close();
                  }
                public delegate void PrintData(String s);
                //Method to print a string to the console
                public static void WriteConsole (string str)
                {
                    Console.WriteLine("{0} Console", str);
                }
                //Method to print a string to a file
                public static void WriteFile (string s)



     Ver. 1.0                  Session 17                    Slide 4 of 27
Object-Oriented Programming Using C#
Using Delegate (Contd.)


                {
                    //Initializing stream objects
                    FStream = new FileStream("c:StoreData.txt",
                    FileMode.Append, FileAccess.Write);
                    SWriter = new StreamWriter(FStream);
                    s= s + " File";
                    //Writing a string to the file
                    SWriter.WriteLine(s);
                }
                public static void DisplayData(PrintData
                  PMethod)
                {
                  PMethod ("This should go to the");
                }
                  public static void Main()
     Ver. 1.0                   Session 17                 Slide 5 of 27
Object-Oriented Programming Using C#
Using Delegate


                {
                     //Initializing the Delegate object
                     PrintData Cn = new PrintData (WriteConsole);
                     PrintData Fl = new PrintData (WriteFile);
                     //Invoking the DisplayData method with the
                     Delegate object as the argument
                     //Using Delegate
                     DisplayData (Cn);
                     DisplayData (Fl);
                     Console.ReadLine();
                     }
                 }
                }



     Ver. 1.0                    Session 17                  Slide 6 of 27
Object-Oriented Programming Using C#
Types of Delegates


                Delegates are of two types and depending upon the
                requirement of the application the suitable type of delegate
                is selected.




     Ver. 1.0                      Session 17                         Slide 7 of 27
Object-Oriented Programming Using C#
Types of Delegates (Contd.)


                There are two types of delegates:
                   Single-cast delegate
                   Multicast delegate




     Ver. 1.0                       Session 17      Slide 8 of 27
Object-Oriented Programming Using C#
Single-Cast Delegate


                • A single-cast delegate derives from the System.Delegate
                  class.
                • It contains reference to one method only at a time.




     Ver. 1.0                       Session 17                    Slide 9 of 27
Object-Oriented Programming Using C#
Multicast Delegate


                A multicast delegate derives from the
                System.MulticastDelegate class.
                It contains an invocation list of multiple methods. In
                multicasting you create a single delegate that invokes
                multiple encapsulated methods.
                You need to ensure the return type of all these delegates is
                same.
                Multicast delegates hold the reference of more than one
                method therefore, if you call a multicast delegate it will
                executes all the methods it wraps in the calling order.
                The multiple methods called by the delegate in this case
                should not return any value. Several multicast delegates are
                called consecutively and you cannot wait to get the return
                value from each of these methods.

     Ver. 1.0                      Session 17                       Slide 10 of 27
Object-Oriented Programming Using C#
Just a minute


                State whether the following statement is True or False.
                Multicast delegates inherit from the
                System.Delegate.MulticastDelegate class.




                Answer:
                   False




     Ver. 1.0                      Session 17                        Slide 11 of 27
Object-Oriented Programming Using C#
Working with Events


                An event is an action or occurrence, such as clicks, key
                presses, mouse movements, or system generated
                notifications.
                Applications can respond to events when they occur.




     Ver. 1.0                      Session 17                        Slide 12 of 27
Object-Oriented Programming Using C#
Working with Events (Contd.)


                The following figure shows the alarm event and handling of
                the event.

                       Clock Shows time.
                       Time is 6 AM.



                               Alarm plays a sound, notifying
                               everyone that it is 6 AM.



                                                  You hear the alarm.



                                                                You get up and get ready
                                                                For your school.




     Ver. 1.0                              Session 17                                      Slide 13 of 27
Object-Oriented Programming Using C#
Using Delegates with Events


                The events are declared and raised in a class and
                associated with the event handlers using delegates within
                the same class or other classes.
                Events are part of a class and the same class is used to
                publish its events.
                The other classes can, however, accept these events or in
                other words can subscribe to these events.
                Events use the publisher and subscriber model.
                – A publisher is an object that contains the definition of the event
                  and the delegate. The association of the event with the
                  delegate is also specified in the publisher class.
                – A subscriber is an object that wants to accept the event and
                  provide a handler to the event. The delegate of the publisher
                  class invokes the method of the subscriber class.


     Ver. 1.0                        Session 17                            Slide 14 of 27
Object-Oriented Programming Using C#
Using Delegates with Events (Contd.)


                The following figure shows the mechanism used by the
                publisher and subscriber objects.




                Let us understand the using delegates with events in detail.

     Ver. 1.0                      Session 17                        Slide 15 of 27
Object-Oriented Programming Using C#
Using Delegates with Events (Contd.)


                The implementation of an event includes:
                   Events definition
                   Events subscription
                   Events notification




     Ver. 1.0                       Session 17             Slide 16 of 27
Object-Oriented Programming Using C#
Using Delegates with Events (Contd.)


                Defining an Event:
                   The definition of the event in a publisher class includes the
                   declaration of the delegate as well as the declaration of the
                   event based on the delegate.
                   The following code defines a delegate named TimeToRise and
                   an event named RingAlarm, which invokes the TimeToRise
                   delegate when it is raised:
                    public delegate void TimeToRise();
                    private event TimeToRise RingAlarm;




     Ver. 1.0                        Session 17                         Slide 17 of 27
Object-Oriented Programming Using C#
Using Delegates with Events (Contd.)


                Subscribing to an Event:
                – The event of the publisher class needs to be associated with
                  its handler.
                – The event handler method is associated with the event using
                  the delegate.
                – When the publisher object raises the event, the subscribing
                  object associates the method, which needs to be called.
                – The requirement could be implemented using events. The
                  following code shows how the Student class subscribes to the
                  event named TimeToRise:
                     Student PD= new Student();
                     RingAlarm = new TimeToRise(PD.WakeUp);




     Ver. 1.0                      Session 17                          Slide 18 of 27
Object-Oriented Programming Using C#
Using Delegates with Events (Contd.)


                Notifying Subscribers to an Event:
                 – The subscriber object notifies the subscriber object to the
                   publisher object. The event is raised to notify the handler.
                 – Write this block of code at a place from where you want to
                   notify the event to the subscribers of the event:
                    if (RingAlarm != null)
                    {
                        RingAlarm( );
                    }




     Ver. 1.0                        Session 17                            Slide 19 of 27
Object-Oriented Programming Using C#
Passing Event Parameters


                • The methods that subscribe an event might expect some
                  input to be passed.
                • The event class can have these inputs at runtime on which
                  the subscribing method works.
                • You need to define the class that will pass the input to the
                  event.
                • Derive this class from System.EventArgs. To pass
                  values to a subscribing method, you need to enclose the
                  parameters in a single class.
                • The single class supplies a special method called the
                  accessor method to retrieve the value.
                • This method is used to examine or modify the members of a
                  class.


     Ver. 1.0                        Session 17                       Slide 20 of 27
Object-Oriented Programming Using C#
Demo: Attendance Log


               Problem Statement:
                  In an air-conditioner manufacturing company, the working time
                  is from 9 AM to 6 PM. The management of the company is
                  flexible and it allows workers to arrive to work late by 1 hour.
                  The entry time of workers is recorded electronically in a log file
                  when they enter the premises of the company. The application
                  used for recording the attendance of each worker needs to log
                  the appropriate information.
                  Help the company to design an application for logging
                  attendance.




    Ver. 1.0                        Session 17                             Slide 21 of 27
Object-Oriented Programming Using C#
Demo: Attendance Log (Contd.)


                Solution:
                   To design the application, you need to perform the following
                   tasks:
                    1. Identify the technique that you will use in the application. This
                       technique will allow you to call the respective methods
                       dynamically to log the attendance entry.
                    2. Create a console-based application to implement the attendance
                       log of workers.
                    3. Compile and execute the application.




     Ver. 1.0                         Session 17                               Slide 22 of 27
Object-Oriented Programming Using C#
Introducing Attributes


                • An object is described by the values of its attributes.
                • An attribute is a declarative tag that is used to convey
                  information to runtime about the behavior of programmatic
                  elements such as classes, enumerators, and assemblies.
                • A declarative tag is depicted by square ([ ]) brackets placed
                  above the definition of an element such as a class or a
                  method.
                • Attributes are used for adding metadata, such as compiler
                  instructions and other information such as comments,
                  description, methods, and classes to a program.
                • The .NET Framework is equipped with a number of
                  predefined attributes.



     Ver. 1.0                         Session 17                        Slide 23 of 27
Object-Oriented Programming Using C#
Applying Attributes


                Attributes are applied to different elements of the code.
                These elements include assemblies, modules, classes,
                structs, enums, constructors, methods, properties, fields,
                events, interfaces, parameters, return values, and
                delegates. Information about attributes is stored with the
                metadata of the elements they are associated with.
                The following syntax enables you to specify an attribute:
                 [attribute(positional_parameters,name_parameter
                 = value, ...)] element
                The .NET Framework supports two categories of attributes
                to be used in C# programs:
                   Predefined
                   Custom


     Ver. 1.0                      Session 17                        Slide 24 of 27
Object-Oriented Programming Using C#
Using Predefined Attributes


                Some commonly used predefined attributes provided
                with .NET Framework are:
                   Conditional
                   WebMethod
                   DLLImport
                   Obsolete




     Ver. 1.0                    Session 17                     Slide 25 of 27
Object-Oriented Programming Using C#
Summary


               In this session, you learned that:
                – There are two types of delegates, Single-cast delegate and
                  Multicast delegate.
                – A single-cast cast delegate can call only one function.
                – Multicast delegate holds the reference of more than one
                  method.
                – Single-cast delegate derives from the System.Delegate
                  class and Multicast delegate derives from the
                  System.MulticastDelegate class.
                – Events are the messages sent by an object to indicate the
                  occurrence of an event.
                – Events use the publisher and subscriber model.
                – A publisher is an object that maintains its internal state.




    Ver. 1.0                        Session 17                          Slide 26 of 27
Object-Oriented Programming Using C#
Summary (Contd.)


               – A subscriber is an object that registers an interest in an event.
               – An attribute is a declarative tag that is used to convey
                 information to runtime about the behavior of programmatic
                 elements such as classes, enumerators, and assemblies.
               – The .NET Framework supports two categories of attributes to
                 be used in C# programs: predefined and custom.
               – Predefined attributes are supplied as part of the Common
                 Language Runtime (CLR), and they are integrated into .NET.




    Ver. 1.0                        Session 17                            Slide 27 of 27

More Related Content

What's hot

13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19Niit 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
 
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
 
Oop02 6
Oop02 6Oop02 6
Oop02 6schwaa
 
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
 
Oop04 6
Oop04 6Oop04 6
Oop04 6schwaa
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusingumlAPU
 
BIT204 1 Software Fundamentals
BIT204 1 Software FundamentalsBIT204 1 Software Fundamentals
BIT204 1 Software FundamentalsJames Uren
 

What's hot (20)

13 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_1913 iec t1_s1_oo_ps_session_19
13 iec t1_s1_oo_ps_session_19
 
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
 
C Course Material0209
C Course Material0209C Course Material0209
C Course Material0209
 
Oop02 6
Oop02 6Oop02 6
Oop02 6
 
Csharp
CsharpCsharp
Csharp
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
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
 
Oop04 6
Oop04 6Oop04 6
Oop04 6
 
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusinguml
 
BIT204 1 Software Fundamentals
BIT204 1 Software FundamentalsBIT204 1 Software Fundamentals
BIT204 1 Software Fundamentals
 
Fudcon D programming
Fudcon D programmingFudcon D programming
Fudcon D programming
 

Viewers also liked

[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms Controls[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms ControlsAhmed Tarek Hasan
 
c# events, delegates and lambdas
c# events, delegates and lambdasc# events, delegates and lambdas
c# events, delegates and lambdasFernando Galvan
 
Java event processing model in c# and java
Java  event processing model in c# and javaJava  event processing model in c# and java
Java event processing model in c# and javaTech_MX
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinFormHock Leng PUAH
 
Integrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web siteIntegrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web siteHock Leng PUAH
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsMohammad Shaker
 
C# Delegates and Event Handling
C# Delegates and Event HandlingC# Delegates and Event Handling
C# Delegates and Event HandlingJussi Pohjolainen
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introductionHock Leng PUAH
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notesWE-IT TUTORIALS
 

Viewers also liked (14)

[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms Controls[Development Simply Put] Events & Delegates In C# - Win Forms Controls
[Development Simply Put] Events & Delegates In C# - Win Forms Controls
 
c# events, delegates and lambdas
c# events, delegates and lambdasc# events, delegates and lambdas
c# events, delegates and lambdas
 
Spf chapter10 events
Spf chapter10 eventsSpf chapter10 events
Spf chapter10 events
 
Java event processing model in c# and java
Java  event processing model in c# and javaJava  event processing model in c# and java
Java event processing model in c# and java
 
Ch01
Ch01Ch01
Ch01
 
Spf chapter 03 WinForm
Spf chapter 03 WinFormSpf chapter 03 WinForm
Spf chapter 03 WinForm
 
Integrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web siteIntegrate jQuery PHP MySQL project to JOOMLA web site
Integrate jQuery PHP MySQL project to JOOMLA web site
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension Methods
 
C# Delegates and Event Handling
C# Delegates and Event HandlingC# Delegates and Event Handling
C# Delegates and Event Handling
 
Intro++ to C#
Intro++ to C#Intro++ to C#
Intro++ to C#
 
Windowforms controls c#
Windowforms controls c#Windowforms controls c#
Windowforms controls c#
 
Visual basic asp.net programming introduction
Visual basic asp.net programming introductionVisual basic asp.net programming introduction
Visual basic asp.net programming introduction
 
tybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notestybsc it asp.net full unit 1,2,3,4,5,6 notes
tybsc it asp.net full unit 1,2,3,4,5,6 notes
 
C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
 

Similar to 12 iec t1_s1_oo_ps_session_17

PATTERNS06 - The .NET Event Model
PATTERNS06 - The .NET Event ModelPATTERNS06 - The .NET Event Model
PATTERNS06 - The .NET Event ModelMichael Heron
 
1 Fundamentals of EDP (2).pptx
1 Fundamentals of EDP (2).pptx1 Fundamentals of EDP (2).pptx
1 Fundamentals of EDP (2).pptxKabadaSori
 
VC++ Fundamentals
VC++ FundamentalsVC++ Fundamentals
VC++ Fundamentalsranigiyer
 
Day02 01 Advance Feature in C# DH TDT
Day02 01 Advance Feature in C# DH TDTDay02 01 Advance Feature in C# DH TDT
Day02 01 Advance Feature in C# DH TDTNguyen Patrick
 
03 oo with-c-sharp
03 oo with-c-sharp03 oo with-c-sharp
03 oo with-c-sharpNaved khan
 
Net framework session03
Net framework session03Net framework session03
Net framework session03Vivek chan
 
Delegates and events
Delegates and eventsDelegates and events
Delegates and eventsIblesoft
 
Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1ReKruiTIn.com
 
Advanced programming topics asma
Advanced programming topics asmaAdvanced programming topics asma
Advanced programming topics asmaAbdullahJana
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp PresentationVishwa Mohan
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfoliomwillmer
 
Review of c_sharp2_features_part_ii
Review of c_sharp2_features_part_iiReview of c_sharp2_features_part_ii
Review of c_sharp2_features_part_iiNico Ludwig
 
Aae oop xp_07
Aae oop xp_07Aae oop xp_07
Aae oop xp_07Niit Care
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of PatternsChris Eargle
 
introduction to_mfc
 introduction to_mfc introduction to_mfc
introduction to_mfctuttukuttu
 

Similar to 12 iec t1_s1_oo_ps_session_17 (20)

Csharp
CsharpCsharp
Csharp
 
C# Unit 1 notes
C# Unit 1 notesC# Unit 1 notes
C# Unit 1 notes
 
Delegates and events
Delegates and events   Delegates and events
Delegates and events
 
C sharp
C sharpC sharp
C sharp
 
PATTERNS06 - The .NET Event Model
PATTERNS06 - The .NET Event ModelPATTERNS06 - The .NET Event Model
PATTERNS06 - The .NET Event Model
 
C# Unit 2 notes
C# Unit 2 notesC# Unit 2 notes
C# Unit 2 notes
 
1 Fundamentals of EDP (2).pptx
1 Fundamentals of EDP (2).pptx1 Fundamentals of EDP (2).pptx
1 Fundamentals of EDP (2).pptx
 
VC++ Fundamentals
VC++ FundamentalsVC++ Fundamentals
VC++ Fundamentals
 
Day02 01 Advance Feature in C# DH TDT
Day02 01 Advance Feature in C# DH TDTDay02 01 Advance Feature in C# DH TDT
Day02 01 Advance Feature in C# DH TDT
 
03 oo with-c-sharp
03 oo with-c-sharp03 oo with-c-sharp
03 oo with-c-sharp
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
 
Delegates and events
Delegates and eventsDelegates and events
Delegates and events
 
Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1Dot Net Interview Questions - Part 1
Dot Net Interview Questions - Part 1
 
Advanced programming topics asma
Advanced programming topics asmaAdvanced programming topics asma
Advanced programming topics asma
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Review of c_sharp2_features_part_ii
Review of c_sharp2_features_part_iiReview of c_sharp2_features_part_ii
Review of c_sharp2_features_part_ii
 
Aae oop xp_07
Aae oop xp_07Aae oop xp_07
Aae oop xp_07
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of Patterns
 
introduction to_mfc
 introduction to_mfc introduction to_mfc
introduction to_mfc
 

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

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

12 iec t1_s1_oo_ps_session_17

  • 1. Object-Oriented Programming Using C# Objectives In this session, you will learn to: Use delegate Types of delegates Use events with delegates Apply attributes Use predefined attributes Ver. 1.0 Session 17 Slide 1 of 27
  • 2. Object-Oriented Programming Using C# Using Delegate You can call the delegate by giving the name of the delegate and by passing parameters, if required. Using delegates is similar to calling methods. Ver. 1.0 Session 17 Slide 2 of 27
  • 3. Object-Oriented Programming Using C# Using Delegate (Contd.) The following example shows how to use a delegate: using System; using System.IO; // Program to write the data to the console and file namespace Chapter12_Ex1 { public class PrintToDevice { //Creating the variables of Stream classes static FileStream FStream; static StreamWriter SWriter; //Defining a Delegate //Method to send the string data to respective methods Ver. 1.0 Session 17 Slide 3 of 27
  • 4. Object-Oriented Programming Using C# Using Delegate (Contd.) //removing the content from the buffer SWriter.Flush(); SWriter.Close(); FStream.Close(); } public delegate void PrintData(String s); //Method to print a string to the console public static void WriteConsole (string str) { Console.WriteLine("{0} Console", str); } //Method to print a string to a file public static void WriteFile (string s) Ver. 1.0 Session 17 Slide 4 of 27
  • 5. Object-Oriented Programming Using C# Using Delegate (Contd.) { //Initializing stream objects FStream = new FileStream("c:StoreData.txt", FileMode.Append, FileAccess.Write); SWriter = new StreamWriter(FStream); s= s + " File"; //Writing a string to the file SWriter.WriteLine(s); } public static void DisplayData(PrintData PMethod) { PMethod ("This should go to the"); } public static void Main() Ver. 1.0 Session 17 Slide 5 of 27
  • 6. Object-Oriented Programming Using C# Using Delegate { //Initializing the Delegate object PrintData Cn = new PrintData (WriteConsole); PrintData Fl = new PrintData (WriteFile); //Invoking the DisplayData method with the Delegate object as the argument //Using Delegate DisplayData (Cn); DisplayData (Fl); Console.ReadLine(); } } } Ver. 1.0 Session 17 Slide 6 of 27
  • 7. Object-Oriented Programming Using C# Types of Delegates Delegates are of two types and depending upon the requirement of the application the suitable type of delegate is selected. Ver. 1.0 Session 17 Slide 7 of 27
  • 8. Object-Oriented Programming Using C# Types of Delegates (Contd.) There are two types of delegates: Single-cast delegate Multicast delegate Ver. 1.0 Session 17 Slide 8 of 27
  • 9. Object-Oriented Programming Using C# Single-Cast Delegate • A single-cast delegate derives from the System.Delegate class. • It contains reference to one method only at a time. Ver. 1.0 Session 17 Slide 9 of 27
  • 10. Object-Oriented Programming Using C# Multicast Delegate A multicast delegate derives from the System.MulticastDelegate class. It contains an invocation list of multiple methods. In multicasting you create a single delegate that invokes multiple encapsulated methods. You need to ensure the return type of all these delegates is same. Multicast delegates hold the reference of more than one method therefore, if you call a multicast delegate it will executes all the methods it wraps in the calling order. The multiple methods called by the delegate in this case should not return any value. Several multicast delegates are called consecutively and you cannot wait to get the return value from each of these methods. Ver. 1.0 Session 17 Slide 10 of 27
  • 11. Object-Oriented Programming Using C# Just a minute State whether the following statement is True or False. Multicast delegates inherit from the System.Delegate.MulticastDelegate class. Answer: False Ver. 1.0 Session 17 Slide 11 of 27
  • 12. Object-Oriented Programming Using C# Working with Events An event is an action or occurrence, such as clicks, key presses, mouse movements, or system generated notifications. Applications can respond to events when they occur. Ver. 1.0 Session 17 Slide 12 of 27
  • 13. Object-Oriented Programming Using C# Working with Events (Contd.) The following figure shows the alarm event and handling of the event. Clock Shows time. Time is 6 AM. Alarm plays a sound, notifying everyone that it is 6 AM. You hear the alarm. You get up and get ready For your school. Ver. 1.0 Session 17 Slide 13 of 27
  • 14. Object-Oriented Programming Using C# Using Delegates with Events The events are declared and raised in a class and associated with the event handlers using delegates within the same class or other classes. Events are part of a class and the same class is used to publish its events. The other classes can, however, accept these events or in other words can subscribe to these events. Events use the publisher and subscriber model. – A publisher is an object that contains the definition of the event and the delegate. The association of the event with the delegate is also specified in the publisher class. – A subscriber is an object that wants to accept the event and provide a handler to the event. The delegate of the publisher class invokes the method of the subscriber class. Ver. 1.0 Session 17 Slide 14 of 27
  • 15. Object-Oriented Programming Using C# Using Delegates with Events (Contd.) The following figure shows the mechanism used by the publisher and subscriber objects. Let us understand the using delegates with events in detail. Ver. 1.0 Session 17 Slide 15 of 27
  • 16. Object-Oriented Programming Using C# Using Delegates with Events (Contd.) The implementation of an event includes: Events definition Events subscription Events notification Ver. 1.0 Session 17 Slide 16 of 27
  • 17. Object-Oriented Programming Using C# Using Delegates with Events (Contd.) Defining an Event: The definition of the event in a publisher class includes the declaration of the delegate as well as the declaration of the event based on the delegate. The following code defines a delegate named TimeToRise and an event named RingAlarm, which invokes the TimeToRise delegate when it is raised: public delegate void TimeToRise(); private event TimeToRise RingAlarm; Ver. 1.0 Session 17 Slide 17 of 27
  • 18. Object-Oriented Programming Using C# Using Delegates with Events (Contd.) Subscribing to an Event: – The event of the publisher class needs to be associated with its handler. – The event handler method is associated with the event using the delegate. – When the publisher object raises the event, the subscribing object associates the method, which needs to be called. – The requirement could be implemented using events. The following code shows how the Student class subscribes to the event named TimeToRise: Student PD= new Student(); RingAlarm = new TimeToRise(PD.WakeUp); Ver. 1.0 Session 17 Slide 18 of 27
  • 19. Object-Oriented Programming Using C# Using Delegates with Events (Contd.) Notifying Subscribers to an Event: – The subscriber object notifies the subscriber object to the publisher object. The event is raised to notify the handler. – Write this block of code at a place from where you want to notify the event to the subscribers of the event: if (RingAlarm != null) { RingAlarm( ); } Ver. 1.0 Session 17 Slide 19 of 27
  • 20. Object-Oriented Programming Using C# Passing Event Parameters • The methods that subscribe an event might expect some input to be passed. • The event class can have these inputs at runtime on which the subscribing method works. • You need to define the class that will pass the input to the event. • Derive this class from System.EventArgs. To pass values to a subscribing method, you need to enclose the parameters in a single class. • The single class supplies a special method called the accessor method to retrieve the value. • This method is used to examine or modify the members of a class. Ver. 1.0 Session 17 Slide 20 of 27
  • 21. Object-Oriented Programming Using C# Demo: Attendance Log Problem Statement: In an air-conditioner manufacturing company, the working time is from 9 AM to 6 PM. The management of the company is flexible and it allows workers to arrive to work late by 1 hour. The entry time of workers is recorded electronically in a log file when they enter the premises of the company. The application used for recording the attendance of each worker needs to log the appropriate information. Help the company to design an application for logging attendance. Ver. 1.0 Session 17 Slide 21 of 27
  • 22. Object-Oriented Programming Using C# Demo: Attendance Log (Contd.) Solution: To design the application, you need to perform the following tasks: 1. Identify the technique that you will use in the application. This technique will allow you to call the respective methods dynamically to log the attendance entry. 2. Create a console-based application to implement the attendance log of workers. 3. Compile and execute the application. Ver. 1.0 Session 17 Slide 22 of 27
  • 23. Object-Oriented Programming Using C# Introducing Attributes • An object is described by the values of its attributes. • An attribute is a declarative tag that is used to convey information to runtime about the behavior of programmatic elements such as classes, enumerators, and assemblies. • A declarative tag is depicted by square ([ ]) brackets placed above the definition of an element such as a class or a method. • Attributes are used for adding metadata, such as compiler instructions and other information such as comments, description, methods, and classes to a program. • The .NET Framework is equipped with a number of predefined attributes. Ver. 1.0 Session 17 Slide 23 of 27
  • 24. Object-Oriented Programming Using C# Applying Attributes Attributes are applied to different elements of the code. These elements include assemblies, modules, classes, structs, enums, constructors, methods, properties, fields, events, interfaces, parameters, return values, and delegates. Information about attributes is stored with the metadata of the elements they are associated with. The following syntax enables you to specify an attribute: [attribute(positional_parameters,name_parameter = value, ...)] element The .NET Framework supports two categories of attributes to be used in C# programs: Predefined Custom Ver. 1.0 Session 17 Slide 24 of 27
  • 25. Object-Oriented Programming Using C# Using Predefined Attributes Some commonly used predefined attributes provided with .NET Framework are: Conditional WebMethod DLLImport Obsolete Ver. 1.0 Session 17 Slide 25 of 27
  • 26. Object-Oriented Programming Using C# Summary In this session, you learned that: – There are two types of delegates, Single-cast delegate and Multicast delegate. – A single-cast cast delegate can call only one function. – Multicast delegate holds the reference of more than one method. – Single-cast delegate derives from the System.Delegate class and Multicast delegate derives from the System.MulticastDelegate class. – Events are the messages sent by an object to indicate the occurrence of an event. – Events use the publisher and subscriber model. – A publisher is an object that maintains its internal state. Ver. 1.0 Session 17 Slide 26 of 27
  • 27. Object-Oriented Programming Using C# Summary (Contd.) – A subscriber is an object that registers an interest in an event. – An attribute is a declarative tag that is used to convey information to runtime about the behavior of programmatic elements such as classes, enumerators, and assemblies. – The .NET Framework supports two categories of attributes to be used in C# programs: predefined and custom. – Predefined attributes are supplied as part of the Common Language Runtime (CLR), and they are integrated into .NET. Ver. 1.0 Session 17 Slide 27 of 27

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. 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. 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.
  7. 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.
  8. 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.
  9. 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.
  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. 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.
  13. 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.
  14. 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.
  15. 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.
  16. 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.
  17. 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.
  18. 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.
  19. 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.
  20. 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.
  21. 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.
  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.
  25. 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.
  26. 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.
  27. 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.