SlideShare a Scribd company logo
1 of 48
Enterprise Library 3.0:  Overview
Context ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Enterprise Library Ecosystem Partner blocks Customer blocks Community blocks p&p blocks Application Block  Software Factory and Specifications p&p  Enterprise Library Partner X library Customer Y library Customer Z library
Enterprise Library ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Goals of Enterprise Library 3.0 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Enterprise Library 3.0 – New Features At a Glance ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
The Core ,[object Object],[object Object],[object Object],[object Object]
Configuration ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Configuration Design & Tooling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Instrumentation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Object Builder ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Exception Handling Scenarios ,[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Handling Application Block ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exception Handling - Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Logging Scenarios ,[object Object],[object Object],[object Object],[object Object],[object Object]
Logging Application Block ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logging - Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],// Or if you prefer one line... Customer cust = GetCustomer(123); // Log the customer – will call cust.ToString() for the log entry Logger.Write(cust, category, priority);
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Data Access Scenarios ,[object Object],[object Object],[object Object],[object Object],[object Object]
Data Access Application Block ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Access - Examples Public Function GetProductsInCategory(ByVal Category As Integer) As DataSet ' Create the Database object, using the database instance with the ' specified logical name. This is mapped to a connection string in  ' the configuration file Dim db As Database = DatabaseFactory.CreateDatabase("Sales") ' Invoke the stored procedure with one line of code! return db.ExecuteDataSet("GetProductsByCategory", Category) ' Note: connection was closed by ExecuteDataSet method call  End Function public Dataset GetProductsInCategory(string connectionString, int category)  { // Create the Database object, using the specified connection string SqlDatabase db = new SqlDatabase(connectionString);  // Invoke the stored procedure with one line of code! return db.ExecuteDataSet("GetProductsByCategory", category); // Note: connection was closed by ExecuteDataSet method call  }
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Caching Scenarios ,[object Object],[object Object],[object Object]
Caching Application Block ,[object Object],[object Object],[object Object],[object Object]
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Cryptography Scenarios ,[object Object],[object Object],[object Object]
Cryptography Application Block ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Security Scenarios ,[object Object],[object Object],[object Object],[object Object]
Security Application Block + ASP.NET ,[object Object],[object Object],[object Object],[object Object],ASP.NET Client Code Security Application Block Membership Profile Membership Provider Profile Provider Authorization Factory Security Cache Factory IAuthorization Provider ISecurity Cache Provider Authorization Rule Provider Caching Store Provider AzMan Authorization Provider ActiveDirectory Membership Provider Sql Membership Provider Sql Profile Provider Caching Application Block
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Validation Scenarios ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Validation Application Block ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Validation Example [StringLengthValidator(1, 50, Ruleset=&quot; RuleSetA &quot;, MessageTemplate=&quot; Last Name must be 1-50 characters &quot;)] public string  LastName { get  {  return  lastName; } set  { lastName =  value ; } } [RegexValidator( @&quot;+([-+.']+)*@+([-.]+)*+([-.]+)*&quot; , MessageTemplate=&quot; Invalid e-mail address &quot;,  Ruleset=&quot; RuleSetA &quot;)] public string  Email { get  { return email; } set  { email =  value ; } } Validator<Customer> validator = ValidationFactory.CreateValidator<Customer>(&quot;Ruleset&quot;); ValidationResults results = validator.Validate(customer); if (!results.IsValid) { foreach (ValidationResult result in results) { Console.WriteLine(&quot;Message={0}, Key={1}, &quot;Tag={2}&quot;, result.Message,  result.Key.ToString(),  result.Tag == null ? &quot;null&quot; : &quot;amp;quot;&quot; + result.Tag.ToString() + &quot;amp;quot;&quot;); } } Specify validation rules in attributes… … or in configuration Validate objects and process results
Enterprise Library 3.0 – Application Blocks Core Caching Security Data  Access Logging Exception Handling Plug-in Config Helpers  & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
Policy Injection Scenarios ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Policy Injection Application Block ,[object Object],[object Object],[object Object],[object Object]
Policy Injection Example public class BankAccount : MarshalByRefObject { // Constructors and fields omitted [ValidationCallHandler] public void Deposit([RangeValidator(typeof(Decimal), &quot;0.0&quot;,  RangeBoundaryType.Exclusive, &quot;0.0&quot;, RangeBoundaryType.Ignore)] decimal depositAmount) { balance += depositAmount; } } BankAccount account = PolicyInjection.Create<BankAccount>(customerId); account.Deposit(1234.56M); Write classes that extend MBRO or implement an interface Apply Handlers using attributes if desired Apply Policies using configuration if desired Create objects using PolicyInjection class Call your methods the usual way
Automation
Application Block Software Factory ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Application Block Software Factory
Strong Naming Guidance Package  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Resources  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 

More Related Content

What's hot (9)

Day7
Day7Day7
Day7
 
Informix Data Streaming Overview
Informix Data Streaming OverviewInformix Data Streaming Overview
Informix Data Streaming Overview
 
.NET Core, ASP.NET Core Course, Session 8
.NET Core, ASP.NET Core Course, Session 8.NET Core, ASP.NET Core Course, Session 8
.NET Core, ASP.NET Core Course, Session 8
 
Day6
Day6Day6
Day6
 
Day1
Day1Day1
Day1
 
.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...
 
Repository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity FrameworkRepository Pattern in MVC3 Application with Entity Framework
Repository Pattern in MVC3 Application with Entity Framework
 
Day5
Day5Day5
Day5
 
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
Continuous Test Automation, by Richard Langlois P. Eng. and Yuri Pechenko.
 

Viewers also liked

Developer’s guide to microsoft enterprise library preview
Developer’s guide to microsoft enterprise library previewDeveloper’s guide to microsoft enterprise library preview
Developer’s guide to microsoft enterprise library preview
Steve Xu
 
School Fire Safety Inspections
School Fire Safety InspectionsSchool Fire Safety Inspections
School Fire Safety Inspections
Meg Thompson
 
Library policy
Library policyLibrary policy
Library policy
nwls
 
Usage des réseaux sociaux en bibliothèque
Usage des réseaux sociaux en bibliothèqueUsage des réseaux sociaux en bibliothèque
Usage des réseaux sociaux en bibliothèque
Pauline Moirez
 

Viewers also liked (20)

Sustaining Innovation: Library 3.0
Sustaining Innovation: Library 3.0Sustaining Innovation: Library 3.0
Sustaining Innovation: Library 3.0
 
Web 2.0 / Library 2.0 Part Two
Web 2.0 / Library 2.0 Part TwoWeb 2.0 / Library 2.0 Part Two
Web 2.0 / Library 2.0 Part Two
 
From Web 2.0 to Web 3.0: Yesterday, Today, Tomorrow. Where the Technology is ...
From Web 2.0 to Web 3.0: Yesterday, Today, Tomorrow. Where the Technology is ...From Web 2.0 to Web 3.0: Yesterday, Today, Tomorrow. Where the Technology is ...
From Web 2.0 to Web 3.0: Yesterday, Today, Tomorrow. Where the Technology is ...
 
Library 2.0 technologies in academic libraries, a case study of student use a...
Library 2.0 technologies in academic libraries, a case study of student use a...Library 2.0 technologies in academic libraries, a case study of student use a...
Library 2.0 technologies in academic libraries, a case study of student use a...
 
library 3.0
library 3.0library 3.0
library 3.0
 
Enterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core ArchitectureEnterprise Library 2.0 Core Architecture
Enterprise Library 2.0 Core Architecture
 
Enterprise Library 5
Enterprise Library 5Enterprise Library 5
Enterprise Library 5
 
Developer’s guide to microsoft enterprise library preview
Developer’s guide to microsoft enterprise library previewDeveloper’s guide to microsoft enterprise library preview
Developer’s guide to microsoft enterprise library preview
 
Policywriting
PolicywritingPolicywriting
Policywriting
 
Library Policies: The Good, The Bad, and The Ugly
Library Policies: The Good, The Bad, and The UglyLibrary Policies: The Good, The Bad, and The Ugly
Library Policies: The Good, The Bad, and The Ugly
 
Reaching the Users Where They Are: Web 2.0 Tools for Libraries (Library 2.0)
Reaching the Users Where They Are: Web 2.0 Tools for Libraries (Library 2.0)Reaching the Users Where They Are: Web 2.0 Tools for Libraries (Library 2.0)
Reaching the Users Where They Are: Web 2.0 Tools for Libraries (Library 2.0)
 
School Fire Safety Inspections
School Fire Safety InspectionsSchool Fire Safety Inspections
School Fire Safety Inspections
 
Writers ua0312
Writers ua0312Writers ua0312
Writers ua0312
 
Library policy
Library policyLibrary policy
Library policy
 
السلامة الكيميائية
السلامة الكيميائيةالسلامة الكيميائية
السلامة الكيميائية
 
Librarian 2.0
Librarian 2.0Librarian 2.0
Librarian 2.0
 
Usage des réseaux sociaux en bibliothèque
Usage des réseaux sociaux en bibliothèqueUsage des réseaux sociaux en bibliothèque
Usage des réseaux sociaux en bibliothèque
 
Web 3.0 UX Patterns - Presented at Sencha New York Meetup September 2010
Web 3.0 UX Patterns - Presented at Sencha New York Meetup September 2010Web 3.0 UX Patterns - Presented at Sencha New York Meetup September 2010
Web 3.0 UX Patterns - Presented at Sencha New York Meetup September 2010
 
Présence des bibliothèques sur Facebook RELOADED
Présence des bibliothèques sur Facebook RELOADEDPrésence des bibliothèques sur Facebook RELOADED
Présence des bibliothèques sur Facebook RELOADED
 
Facebook et bibliothèques : une introduction et des exemples
Facebook et bibliothèques : une introduction et des exemplesFacebook et bibliothèques : une introduction et des exemples
Facebook et bibliothèques : une introduction et des exemples
 

Similar to Enterprise Library 3.0 Overview

Getting Started with Enterprise Library 3.0 in ASP.NET
Getting Started with Enterprise Library 3.0 in ASP.NETGetting Started with Enterprise Library 3.0 in ASP.NET
Getting Started with Enterprise Library 3.0 in ASP.NET
PhilWinstanley
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
danhaley45372
 

Similar to Enterprise Library 3.0 Overview (20)

Net framework session03
Net framework session03Net framework session03
Net framework session03
 
Oracle UCM Implementation Patterns
Oracle UCM Implementation PatternsOracle UCM Implementation Patterns
Oracle UCM Implementation Patterns
 
Unit i
Unit iUnit i
Unit i
 
Getting Started with Enterprise Library 3.0 in ASP.NET
Getting Started with Enterprise Library 3.0 in ASP.NETGetting Started with Enterprise Library 3.0 in ASP.NET
Getting Started with Enterprise Library 3.0 in ASP.NET
 
Introduction to Azure Cloud Storage
Introduction to Azure Cloud StorageIntroduction to Azure Cloud Storage
Introduction to Azure Cloud Storage
 
Tdd,Ioc
Tdd,IocTdd,Ioc
Tdd,Ioc
 
System verilog important
System verilog importantSystem verilog important
System verilog important
 
Vb essentials
Vb essentialsVb essentials
Vb essentials
 
Flex 4.5 jeyasekar
Flex 4.5  jeyasekarFlex 4.5  jeyasekar
Flex 4.5 jeyasekar
 
Automate Best Practices
Automate Best PracticesAutomate Best Practices
Automate Best Practices
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Silverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel PatternSilverlight Development & The Model-View-ViewModel Pattern
Silverlight Development & The Model-View-ViewModel Pattern
 
Sky High With Azure
Sky High With AzureSky High With Azure
Sky High With Azure
 
IntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and PerformanceIntelliJ IDEA Architecture and Performance
IntelliJ IDEA Architecture and Performance
 
Unit Testing Documentum Foundation Classes Code
Unit Testing Documentum Foundation Classes CodeUnit Testing Documentum Foundation Classes Code
Unit Testing Documentum Foundation Classes Code
 
Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)Whats New In 2010 (Msdn & Visual Studio)
Whats New In 2010 (Msdn & Visual Studio)
 
Deep Dive on Amazon EC2 Systems Manager
Deep Dive on Amazon EC2 Systems ManagerDeep Dive on Amazon EC2 Systems Manager
Deep Dive on Amazon EC2 Systems Manager
 
Patterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docxPatterns (contd)Software Development ProcessDesign patte.docx
Patterns (contd)Software Development ProcessDesign patte.docx
 
Struts
StrutsStruts
Struts
 
Struts Ppt 1
Struts Ppt 1Struts Ppt 1
Struts Ppt 1
 

Recently uploaded

Recently uploaded (20)

Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101AI presentation and introduction - Retrieval Augmented Generation RAG 101
AI presentation and introduction - Retrieval Augmented Generation RAG 101
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 

Enterprise Library 3.0 Overview

  • 2.
  • 3. Enterprise Library Ecosystem Partner blocks Customer blocks Community blocks p&p blocks Application Block Software Factory and Specifications p&p Enterprise Library Partner X library Customer Y library Customer Z library
  • 4.
  • 5. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 6.
  • 7.
  • 8. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 15.
  • 16.
  • 17.
  • 18. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 19.
  • 20.
  • 21.
  • 22. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 23.
  • 24.
  • 25. Data Access - Examples Public Function GetProductsInCategory(ByVal Category As Integer) As DataSet ' Create the Database object, using the database instance with the ' specified logical name. This is mapped to a connection string in ' the configuration file Dim db As Database = DatabaseFactory.CreateDatabase(&quot;Sales&quot;) ' Invoke the stored procedure with one line of code! return db.ExecuteDataSet(&quot;GetProductsByCategory&quot;, Category) ' Note: connection was closed by ExecuteDataSet method call End Function public Dataset GetProductsInCategory(string connectionString, int category) { // Create the Database object, using the specified connection string SqlDatabase db = new SqlDatabase(connectionString); // Invoke the stored procedure with one line of code! return db.ExecuteDataSet(&quot;GetProductsByCategory&quot;, category); // Note: connection was closed by ExecuteDataSet method call }
  • 26. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 27.
  • 28.
  • 29. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 30.
  • 31.
  • 32. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 33.
  • 34.
  • 35. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 36.
  • 37.
  • 38. Validation Example [StringLengthValidator(1, 50, Ruleset=&quot; RuleSetA &quot;, MessageTemplate=&quot; Last Name must be 1-50 characters &quot;)] public string LastName { get { return lastName; } set { lastName = value ; } } [RegexValidator( @&quot;+([-+.']+)*@+([-.]+)*+([-.]+)*&quot; , MessageTemplate=&quot; Invalid e-mail address &quot;, Ruleset=&quot; RuleSetA &quot;)] public string Email { get { return email; } set { email = value ; } } Validator<Customer> validator = ValidationFactory.CreateValidator<Customer>(&quot;Ruleset&quot;); ValidationResults results = validator.Validate(customer); if (!results.IsValid) { foreach (ValidationResult result in results) { Console.WriteLine(&quot;Message={0}, Key={1}, &quot;Tag={2}&quot;, result.Message, result.Key.ToString(), result.Tag == null ? &quot;null&quot; : &quot;amp;quot;&quot; + result.Tag.ToString() + &quot;amp;quot;&quot;); } } Specify validation rules in attributes… … or in configuration Validate objects and process results
  • 39. Enterprise Library 3.0 – Application Blocks Core Caching Security Data Access Logging Exception Handling Plug-in Config Helpers & Design Instrumen- tation Object Builder Cryptography Policy Injection Validation
  • 40.
  • 41.
  • 42. Policy Injection Example public class BankAccount : MarshalByRefObject { // Constructors and fields omitted [ValidationCallHandler] public void Deposit([RangeValidator(typeof(Decimal), &quot;0.0&quot;, RangeBoundaryType.Exclusive, &quot;0.0&quot;, RangeBoundaryType.Ignore)] decimal depositAmount) { balance += depositAmount; } } BankAccount account = PolicyInjection.Create<BankAccount>(customerId); account.Deposit(1234.56M); Write classes that extend MBRO or implement an interface Apply Handlers using attributes if desired Apply Policies using configuration if desired Create objects using PolicyInjection class Call your methods the usual way
  • 44.
  • 46.
  • 47.
  • 48.