Upcoming SlideShare
×

# 10 iec t1_s1_oo_ps_session_14

641 views
559 views

Published on

Published in: Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
641
On SlideShare
0
From Embeds
0
Number of Embeds
52
Actions
Shares
0
48
0
Likes
0
Embeds 0
No embeds

No notes for slide
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.
• ### 10 iec t1_s1_oo_ps_session_14

1. 1. Object-Oriented Programming Using C#Objectives In this session, you will learn to: Handle exceptions Implement the user-defined exceptions Implement threads Define the life cycle of a thread Ver. 1.0 Session 14 Slide 1 of 30
2. 2. Object-Oriented Programming Using C#Handling Exceptions In exception handling, the application is divided into blocks of code. A block that shows the probability of raising an error contains one or more exception handlers. The exception handlers follow a control structure and a uniform way of handling the system level and application level errors. The blocks for exception-handling can be implemented using the following keywords: try catch finally Let us look at each of these keywords in detail. Ver. 1.0 Session 14 Slide 2 of 30
3. 3. Object-Oriented Programming Using C#Handling Exceptions (Contd.) The try block: The try block guards statements that may throw an exception. Following is the syntax of try block statement: try { //statements that may cause an exception } The try block governs statements that are enclosed within it and defines the scope of the exception-handlers associated with it. A try block must have at least one catch block. Ver. 1.0 Session 14 Slide 3 of 30
4. 4. Object-Oriented Programming Using C#Handling Exceptions (Contd.) The catch block: The catch statement of the catch block takes an object of the exception class as a parameter, which refers to the raised exception. You can associate an exception-handler with the try block by providing one or more catch handlers, immediately after the try block: try { //statements that may cause an exception } catch (…) { //error handling code } Ver. 1.0 Session 14 Slide 4 of 30
5. 5. Object-Oriented Programming Using C#Handling Exceptions (Contd.) The finally block: The finally block is used to execute a given set of statements, whether an exception is thrown or not thrown: try { //statements that may cause an exception } catch (…) { //error handling code } finally { //statements to be executed } Ver. 1.0 Session 14 Slide 5 of 30
6. 6. Object-Oriented Programming Using C#Demo: Handling Exception for Arrays Beyond Limit Problem Statement: David is working on a project where he is calculating the sum of values in an integer array. David needs to handle the exceptions, which can occur while he is working with the arrays. If any exceptional condition is reached when David is executing the application, the application needs to display an exception message. Help David to handle the exceptions. Ver. 1.0 Session 14 Slide 6 of 30
7. 7. Object-Oriented Programming Using C#Demo: Handling Exception for Arrays Beyond Limit (Contd.) Solution: To develop a console-based application, David need to perform the following tasks: 1. Create a console-based application. 2. Build and execute an application. Ver. 1.0 Session 14 Slide 7 of 30
8. 8. Object-Oriented Programming Using C#Implementing the User-Defined Exceptions In C#, you can create your own exception class. Such kinds of exceptions are known as user-defined exceptions. The Exception class is the base class for all the exceptions in C#. The user-defined exception classes must follow the hierarchy of either the exception class or of one of the standard inherited classes. Ver. 1.0 Session 14 Slide 8 of 30
9. 9. Object-Oriented Programming Using C#Implementing the User-Defined Exceptions (Contd.) User-defined exception classes are derived from the ApplicationException class. To implement user-defined exceptions, you need to: – Raise your exception: You can use the throw statement to raise your own exceptions. – Throw an object: You can throw an object if the object is either directly or indirectly derived from System.Exception. You can use a throw statement in the catch block to throw the present object, as shown in the following code: catch(Exception caught) { . . . throw caught } Ver. 1.0 Session 14 Slide 9 of 30
10. 10. Object-Oriented Programming Using C#Implementing Threads A thread is defined as the execution path of a program. You can define a unique flow of a control in a program, using a thread. Threads are used to run applications that perform large and complex computations. A process that is executed using one thread is known as a single-threaded process, where the process is a running instance of a program. Single-threaded application can perform only one task at a time. You have to wait for one task to complete before another task can start. Ver. 1.0 Session 14 Slide 10 of 30
11. 11. Object-Oriented Programming Using C#Implementing Threads (Contd.) The following figure shows a single-threaded process. • To execute more than one task at a time, you can create multiple threads in a program. • A process that creates two or more threads is called a multithreaded process. Ver. 1.0 Session 14 Slide 11 of 30
12. 12. Object-Oriented Programming Using C#Implementing Threads (Contd.) The following figure shows a multithreaded process. Ver. 1.0 Session 14 Slide 12 of 30
13. 13. Object-Oriented Programming Using C#The Thread Model in C# In single-threaded systems, an approach called event loop with polling is used. Polling is the process in which a single event is executed at a time. In the event loop with polling approach, a single thread runs in an infinite loop till its operation is completed. In a single-threaded application if the thread is suspended from execution because it is waiting for a system resource, the entire program stops executing. In multithreading, the time for which a thread waits for the CPU time can be utilized to perform another task. Ver. 1.0 Session 14 Slide 13 of 30
14. 14. Object-Oriented Programming Using C#The Thread Model in C#(Contd.) • In C#, you will use the Thread class to work with threads. • The System.Threading.Thread class is used to construct and access individual threads in a multithreaded application. Ver. 1.0 Session 14 Slide 14 of 30