Doing Something Useful with Enterprise Library 3.0 Benjamin Day Level: Intermediate.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 10 API Review; Where Next.
Advertisements

Designing, Deploying and Managing Workflow in SharePoint Sites Steve Heaney Product Development Manager OBS
Apache Struts Technology
Introducing the Policy Injection Application Block
Randy Williams, MOSS MVP Senior Consultant Synergy Corporate Technologies.
Enterprise Library 3.0: Overview. Context  Reusable components are important Address common development challenges consistently across applications 
Web Applications Development Using Coldbox Platform Eddie Johnston.
QAD Integrated Customization Toolkit (ICT)
Enterprise Smart Clients Architecture, Patterns, Design, Best Practices Keith Elder Manager, Sr. Software Engineer Quicken Loans Blog:
Enterprise development reference architecture (EDRA) -Deepti Seelamsetti.
VAR318: Developing Service Oriented Workflows Brian Noyes IDesign Inc (
Introduction to Windows Workflow Foundation (WF) Keith Elder Microsoft MVP Blog: Quicken Loans –
Building Enterprise Applications Using Visual Studio ®.NET Enterprise Architect.
Business Rules and SharePoint Workflow with Master Data Services (MDS)
Leveraging Enterprise Library in Your Applications Keith Elder Quicken Loans Manager, Sr. Software Engineer Microsoft MVP Keith a t keithelder dot net.
Pragmatic Application Building: Step by Step Jay Sissom Principal Systems Analyst Indiana University
Tom Hollander Solution Architect Solutions Development Centre Microsoft Australia ARC307.
Using Microsoft SharePoint to Develop Workflow and Business Process Automation Ted Perrotte National Practice Manager, Quilogy, Microsoft Office SharePoint.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
Serious Team Foundation Server Customization Benjamin Day Benjamin Day Consulting, Inc Level: Advanced.
UNIT-V The MVC architecture and Struts Framework.
1 Developing Rules Driven Workflows in Windows Workflow Foundation Jurgen Willis COM318 Program Manager Microsoft Corporation.
Create with SharePoint 2010 Jen Dodd Sr. Solutions Consultant
Win & Web App Installers with WiX
Creating Business Workflow Using SharePoint Designer 2007 Presented by Tarek Ghazali IT Technical Specialist Microsoft SQL Server MVP Microsoft SQL Server.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
Design for Testability: Mocks, Stubs, Refactoring, and User Interfaces Benjamin Day.
Introducing the Validation Application Block. Agenda  Enterprise Library 3.0 Introduction  Validation Application Block Overview  Applying, using and.
De-mystifying TFS Reporting Benjamin Day Level: Intermediate.
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
Enterprise Library 3.0: What’s New?. The Story So Far…  Application Blocks are reusable, extensible source-code components that provide guidance for.
Windows Azure Tour Benjamin Day Benjamin Day Consulting, Inc.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
StyleCop Breaking down the barriers to entry Gary Ewan Park Twitter: Blog:
Building an Offline Smart Client using Domain-Driven Design Principles Tim McCarthy.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
LiveCycle Data Services Introduction Part 2. Part 2? This is the second in our series on LiveCycle Data Services. If you missed our first presentation,
Basic Developer Knowledge That Every SharePoint Admin Must Have Randy Williams, MVP MOSS Synergy Corporate Technologies
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
Introduction to Exception Handling and Defensive Programming.
Master Data Management & Microsoft Master Data Services Presented By: Jeff Prom Data Architect MCTS - Business Intelligence (2008), Admin (2008), Developer.
Building State of the art presentation tiers Nauzad Kapadia
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
Presented by Vishy Grandhi.  Architecture (Week 1) ◦ Development Environments ◦ Model driven architecture ◦ Licensing and configuration  AOT (Week 2)
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
Enterprise Library Caching Application Block Peter Provost Software Design Engineer Ron Jacobs Product Manager Scott Densmore Software Design Engineer.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Overview of the Spring Framework Introducing.
Troubleshooting Workflow 8 Raymond Cruz, Software Support Engineer.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Eliminate Team Build Headaches with Unit Tests, WiX and Virtualization Benjamin Day
Windows Workflow Foundation Guy Burstein Senior Consultant Advantech – Microsoft Division
BizTalk Damir Dobric Lead Architect. Agenda Microsoft BizTalk RFID Overview Architecture Application models Implementing Event Handlers Sensors.
Win & Web App Installers with WiX Benjamin Day Level: Intermediate.
Windows Azure: Is the Relational Database Dead? Benjamin Day
Benjamin Day blog.benday.com.  Owner, Benjamin Day Consulting, Inc.   Web:
Mikael Deurell Senior Consultant Microsoft Mail: Blog: blogs.msdn.com/deurell.
Application generation Peter Bell SystemsForge Peter Bell SystemsForge Beyond Scaffolding.
Enterprise Library 3.0 Memi Lavi Solution Architect Microsoft Consulting Services Guy Burstein Senior Consultant Advantech – Microsoft Division.
Beyond Basic Unit Testing: Mocks, Stubs, User Interfaces, and Refactoring for Testability Benjamin Day
Joy Rathnayake Senior Architect – Virtusa Pvt. Ltd.
Building Enterprise Applications Using Visual Studio®
How to be a SharePoint Developer
MVC Architecture, Symfony Framework for PHP Web Apps
Enterprise Library Overview
Magento Technical Guidelines Eugene Shakhsuvarov, Software Magento
Module 1: Getting Started
Partnership.
Implementing Security in ASP.NET Core: Claims, Patterns, and Policies
Presentation transcript:

Doing Something Useful with Enterprise Library 3.0 Benjamin Day Level: Intermediate

About the speaker Owner, Benjamin Day Consulting, Inc. – –Web: –Blog: Trainer –Visual Studio Team System, Team Foundation Server Microsoft MVP for C# Microsoft VSTS/TFS Customer Advisory Council Leader of Beantown.NET INETA User Group

Agenda Overview Policy Injection Logging Exception Handling Validation

Why Enterprise Library? Why not? –Why write and re-write common application code? Focus on solving the core business problem Microsoft solved it for you –Standardized solution –Hooks in nicely with.NET through configs It’s free

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

Data Access Block Wraps common actions for database access Handles closing of connections, IDispose calls Some degree of database independence Relatively easy to understand

Adopting Enterprise Library Why is this talk titled “Doing Something Useful…”? Can be like swimming in the Atlantic at low tide in the spring What does this have to do with the Data Access Block? Does it have to be so difficult?

My $0.02 on where begin Start with the Policy Injection Block –Allows you to defer decisions on other blocks Configure PIB to use logging –Simple way to debug your configuration Exception Handling Block –(eat your vegetables) Caching –Fix performance problems

Policy Injection Block Uses magic Mostly elves Some wood nymphs for reliability Just kidding.

Policy Injection Block Layer of abstraction Lets you hook functionality in at runtime via config Intercepts calls in to an object’s methods Think aspect-oriented programming or dependency injection for methods

The Overall Design

Getting started with the PI block Two ways to use Policy Injection: –Objects extend from MarshalByRef –Code against interfaces instead of concrete classes Add references –Microsoft.Practices.EnterpriseLibrary.PolicyInjection –Microsoft.Practices.ObjectBuilder –Microsoft.Practices.EnterpriseLibrary.CallHandlers –Plus, whatever block you’ll reference from PI Edit app.config/web.config with EntLibConfig.exe

Calling into the PI framework Call PolicyInjection.Create () or one of the overloads Returns a wrapper to your object Call your methods through the wrapper

Configuration EntLibConfig.exe Uses the Remoting Policy Injector Policy consists of –Matching Rules –Handlers

Matching Rules Tells the framework when to run the policy

Handlers Tells the framework what to do when it finds a policy match

Logging Handler Through policy injection framework, intercepts calls Writes message to log before and/or after

Logging Application Block Logs activity in your app Trace Listeners –Where does it get stored? Formatters –How does it get stored? Filters –What to write?

Logging Block Design

Trace Listeners

Formatters

Demo Add Policy Injection to an existing app Configure logging

Exception Handling Block Allows you to define how to treat exceptions Option: Catch and re-throw different exception Option: Eat the exception

Design of the Exception Block

Demo Add exception handling to our app via Policy Injection Wrap Handlers Replace Handlers

Demo Add Exception Handling to a WCF application

The Validation Block

About the Validation Block Allows you to validate access to your objects Validation logic can be stored outside of your objects in the configs Validation can also be defined via attributes Similar to a rules engine –Think Windows Workflow Rules “light”

Available Validators And Composite Contains Characters Date Time Range Domain Enum Conversion Not Null Object Collection Object Validator Or Composite Property Compare Range Validator RegEx Relative Date Time String Length Type Conversion

Common Validator Fields MessageTemplate –Provides a human-readable error message –Overrides the default implementation MessageTemplateResourceName –Enables messages in resource files MessageTemplateResourceType Negate –If statement evaluates to true  rule fails –false  succeeds Tag –Category for the validation

Message Template Tokens Think String.Format() Use these to create custom messages {0} –Original value being validated {1} –“Key” for the value –If property or field  name (m_id or Id) –If object  null {2} –The tag value if available

Service Layer Pattern From “Patterns Of Enterprise Application Architecture” by Martin Fowler, Randy Stafford, et al. Chapter 9 “Defines an application’s boundary with a layer of services that establishes a set of available operations and coordinates the application’s response in each operation.” -Randy Stafford

Demo Validate Restaurant with the ValidationFactory

The Caching Block Allows you to cache return values from method, properties Easy to add with the Policy Injection Block

Demo Populate list of states using the caching block

Summary Policy Injection Block Helps Speed Adoption Logging Block Exception Handling Block Exception Handling in WCF Validation Block Caching Block

About the speaker Owner, Benjamin Day Consulting, Inc. – –Web: –Blog: Trainer –Visual Studio Team System, Team Foundation Server Microsoft MVP for C# Microsoft VSTS/TFS Customer Advisory Council Leader of Beantown.NET INETA User Group