Enterprise Library 3.0: Overview. Context  Reusable components are important Address common development challenges consistently across applications 

Slides:



Advertisements
Similar presentations
Best Practices For Application Development Steven Wilssens & Jelle Druyts Compuware.NET Consultants
Advertisements

Designing, Deploying and Managing Workflow in SharePoint Sites Steve Heaney Product Development Manager OBS
Introducing the Policy Injection Application Block
Enterprise development reference architecture (EDRA) -Deepti Seelamsetti.
Enterprise Library for.NET Framework 2.0: Core Architecture.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Leveraging Enterprise Library in Your Applications Keith Elder Quicken Loans Manager, Sr. Software Engineer Microsoft MVP Keith a t keithelder dot net.
Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307.
Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
Performed by:Gidi Getter Svetlana Klinovsky Supervised by:Viktor Kulikov 08/03/2009.
Hands-On Microsoft Windows Server 2003 Administration Chapter 5 Administering File Resources.
Patterns & practices Enterprise Library Brian Button Consultant/Developer patterns & practices.
Membership, Role Manager and Profile Membership, Role Manager and Profile Matt Gibbs ASP.NET Development Manager.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 10: Server Administration.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
MCTS Guide to Microsoft Windows Server 2008 Network Infrastructure Configuration Chapter 7 Configuring File Services in Windows Server 2008.
Create with SharePoint 2010 Jen Dodd Sr. Solutions Consultant
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Creating Business Workflow Using SharePoint Designer 2007 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft SQL Server.
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
©2004 Avanade Inc. All rights reserved. The Avanade name and logo are registered trademarks in the US and other countries. Enterprise Library v1.0 A Technical.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Java Beans.
Introducing the Validation Application Block. Agenda  Enterprise Library 3.0 Introduction  Validation Application Block Overview  Applying, using and.
Doing Something Useful with Enterprise Library 3.0 Benjamin Day Level: Intermediate.
Oracle Application Express 3.0 Joel R. Kallman Software Development Manager.
Enterprise Library for.NET Framework 2.0: Overview.
Enterprise Library 3.0: What’s New?. The Story So Far…  Application Blocks are reusable, extensible source-code components that provide guidance for.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
Module 7: Fundamentals of Administering Windows Server 2008.
SAMANVITHA RAMAYANAM 18 TH FEBRUARY 2010 CPE 691 LAYERED APPLICATION.
Microsoft SharePoint Server 2010 for the Microsoft ASP.NET Developer Yaroslav Pentsarskyy
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Section 11: Implementing Software Restriction Policies and AppLocker What Is a Software Restriction Policy? Creating a Software Restriction Policy Using.
Chapter 38 Persistence Framework with Patterns 1CS6359 Fall 2011 John Cole.
Getting Started with Enterprise Library 4.x in ASP.NET Pawas Goyal
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
1 Objectives Discuss File Services in Windows Server 2008 Install the Distributed File System in Windows Server 2008 Discuss and create shared file resources.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Introduction to EJB. What is an EJB ?  An enterprise java bean is a server-side component that encapsulates the business logic of an application. By.
Microsoft Visual Studio 2005 Tools for the Office System: Building Office Solutions Using Visual Studio 2005 Tools for Office Andrew Coates Developer Evangelist.
Configuring and Deploying Web Applications Lesson 7.
Enterprise Library Caching Application Block Peter Provost Software Design Engineer Ron Jacobs Product Manager Scott Densmore Software Design Engineer.
Extending SharePoint through Web Parts and ASP.NET 최승현 대리 한국마이크로소프트.
Module 6: Administering Reporting Services. Overview Server Administration Performance and Reliability Monitoring Database Administration Security Administration.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
4.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 12: Implementing Security.
Securing Web Applications Lesson 4B / Slide 1 of 34 J2EE Web Components Pre-assessment Questions 1. Identify the correct return type returned by the doStartTag()
Enterprise Library Overview Tom Hollander Product Manager Microsoft Edward Jezierski ArchitectMicrosoft Kyle Huntley Architect Avanade Ron Jacobs Product.
Packaging Design and Architecture Guidance for Visual Studio Tom Hollander Wojtek Kozaczynski Harry Pierson Microsoft.
Introduction to Microsoft.NET Enterprise Library (Patterns and Practices) Zaw Moe Tun Myanmar Information Technology.
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Windows Workflow Foundation Guy Burstein Senior Consultant Advantech – Microsoft Division
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
Business Process Execution Language (BPEL) Pınar Tekin.
SQL Database Management
Building Enterprise Applications Using Visual Studio®
Enterprise Library Overview
Magento Technical Guidelines Eugene Shakhsuvarov, Software Magento
Partnership.
SAMANVITHA RAMAYANAM 18TH FEBRUARY 2010 CPE 691
Objectives In this lesson, you will learn about:
Mark Quirk Head of Technology Developer & Platform Group
Presentation transcript:

