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


                In this session, you will learn to:
                   Create custom attributes
                   Retrieve metadata using reflection




     Ver. 1.0                        Session 19         Slide 1 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes


                The .NET Framework allows creation of custom attributes,
                which can be used to store information and can be retrieved
                at run time.
                This information can be related to any target element
                depending upon the design and the need of an application.
                To create custom attributes, you need to:
                1.   Define a custom attribute.
                2.   Name the custom attribute.
                3.   Construct the custom attribute.
                4.   Apply the custom attribute to a target element.




     Ver. 1.0                         Session 19                       Slide 2 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                Defining a Custom Attribute:
                 – A New custom attribute class is derived from the
                   System.Attribute system class.
                 – You need to then apply the attribute target using a predefined
                   attribute to the new custom attribute class, AttributeUsage, as
                   shown in the following code statement:
                     [AttributeUsage(AttributeTargets.Class |
                       AttributeTargets.Constructor |
                       AttributeTargets.Field |
                       AttributeTargets.Method |
                       AttributeTargets.Property,
                       AllowMultiple = true)]




     Ver. 1.0                        Session 19                            Slide 3 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                  The AttributeUsage attribute allows two arguments.
                    •   One argument is a set of flags that indicates the target element.
                    •   The other argument is a flag that indicates whether a given
                        element might be applied with more than one such attribute.
                – Besides the AllowMultiple property there are other
                  properties that can be used with the attributes. These
                  properties are:
                        Inherited
                        ValidOn




     Ver. 1.0                         Session 19                                  Slide 4 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                         – The following table lists the various member names of the
                           AttributeTargets enumerator.
                Member Name      Attribute Targets
                All              Elements including assembly, class, class member, delegate, enum, event, field, interface, method,
                                 module, parameter, property, or struct
                Assembly         Assembly only
                Class            Instances of the class
                ClassMembers     Classes, structs, enums, constructors, methods, properties, fields, events, delegates, and interfaces
                Constructor      Class constructors
                Delegate         Delegate methods
                Enum             Defined enumeration
                Event            Defined events
                Field            Fields
                Interface        Interfaces
                Method           Defined methods
                Module           A single module
                Parameter        Parameters of a method
                Property         Properties (both get and set, if implemented)
                Struct           Structs


     Ver. 1.0                                             Session 19                                                       Slide 5 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                Naming the Custom Attribute:
                   The normal convention is to append the word Attribute to the
                   attribute name.
                   The compiler supports appending by allowing you to call the
                   attribute with the shorter version of the name.




     Ver. 1.0                       Session 19                           Slide 6 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                Constructing the Custom Attribute:
                – Every attribute must contain at least one constructor.
                – Positional parameters are passed through the constructor in
                  the order declared in the constructor, as shown in the following
                  code snippet:
                     public BugFixingAttribute(int BugNo, string
                Developer,
                     string DateFixed)
                     {
                        this.BugNo = BugNo;
                        this.Developer = Developer;
                        this.DateFixed = DateFixed;
                     }




     Ver. 1.0                       Session 19                            Slide 7 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                Named parameters are implemented as properties, as shown
                in the following code snippet:
                 public string Remarks
                 {
                   get
                   {
                       return Remarks;
                   }
                   set
                   {
                       Remarks = value;
                   }
                 }




     Ver. 1.0                   Session 19                        Slide 8 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                – It is common to create read-only properties for the positional
                  parameters:
                    public int BugNo
                    {
                      get
                       {
                         return BugNo;
                       }
                    }




     Ver. 1.0                       Session 19                            Slide 9 of 19
Object-Oriented Programming Using C#
Creating Custom Attributes (Contd.)


                Applying the Custom Attribute:
                   The attribute can be applied by placing it immediately before its
                   target.
                   To test the BugFixAttribute attribute for the preceding example,
                   you can create a program for a simple class named Calculator
                   and give it four functions.
                   You need to assign the BugFixAttribute to the target element
                   class to record its code-maintenance history, as shown in the
                   following code snippet:
                    [BugFixingAttribute(125,"Sara Levo","08/15/06",
                    Remarks="Return object not specified")]
                    [BugFixingAttribute(159,"Sara Levo","08/17/06",
                    Remarks="Data Type Mismatch")]
                    public class Calculator




     Ver. 1.0                        Session 19                            Slide 10 of 19
Object-Oriented Programming Using C#
Retrieving Metadata Using Reflection


                • Reflection is used in the process of obtaining type
                  information at runtime.
                • The classes that give access to the metadata of a running
                  program are in the System.Reflection namespace.
                • The System.Reflection namespace contains classes
                  that allow programmers to obtain information about the
                  application that is running and to dynamically add types,
                  values, and objects to that application.




     Ver. 1.0                        Session 19                       Slide 11 of 19
Object-Oriented Programming Using C#
Retrieving Metadata Using Reflection (Contd.)


                Reflection is generally used for the following tasks:
                   Viewing metadata
                   Performing type discovery
                   Late binding to methods and properties
                   Reflection emit




     Ver. 1.0                       Session 19                          Slide 12 of 19
Object-Oriented Programming Using C#
Retrieving Metadata Using Reflection (Contd.)


                Viewing Metadata:
                – To view metadata using reflection, the MemberInfo object of
                  the System.Reflection namespace needs to be initialized.
                – This object helps discover the attributes of a member and to
                  provide access to metadata.




     Ver. 1.0                       Session 19                         Slide 13 of 19
Object-Oriented Programming Using C#
Retrieving Metadata Using Reflection (Contd.)


                Performing Type Discovery:
                – Reflection also helps to explore and examine the contents of
                  an assembly.
                – It helps find the types associated with a module; the methods,
                  fields, properties, and events associated with a type, as well as
                  the signatures of each type of methods; the interfaces
                  supported by the type and the type's base class.
                – Performing type discovery can also be achieved through the
                  Object Browser window of Visual Studio .NET IDE.




     Ver. 1.0                       Session 19                            Slide 14 of 19
Object-Oriented Programming Using C#
Retrieving Metadata Using Reflection (Contd.)


                Late Binding:
                 – Binding a method at runtime is called late binding.
                 – Reflection provides the flexibility of choosing an object you will
                   bind at runtime and calling it programmatically.




     Ver. 1.0                         Session 19                             Slide 15 of 19
Object-Oriented Programming Using C#
Using Delegates with Events


                Reflection Emit:
                   Reflection emit allows creation of new types at run time and
                   further use those types to perform certain tasks.
                   Reflection emit enables you to define new modules and new
                   types with methods.




     Ver. 1.0                       Session 19                           Slide 16 of 19
Object-Oriented Programming Using C#
Demo: Creating and Querying Custom Attribute Information


                Problem Statement:
                – John is a developer in a software development company. The
                  program manager wants John to ensure proper documentation
                  of the business logic of the Calculator application as a part of
                  development process. Although, the company maintains a
                  separate sheet to describe the use of classes and their version
                  number, the program manager wants to attach that sheet to
                  classes.
                  [Hint: Use the Calculator class given in the preceding section
                  for providing the business logic.]




     Ver. 1.0                       Session 19                            Slide 17 of 19
Object-Oriented Programming Using C#
Demo: Creating and Querying Custom Attribute Information
(Contd.)

                Solution:
                   To create a console based application for Calculator
                   application, John needs to perform the following tasks:
                    1. Create a console-based application.
                    2. Build and execute an application.




     Ver. 1.0                        Session 19                              Slide 18 of 19
Object-Oriented Programming Using C#
Summary


               In this session, you learned that:
                  Custom attributes are attributes that you create according to
                  your requirement.
                  The element to which you attach an attribute is called an
                  attribute target.
                  Reflection is used in the process of obtaining type information
                  at run time.
                  Reflection is generally used for the following tasks:
                    •   Viewing metadata
                    •   Performing type discovery
                    •   Late binding to methods and properties
                    •   Reflection emit




    Ver. 1.0                          Session 19                          Slide 19 of 19

More Related Content

What's hot

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
Niit Care
 
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
Niit 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_04
Niit Care
 
01 gui 01
01 gui 0101 gui 01
01 gui 01
Niit 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_02
Niit Care
 
Java session02
Java session02Java session02
Java session02
Niit Care
 
Java session11
Java session11Java session11
Java session11
Niit Care
 
Java session01
Java session01Java session01
Java session01
Niit 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 Reconstruction
Alex Matrosov
 
03 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_0303 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_03
Niit Care
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
Niit Care
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of Patterns
Chris Eargle
 
Oop02 6
Oop02 6Oop02 6
Oop02 6
schwaa
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
Niit Care
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusinguml
APU
 
Fudcon D programming
Fudcon D programmingFudcon D programming
Fudcon D programming
Jonathan Mercier
 
Simple insites into JVM
Simple insites into JVMSimple insites into JVM
Simple insites into JVM
Ramakanth Tarimala
 
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
Atit Patumvan
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocation
Riccardo Cardin
 

What's hot (20)

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
 
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
 
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 session11
Java session11Java session11
Java session11
 
Java session01
Java session01Java session01
Java session01
 
 
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
 
03 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_0303 iec t1_s1_plt_session_03
03 iec t1_s1_plt_session_03
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 
Evolution of Patterns
Evolution of PatternsEvolution of Patterns
Evolution of Patterns
 
Oop02 6
Oop02 6Oop02 6
Oop02 6
 
Dacj 1-2 a
Dacj 1-2 aDacj 1-2 a
Dacj 1-2 a
 
4.class diagramsusinguml
4.class diagramsusinguml4.class diagramsusinguml
4.class diagramsusinguml
 
Fudcon D programming
Fudcon D programmingFudcon D programming
Fudcon D programming
 
Simple insites into JVM
Simple insites into JVMSimple insites into JVM
Simple insites into JVM
 
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
 
Java - Remote method invocation
Java - Remote method invocationJava - Remote method invocation
Java - Remote method invocation
 

Viewers also liked

Advanced c#
Advanced c#Advanced c#
Advanced c#
AkashThakrar
 
CSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+ReflectionCSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+Reflection
Mohammad Shaker
 
Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#
Wekoslav Stefanovski
 
Building & Designing Windows 10 Universal Windows Apps using XAML and C#
Building & Designing Windows 10 Universal Windows Apps using XAML and C#Building & Designing Windows 10 Universal Windows Apps using XAML and C#
Building & Designing Windows 10 Universal Windows Apps using XAML and C#
Fons Sonnemans
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
Dan Douglas
 
Reflection in C#
Reflection in C#Reflection in C#
Reflection in C#
Rohit Vipin Mathews
 
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
Nguyen Patrick
 
C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
BlackRabbitCoder
 

Viewers also liked (9)

Advanced c#
Advanced c#Advanced c#
Advanced c#
 
CSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+ReflectionCSharp Advanced L05-Attributes+Reflection
CSharp Advanced L05-Attributes+Reflection
 
Study research in April
Study research in AprilStudy research in April
Study research in April
 
Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#Smoke and Mirrors - Reflection in C#
Smoke and Mirrors - Reflection in C#
 
Building & Designing Windows 10 Universal Windows Apps using XAML and C#
Building & Designing Windows 10 Universal Windows Apps using XAML and C#Building & Designing Windows 10 Universal Windows Apps using XAML and C#
Building & Designing Windows 10 Universal Windows Apps using XAML and C#
 
.NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know....NET Attributes and Reflection - What a Developer Needs to Know...
.NET Attributes and Reflection - What a Developer Needs to Know...
 
Reflection in C#
Reflection in C#Reflection in C#
Reflection in C#
 
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
 
C#/.NET Little Wonders
C#/.NET Little WondersC#/.NET Little Wonders
C#/.NET Little Wonders
 

Similar to 13 iec t1_s1_oo_ps_session_19

Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
Prof. Dr. K. Adisesha
 
201005 accelerometer and core Location
201005 accelerometer and core Location201005 accelerometer and core Location
201005 accelerometer and core Location
Javier Gonzalez-Sanchez
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
Benjamin Cabé
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
Niit Care
 
Reflection
ReflectionReflection
Reflection
Chester Hartin
 
Component interface
Component interfaceComponent interface
Component interface
JAYAARC
 
Module 15 attributes
Module 15 attributesModule 15 attributes
Module 15 attributes
Prem Kumar Badri
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
jlshare
 
Vb net xp_03
Vb net xp_03Vb net xp_03
Vb net xp_03
Niit Care
 
7494609
74946097494609
Constructors in C++.pptx
Constructors in C++.pptxConstructors in C++.pptx
Constructors in C++.pptx
Rassjb
 
Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Module 2: C# 3.0 Language Enhancements (Material)
Module 2: C# 3.0 Language Enhancements (Material)Module 2: C# 3.0 Language Enhancements (Material)
Module 2: C# 3.0 Language Enhancements (Material)
Mohamed Saleh
 
Design patterns
Design patternsDesign patterns
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
akreyi
 
Secrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory ManagementSecrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory Management
Abhishek Sur
 
Csc253 chapter 09
Csc253 chapter 09Csc253 chapter 09
Csc253 chapter 09
PCC
 
08 gui 11
08 gui 1108 gui 11
08 gui 11
Niit Care
 
L0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard ViewsL0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard Views
Tonny Madsen
 
Constructor and Destructor in c++
Constructor  and Destructor in c++Constructor  and Destructor in c++
Constructor and Destructor in c++
aleenaguen
 

Similar to 13 iec t1_s1_oo_ps_session_19 (20)

Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
201005 accelerometer and core Location
201005 accelerometer and core Location201005 accelerometer and core Location
201005 accelerometer and core Location
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
 
Reflection
ReflectionReflection
Reflection
 
Component interface
Component interfaceComponent interface
Component interface
 
Module 15 attributes
Module 15 attributesModule 15 attributes
Module 15 attributes
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
 
Vb net xp_03
Vb net xp_03Vb net xp_03
Vb net xp_03
 
7494609
74946097494609
7494609
 
Constructors in C++.pptx
Constructors in C++.pptxConstructors in C++.pptx
Constructors in C++.pptx
 
Constructors and Destructor in C++
Constructors and Destructor in C++Constructors and Destructor in C++
Constructors and Destructor in C++
 
Module 2: C# 3.0 Language Enhancements (Material)
Module 2: C# 3.0 Language Enhancements (Material)Module 2: C# 3.0 Language Enhancements (Material)
Module 2: C# 3.0 Language Enhancements (Material)
 
Design patterns
Design patternsDesign patterns
Design patterns
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Secrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory ManagementSecrets of .NET Assemblies and Memory Management
Secrets of .NET Assemblies and Memory Management
 
Csc253 chapter 09
Csc253 chapter 09Csc253 chapter 09
Csc253 chapter 09
 
08 gui 11
08 gui 1108 gui 11
08 gui 11
 
L0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard ViewsL0043 - Interfacing to Eclipse Standard Views
L0043 - Interfacing to Eclipse Standard Views
 
Constructor and Destructor in c++
Constructor  and Destructor in c++Constructor  and Destructor in c++
Constructor and Destructor in c++
 

More from Niit Care

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
Niit Care
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
Niit Care
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
Niit Care
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
Niit Care
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
Niit Care
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
Niit Care
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
Niit Care
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
Niit Care
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
Niit Care
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
Niit Care
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
Niit Care
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
Niit Care
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
Niit Care
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
Niit Care
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
Niit Care
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
Niit Care
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
Niit Care
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
Niit Care
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
Niit Care
 
Dacj 1-3 b
Dacj 1-3 bDacj 1-3 b
Dacj 1-3 b
Niit 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

Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
Jason Yip
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
ScyllaDB
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
DanBrown980551
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
ScyllaDB
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
DianaGray10
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
UiPathCommunity
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
christinelarrosa
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 

Recently uploaded (20)

Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
[OReilly Superstream] Occupy the Space: A grassroots guide to engineering (an...
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-EfficiencyFreshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
Freshworks Rethinks NoSQL for Rapid Scaling & Cost-Efficiency
 
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
LF Energy Webinar: Carbon Data Specifications: Mechanisms to Improve Data Acc...
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
A Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's ArchitectureA Deep Dive into ScyllaDB's Architecture
A Deep Dive into ScyllaDB's Architecture
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance PanelsNorthern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
Northern Engraving | Modern Metal Trim, Nameplates and Appliance Panels
 
What is an RPA CoE? Session 1 – CoE Vision
What is an RPA CoE?  Session 1 – CoE VisionWhat is an RPA CoE?  Session 1 – CoE Vision
What is an RPA CoE? Session 1 – CoE Vision
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
Session 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdfSession 1 - Intro to Robotic Process Automation.pdf
Session 1 - Intro to Robotic Process Automation.pdf
 
Christine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptxChristine's Product Research Presentation.pptx
Christine's Product Research Presentation.pptx
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 

13 iec t1_s1_oo_ps_session_19

  • 1. Object-Oriented Programming Using C# Objectives In this session, you will learn to: Create custom attributes Retrieve metadata using reflection Ver. 1.0 Session 19 Slide 1 of 19
  • 2. Object-Oriented Programming Using C# Creating Custom Attributes The .NET Framework allows creation of custom attributes, which can be used to store information and can be retrieved at run time. This information can be related to any target element depending upon the design and the need of an application. To create custom attributes, you need to: 1. Define a custom attribute. 2. Name the custom attribute. 3. Construct the custom attribute. 4. Apply the custom attribute to a target element. Ver. 1.0 Session 19 Slide 2 of 19
  • 3. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) Defining a Custom Attribute: – A New custom attribute class is derived from the System.Attribute system class. – You need to then apply the attribute target using a predefined attribute to the new custom attribute class, AttributeUsage, as shown in the following code statement: [AttributeUsage(AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true)] Ver. 1.0 Session 19 Slide 3 of 19
  • 4. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) The AttributeUsage attribute allows two arguments. • One argument is a set of flags that indicates the target element. • The other argument is a flag that indicates whether a given element might be applied with more than one such attribute. – Besides the AllowMultiple property there are other properties that can be used with the attributes. These properties are: Inherited ValidOn Ver. 1.0 Session 19 Slide 4 of 19
  • 5. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) – The following table lists the various member names of the AttributeTargets enumerator. Member Name Attribute Targets All Elements including assembly, class, class member, delegate, enum, event, field, interface, method, module, parameter, property, or struct Assembly Assembly only Class Instances of the class ClassMembers Classes, structs, enums, constructors, methods, properties, fields, events, delegates, and interfaces Constructor Class constructors Delegate Delegate methods Enum Defined enumeration Event Defined events Field Fields Interface Interfaces Method Defined methods Module A single module Parameter Parameters of a method Property Properties (both get and set, if implemented) Struct Structs Ver. 1.0 Session 19 Slide 5 of 19
  • 6. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) Naming the Custom Attribute: The normal convention is to append the word Attribute to the attribute name. The compiler supports appending by allowing you to call the attribute with the shorter version of the name. Ver. 1.0 Session 19 Slide 6 of 19
  • 7. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) Constructing the Custom Attribute: – Every attribute must contain at least one constructor. – Positional parameters are passed through the constructor in the order declared in the constructor, as shown in the following code snippet: public BugFixingAttribute(int BugNo, string Developer, string DateFixed) { this.BugNo = BugNo; this.Developer = Developer; this.DateFixed = DateFixed; } Ver. 1.0 Session 19 Slide 7 of 19
  • 8. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) Named parameters are implemented as properties, as shown in the following code snippet: public string Remarks { get { return Remarks; } set { Remarks = value; } } Ver. 1.0 Session 19 Slide 8 of 19
  • 9. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) – It is common to create read-only properties for the positional parameters: public int BugNo { get { return BugNo; } } Ver. 1.0 Session 19 Slide 9 of 19
  • 10. Object-Oriented Programming Using C# Creating Custom Attributes (Contd.) Applying the Custom Attribute: The attribute can be applied by placing it immediately before its target. To test the BugFixAttribute attribute for the preceding example, you can create a program for a simple class named Calculator and give it four functions. You need to assign the BugFixAttribute to the target element class to record its code-maintenance history, as shown in the following code snippet: [BugFixingAttribute(125,"Sara Levo","08/15/06", Remarks="Return object not specified")] [BugFixingAttribute(159,"Sara Levo","08/17/06", Remarks="Data Type Mismatch")] public class Calculator Ver. 1.0 Session 19 Slide 10 of 19
  • 11. Object-Oriented Programming Using C# Retrieving Metadata Using Reflection • Reflection is used in the process of obtaining type information at runtime. • The classes that give access to the metadata of a running program are in the System.Reflection namespace. • The System.Reflection namespace contains classes that allow programmers to obtain information about the application that is running and to dynamically add types, values, and objects to that application. Ver. 1.0 Session 19 Slide 11 of 19
  • 12. Object-Oriented Programming Using C# Retrieving Metadata Using Reflection (Contd.) Reflection is generally used for the following tasks: Viewing metadata Performing type discovery Late binding to methods and properties Reflection emit Ver. 1.0 Session 19 Slide 12 of 19
  • 13. Object-Oriented Programming Using C# Retrieving Metadata Using Reflection (Contd.) Viewing Metadata: – To view metadata using reflection, the MemberInfo object of the System.Reflection namespace needs to be initialized. – This object helps discover the attributes of a member and to provide access to metadata. Ver. 1.0 Session 19 Slide 13 of 19
  • 14. Object-Oriented Programming Using C# Retrieving Metadata Using Reflection (Contd.) Performing Type Discovery: – Reflection also helps to explore and examine the contents of an assembly. – It helps find the types associated with a module; the methods, fields, properties, and events associated with a type, as well as the signatures of each type of methods; the interfaces supported by the type and the type's base class. – Performing type discovery can also be achieved through the Object Browser window of Visual Studio .NET IDE. Ver. 1.0 Session 19 Slide 14 of 19
  • 15. Object-Oriented Programming Using C# Retrieving Metadata Using Reflection (Contd.) Late Binding: – Binding a method at runtime is called late binding. – Reflection provides the flexibility of choosing an object you will bind at runtime and calling it programmatically. Ver. 1.0 Session 19 Slide 15 of 19
  • 16. Object-Oriented Programming Using C# Using Delegates with Events Reflection Emit: Reflection emit allows creation of new types at run time and further use those types to perform certain tasks. Reflection emit enables you to define new modules and new types with methods. Ver. 1.0 Session 19 Slide 16 of 19
  • 17. Object-Oriented Programming Using C# Demo: Creating and Querying Custom Attribute Information Problem Statement: – John is a developer in a software development company. The program manager wants John to ensure proper documentation of the business logic of the Calculator application as a part of development process. Although, the company maintains a separate sheet to describe the use of classes and their version number, the program manager wants to attach that sheet to classes. [Hint: Use the Calculator class given in the preceding section for providing the business logic.] Ver. 1.0 Session 19 Slide 17 of 19
  • 18. Object-Oriented Programming Using C# Demo: Creating and Querying Custom Attribute Information (Contd.) Solution: To create a console based application for Calculator application, John needs to perform the following tasks: 1. Create a console-based application. 2. Build and execute an application. Ver. 1.0 Session 19 Slide 18 of 19
  • 19. Object-Oriented Programming Using C# Summary In this session, you learned that: Custom attributes are attributes that you create according to your requirement. The element to which you attach an attribute is called an attribute target. Reflection is used in the process of obtaining type information at run time. Reflection is generally used for the following tasks: • Viewing metadata • Performing type discovery • Late binding to methods and properties • Reflection emit Ver. 1.0 Session 19 Slide 19 of 19

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. 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.
  18. Student already have learnt about SCDs in Module I. Therefore, you can start this topic by asking the following questions to students: What are type 1 SCDs? Given an example to explain type 1 SCDs. This will recapitulate what they have learnt about type 1 SCD in Module 1. Now explain the strategy to load the data into these dimension tables with help of the given diagram. Relate this diagram to the example given in SG.
  19. 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.