Enterprise Library 3.0: Overview

Context  Reusable components are important Address common development challenges consistently across applications  Application Blocks are a form factor for reusable components Reusable, extensible and modifiable source code  Enterprise Library is a set of general purpose application blocks Not specific to any one application type or architectural style  Can be used as-is or as a starting point for your own libraries or frameworks

p&p Enterprise Library Enterprise Library Ecosystem Partner blocks Customer blocks Community blocks p&p blocks Partner X library Customer Y library Customer Z library Application Block Software Factory and Specifications

Enterprise Library Enterprise Library is…  A library of application blocks which solve common challenges  A set of helper classes which work in any architectural style  Architectural guidance embodied in code which ships with full source allowing you to modify and extend  Available as a free download Enterprise Library is not…  A part of the.NET Framework  An application framework that imposes an architectural style  A Microsoft product with support, compatibility and localization  For sale

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Goals of Enterprise Library 3.0  Address top feedback received for existing application blocks  Provide new application blocks to support additional development challenges  Support integration with relevant features of.NET Framework 3.0  Improve the experience around key development activities  Simplify the development of new application blocks and extensions  Retain compatibility with Enterprise Library 2.0

Enterprise Library 3.0 – New Features At a Glance  New application blocks Validation Application Block Policy Injection Application Block  Improvements to existing application blocks Data Access Application Block Logging Application Block .NET Framework 3.0 integration Logging, Exception Handling and Validation Application Blocks  Configuration improvements Visual Studio-integrated configuration tool Environmental Overrides Manageable Configuration Source  Automation Application Block Software Factory Strong Naming Guidance Package

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

The Core  Configuration  Configuration Design & Tooling  Instrumentation  Object Builder

Configuration  All Enterprise Library blocks are configurable Controls how the blocks work in your app Specifies which plug-ins you are using  Blocks can be used with or without configuration files Factories build up block objects using data from the configuration files Objects can be “newed up” directly with primitive data types  Configuration stored in standard XML.config files by default Alternative “Configuration Sources” can be used Ships with System, File, Manageable and SQL configuration sources

Configuration Design & Tooling  Configuration tools eliminate the need to edit the blocks’ XML configuration files Quickly add default configuration for a block Strongly typed properties and providers Validate configuration before you save Encrypt configuration files Specify settings that are unique to different environments (development, test, production, etc.)  Visual Studio-integrated editor and standalone console are provided  Configuration Design-time subsystem can be used in your own applications and blocks to provide a similar experience for users of your own blocks and extensions

Instrumentation  All Enterprise Library blocks include instrumentation to assist in development, testing and operations Event Log events Performance Counters WMI events  All instrumentation is disabled by default, but each type can be individually enabled using the configuration tool  Installing instrumentation requires admin rights, and can be done using installutil.exe  Instrumentation code contained in Common assembly can be reused in your apps

Object Builder  Shared component used in several p&p deliverables  Responsible for building objects inside the application blocks Invoking the necessary custom factory using data from configuration Configuring instrumentation for the blocks  Can be leveraged from your own apps, but understanding ObjectBuilder is not required to use Enterprise Library  More information and downloads at

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Exception Handling Scenarios  You need consistent exception handling behavior throughout your application  You need to implement best practice guidance for exception handling Don’t inadvertently disclose security sensitive information to remote callers Add context to exceptions by wrapping or replacing exceptions with more relevant exceptions  You need to make it simple to add exception management boilerplate code

Exception Handling Application Block  Provides simple mechanism that allows you to consistently deal with exceptions throughout your application  Define “Exception Policies” which link an exception to an action Exceptions of type ApplicationException should be logged Exceptions of type SqlClientException should be caught and wrapped with an exception of type DataLayerException and re-thrown Exceptions of type SecurityException should caught and replaced with an AccessDeniedException which will be thrown  Actions provided include Logging Wrapping one exception with another Replacing one exception with an other Map to WCF Fault Contract

Exception Handling - Example Try ' some code that may throw Catch Ex As Exception If ExceptionPolicy.HandleException(ex, “Data Layer Policy”) Then Throw End Try

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Logging Scenarios  You need to log business and operations data to various destinations, which are externally configurable  You need to provide tracing to support production debugging  You need to provide auditing for increased security  You need to be able to specify which messages go where, and how they are formatted  You need to be able to log messages to a wide variety of destinations

Logging Application Block  Provides a simple model for logging events Strongly typed, extensible log schema  Built on top of System.Diagnostics  Configuration driven – you decide what messages are logged where at runtime.  Use any.NET TraceListener, including supplied formatter- aware listeners: EventLog, Database, Flat File, Rolling Flat File, MSMQ, , WMI, XML or create your own  Tracer class lets you time key activities and correlate any enclosed events

Logging - Examples Dim log As LogEntry = New LogEntry log.Message = “Your message here…” log.Priority = 1 log.EventId = 100 log.Categories.Add("UI") log.Categories.Add("Debug") Logger.Write(log) // 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);

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Data Access Scenarios  You need a simple and efficient way of working with commonly used databases  Transparency when developing for multiple types of databases SQL Server, SQL Server CE, Oracle, OLE-DB, ODBC, …  A way to place an indirection between a logical database instance and a physical database instance  An easy way to adjust and validate the database configuration settings

Data Access Application Block  Provides simplified access to the most often used features of ADO.NET with applied best practices  Improve Consistency Write code that works against multiple database brands (caveats apply!) Integrate with System.Transactions functionality  Improve ease of use Easily call a stored procedure with one line of code Let the block manage the lifetime of database connections Work with database connection strings stored in configuration or specified in code

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 }

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Caching Scenarios  You are creating a smart client application that uses locally cached reference data to create requests and support offline operations  You are building an application that requires cache data to be durable across application restarts  Note: ASP.NET cache (System.Web.Caching) can be used across multiple application types and is generally a better choice for applications that don’t require the cache to be persisted

Caching Application Block  Provides a flexible and extensible caching mechanism that can be used at all layers of an application  Supports backing stores that persist cache data into a database or isolated storage, so the data can survive app restarts  Thread-safe Ensures that the states of the in-memory cache and the backing store remain synchronized.

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Cryptography Scenarios  You need to encrypt sensitive data using a symmetric key before storing in the database and decrypt when reading  You need to encrypt information (without using keys) for use on a single machine  You need to create a hash of a password to store in a database and be able to compare that hash with a user supplied hash to see if you have a match without storing the user password

Cryptography Application Block  Improves Security Provides a simplified approach to implementing common cryptography scenarios  Improves Ease Of Use Provides operations on both strings and byte streams CreateHash, CompareHash, EncryptSymmetric, DecryptSymmetric  Improves Integration Supports all.NET crypto algorithms out of the box, or implement your own Supports DPAPI for keyless crypto on a single machine Algorithms and keys can be managed through the configuration tool

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Security Scenarios  You need to authorize users Using one or more security systems or mechanisms  You need to cache authentication or authorization data for the duration of a logon session  Note: The original release of the Enterprise Library Security Application Block also supported Authentication, Profile and Roles. This is now supported by the.NET Membership and Profile class, so this functionality has been removed from the block.

ASP.NET Security Application Block + ASP.NET  Encapsulate common application security tasks  Present a standard, provider model for common security tasks  Minimize the need for custom security-related code  Incorporate best practices for application security 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 CachingApplicationBlock

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Validation Scenarios  You need to check if data is valid before processing it Input from end users or untrusted systems Improve security and system responsiveness  You need your validation logic to be easy to maintain During development and after deployment  You need to validate the same data in different layers of an application Using consistent validation logic  You need to integrate validation seamlessly into different layers of your application User interface and web service interface layers

Validation Application Block  Specify your validation rules once In configuration, Using attributes, Programmatically  Easily validate data from anywhere in your application Programmatically Integrated into Windows Forms, ASP.NET or WCF  Composable validation logic Built-in library of common primitive validation rules Combine validation rules on type members and using Boolean logic Apply multiple validation rule sets to the same types

Validation Example [StringLengthValidator(1, 50, Ruleset="RuleSetA", MessageTemplate="Last Name must be 1-50 characters")] public string LastName { get { return lastName; } set { lastName = value; } } MessageTemplate="Invalid address", Ruleset="RuleSetA")] public string { get { return ; } set { = value; } } [StringLengthValidator(1, 50, Ruleset="RuleSetA", MessageTemplate="Last Name must be 1-50 characters")] public string LastName { get { return lastName; } set { lastName = value; } } MessageTemplate="Invalid address", Ruleset="RuleSetA")] public string { get { return ; } set { = value; } } Validator validator = ValidationFactory.CreateValidator ("Ruleset"); ValidationResults results = validator.Validate(customer); if (!results.IsValid) { foreach (ValidationResult result in results) { Console.WriteLine("Message={0}, Key={1}, "Tag={2}", result.Message, result.Key.ToString(), result.Tag == null ? "null" : "\"" + result.Tag.ToString() + "\""); } Validator validator = ValidationFactory.CreateValidator ("Ruleset"); ValidationResults results = validator.Validate(customer); if (!results.IsValid) { foreach (ValidationResult result in results) { Console.WriteLine("Message={0}, Key={1}, "Tag={2}", result.Message, result.Key.ToString(), result.Tag == null ? "null" : "\"" + result.Tag.ToString() + "\""); } Specify validation rules in attributes… …or in configuration Validate objects and process results

CachingCaching SecuritySecurity DataAccessDataAccessLoggingLogging ExceptionHandlingExceptionHandling Enterprise Library 3.0 – Application Blocks Plug-in ConfigHelpers & Design ConfigHelpers Instrumen- tation Object Builder CryptographyCryptography Core Policy Injection ValidationValidation

Policy Injection Scenarios  Separate cross-cutting concerns from business logic Use interception and injection to apply policies at runtime Provide a declarative way of specifying which policies are applied where Allow policies to be defined using configuration or attributes  Integrate Enterprise Library Application Blocks into applications without the need to write code Validation, Logging, Authorization, Exception Handling, Caching, Performance Counters

Policy Injection Application Block  Policy Injection Application Block provides a factory for creating or wrapping policy-enabled objects  If policies are defined in attributes or configuration, a proxy is returned in lieu of the real object  When calling policy-enabled members, a handler pipeline is executed before and after the real member is called  Each handler can read and manipulate the data going in and out of the call

Policy Injection Example public class BankAccount : MarshalByRefObject { // Constructors and fields omitted [ValidationCallHandler] public void Deposit([RangeValidator(typeof(Decimal), "0.0", RangeBoundaryType.Exclusive, "0.0", RangeBoundaryType.Ignore)] decimal depositAmount) { balance += depositAmount; } public class BankAccount : MarshalByRefObject { // Constructors and fields omitted [ValidationCallHandler] public void Deposit([RangeValidator(typeof(Decimal), "0.0", RangeBoundaryType.Exclusive, "0.0", RangeBoundaryType.Ignore)] decimal depositAmount) { balance += depositAmount; } BankAccount account = PolicyInjection.Create (customerId); account.Deposit( M); BankAccount account = PolicyInjection.Create (customerId); account.Deposit( M); 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  Enterprise Library 3.0 includes a new software factory for building your own application blocks and extensions to existing application blocks  Features include: Code generation in either C# or Visual Basic.NET Solution templates for Application Blocks and Provider Libraries Recipes to create custom providers for Enterprise Library application blocks Including Validators, Trace Listeners, Exception Handlers and Authorization Providers Strongly-typed or property bag-based configuration Recipes to create new factories, provider bases and providers for your own blocks Recipes to create design-time configuration code from runtime configuration classes

Application Block Software Factory

Strong Naming Guidance Package  Strong-naming Enterprise Library is recommended, but complex 90+ projects, including design-time and tests Use of [InternalsVisibleTo] attribute for testing  Strong Naming Guidance Package automates: Generating strong-name key pairs Specifying that projects should be strong-named Updating [InternalsVisibleTo] to include public key  Can be run on Enterprise Library or any other solution  Enterprise Library 3.0 also ships with pre-built, strong- named assemblies which you can use if you don’t want to modify the code.

Resources  Download Enterprise Library and related resources from:  Join the Enterprise Library Community at:  Read blogs from the Enterprise Library team at: