Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Microsoft.NET Enterprise Library (Patterns and Practices) Zaw Moe Tun Myanmar Information Technology.

Similar presentations


Presentation on theme: "Introduction to Microsoft.NET Enterprise Library (Patterns and Practices) Zaw Moe Tun Myanmar Information Technology."— Presentation transcript:

1 Introduction to Microsoft.NET Enterprise Library (Patterns and Practices) Zaw Moe Tun Myanmar Information Technology

2 Agenda ■Technology Review ■N-tier Application Architecture ■Microsoft.NET Technology Overview ■Enterprise library ■Demos ■Q & A

3 Technology Review Data Program Stand Alone System

4 Technology Review Query Execute Record set Returns Database Server Client Server Architecture ( 2-tier) Programs

5 Technology Review Business LogicsData Sources Web Server Web-based users Web Application Architecture (n-tier) Presentation BusinessData Access

6 Typical Roles of each Tier ■Presentation ●Rendering, acquisition and validation. ●Interpret gestures. ■Business ●Stateless components ●Implement short-lived business activities ●Enforce policy ●Aggregate data from data sources and services ●Represent data in business-relevant schemas ■Data Access ●Stateless encapsulation of data access and transformation logic ●Provides wrappers for calling stored procedures.

7 Benefits of N-Tier Architecture ■Scalability and Performance ●Can use different machines for each tier. ●Can also use multiple machines per tier. ■Maintainability and Stability ●Highly specialized components. ●Separation of concerns. ■Flexibility ●Supports reuse. ●Interchange components with same interface ●Loosely coupled -> flexible deployment

8 Beyond N-Tier Business Components Data Sources Web Server Process OrchestrationService Ifaces & Agents Internal Services Web-based users Rich Clients/Smart Client Services Business to Business

9 .NET N-Tier Technology Tools - Visual Studio.NET Foundation -.NET Framework Presentation Layer Business Objects Back-End Access.NET Components COM+ for Transactions ADO.NET ASP.NET Web Services.NET Remoting ASP.NET Web Forms Win Forms Mobile Forms

10 .NET Technology Overview Next generation of Microsoft development platform

11 .NET Framework ■The.NET Framework is an Integral Windows component that supports building and running the next generation of applications and XML Web services ■Well, Microsoft equivalent to J2EE

12 Two Main Components ■The.NET Framework has two main components: ●The common language runtime (CLR) ■The foundation of the.NET Framework ■Manages code at execution time, providing core services such as memory management, thread management and etc’ ●The.NET Framework class library ■The class library is a comprehensive, object- oriented collection of reusable types that developer can use to develop applications

13 Modern Software Challenges ■Heterogeneous client platform ●Personal Computer, PDA, Mobile Phone ●Global Audience ■Communication ●Different type of network (Internet, intranet) ●Different type of protocol (TCP/IP, HTTP, WAP, SOAP, etc…) ■Security ●Information is transmitted via public network ■Scalability ●Must be able to perform within expected performance ■Reliability ●24/7 availability

14 Why Process Model ?

15 Waterfall and spiral models

16 MSF Process Model ■The MSF Process Model combines the best principles of the waterfall and spiral models. ■It combines the waterfall model’s milestone-based planning and resulting predictability with the spiral model’s benefits of feedback and creativity.

17 MSF Process Model

18 MSF Versioned Release

19 Role Combination

20 MSF Process Model and UML Views

21 Tradeoff Triangle

22 What is Rapid Development ■Rapid development is a generic term that means the same thing as 'speedy development' or 'shorter schedules.' It means developing software faster than you do now."

23 Enterprise Library blocks

24 Introducing “Enterprise Library” ■Library of reusable software assets to address common enterprise development challenges ■Part of the patterns & practices guidance library ■Strong focus on consistency, extensibility, ease of use and integration

25 Consistency ■Design and implementation principles ■Configuration ■Documentation ■Tests ■Tooling ■Samples ■Operational requirements ■Installation procedures

26 Extensibility ■Extending existing blocks ●Pluggable providers ■Modifying existing blocks ●Design documentation and Unit Tests included ■Guidelines how to create new blocks ●Design patterns and principles ●Hooking into config tool ●Documentation guidelines and templates ●Testing requirements

27 Ease Of Use ■Configuration tooling ■Simplified installation and deployment ■Improved documentation and samples

28 Integration ■Packaged as a library ●Not a Framework: does not prescribe an architecture ■Blocks are designed to work well together, but they can still be used individually ●Loose coupling between blocks ■Configuration understands how to use blocks together in application ●Blocks used as providers for other blocks

29 Security Crypto ConfigRun-TimeConfigTooling DataAccess Logging & Instrumentation Caching ExceptionHandling Enterprise Library v1

30 Interdependece of application blocks

31 Data Access Application Block ■Provides simplified access to the most common data access operations ■Aim was to keep much of the simplicity of the original DAAB blocks, but to provide additional features requested by customers ■Notable new features: ●Support for multiple database types through a factory (SQL Server, Oracle and DB2 out of the box). This provides consistent and portable code (caveats apply!) ●Connection strings are stored and managed in external configuration

32 Data Access Application Block Design for Simplified Data Access ■Uniform methods of data access make code easier to understand, more predictable and easier to maintain ■Data Access is simplified ●Housekeeping actions are performed automatically ●Complex actions are encapsulated and exposed as simple methods ■All interactions happen through the abstract base Database class ● ExecuteDataSet() ● LoadDataSet() ● ExecuteReader() ● ExecuteScalar() ● ExecuteNonQuery() ● UpdateDataSet() ■Note: each method has multiple overloads

33 Data Access Application Block Design Overview Configuration Application Block Database factory Database factory Database Data Access Application Block dataconfiguration.config Client Code CreateDatabase() Parameter Cache Parameter Cache MS SQL Database MS SQL Database Oracle Database Oracle Database DB2 Database DB2 Database Command Wrapper Database Command Wrapper MS SQL Command MS SQL Command Oracle Command Oracle Command DB2 Command DB2 Command Create Complex Commands Invoke Operations on db instance 1.0

34 Configuration Application Block ■Allows applications to easily read and write configuration data from configurable storage locations ■Used by all blocks in Enterprise Library, can also be used by customer blocks, frameworks and applications ■Includes two parts: ●Configuration Runtime, which applications use at runtime to access configuration data ●Configuration Designtime, which provides nodes that are used by the configuration tool to give a simple design-time experience ■Configuration can be encrypted and individual elements can be masked in the tool ■Enterprise Library will include standalone and Visual Studio-integrated versions of the configuration tool

35 Configuration Application Block Design Overview Configuration Manager Configuration Manager Client Code Configuration Context Configuration Context IStorageProviderWriter: IStorageProviderReader IStorageProviderWriter: IStorageProviderReader App.Config / Web.Config Configuration Builder Configuration Builder Configuration Cache (hashtable) Configuration Cache (hashtable) XmlFileStorageProvider ITransformer XmlSerializerTransformer Configuration Dictionary Configuration Dictionary Client Code Other Application Blocks Static Facade Custom config Configuration Application Block

36 Exception Handling Application Block ■Facilitates consistent exception handling behavior at logical boundaries of an application ■Allows the creation of “exception policies” which dictate which actions should be taken for specific exception types at the logical boundary ●Example: All security exceptions arising from the business layer need to be logged, and the messages sanitized before being propagated to the caller ■Actions are extensible; we provide Logging, Wrapping one exception with another, and Replacing one exception with an other ■Block has little in common with the existing EMAB which was primarily used to log exceptions

37 Exception Handling Application Block Design Overview Logging Application Block Configuration Application Block Exception Policy exceptionhandling configuration.config Client Code dataconfiguration. config Exception Policy Entry Exception Policy Entry IExceptionHandler Wrap Handler Wrap Handler Logging Handler Logging Handler Replace Handler Replace Handler Custom Handler Custom Handler HandleException(“policyname”) Each Policy has different exceptions Each Policy Entry has set of handlers 1.0

38 Logging & Instrumentation Application Block ■Allows applications to log business and operations data to various destinations, which are externally configurable ■Replaces the Enterprise Instrumentation Framework and the existing Logging Application Block ■Configuration specifies which messages go where, and how they are formatted ■Formatters and sinks are extensible. We provide sinks for Event Log, Database, Text File, MSMQ, E-mail, WMI and Windows Event Tracing

39 Logging and Instrumentation Design Overview Configuration Application Block Logger Logging and Instrumentation Application Block logging configuration.config Client Code Strategies implement ILogDistribution interface Write() LogEntry LogWriter ILogDistribution Strategy ILogDistribution Strategy InProc Distribution Strategy InProc Distribution Strategy MSMQ Distribution Strategy MSMQ Distribution Strategy LogDistributor MSMQLogDistributor ILogSink Email Sink Email Sink FlatFile Sink FlatFile Sink EventLog Sink EventLog Sink Msmq Sink Msmq Sink WMIlog Sink WMIlog Sink MSMQ Sinks implement ILogSink interface Add Logging Details 1.0 Database Sink Database Sink

40 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 ■Can be used in ASP.NET apps, although the ASP.NET cache is preferred for simple scenarios ■Supports similar scenarios to the original caching block, but with a revised architecture to make it more thread- and exception-safe

41 Caching Application Block Design Overview Data Access Application Block Configuration Application Block CacheManager Factory CacheManager Factory Null BackingStore (for memory) Null BackingStore (for memory) Cache Application Block securityconfigura tion.config Client Code dataconfiguration.config Cache Manager Cache Manager Cache Database BackingStore Database BackingStore IsolatedStorage BackingStore IsolatedStorage BackingStore Base BackingStore Base BackingStore Expiration Task Expiration Task Scavenge Task Scavenge Task Background Scheduler Background Scheduler Add/Retrieve Create Instance 1.0

42 Cryptography Application Block ■Provides a simplified approach to implementing common cryptography scenarios ■Includes modules for symmetric cryptography and hashing ■Each module supports pluggable algorithms and key stores ●Supports all.NET crypto algorithms out of the box, or developers can implement their own ■Algorithms and keys can be managed through the configuration tool

43 Cryptography Application Block Design Overview Configuration Application Block Cryptographer Symmetric ProviderFactory Symmetric ProviderFactory Cryptography Application Block securitycryptography configuration.config Client Code EncryptSymmetric/DecryptSymmetric Hash ProviderFactory Hash ProviderFactory DpapiSymmetric Cryptographer DpapiSymmetric Cryptographer Symmetric Cryptographer Symmetric Cryptographer KeyedHash Algorithm Provider KeyedHash Algorithm Provider HashAlgorithm Provider HashAlgorithm Provider ISymmetricCrypto Provider ISymmetricCrypto Provider DpapiSymmetric Crypto Provider DpapiSymmetric Crypto Provider DpapiSymmetric Crypto Provider DpapiSymmetric Crypto Provider IHash Provider IHash Provider CreateHash/CompareHash 1.0

44 Security Application Block ■Provides a simple API and pluggable implementations of core security primitive operations ■Covers 5 security areas: Authentication, Authorization, Roles, Profile and Security Caching ■Each module supports extensible plug-in providers. In general we supply plug-ins for common Microsoft infrastructure (AD, AzMan) as well as a light-weight database implementation ■Developers can build their own plug-ins to interface with existing security solutions

45 Security Application Block Role-based Security: Principals and Identities Principal Authentication Module(s) Authentication Module(s) Application Security Context Windows Forms Passport IPrincipal Identity IsInRole() IPrincipal Identity IsInRole() GenericPrincipal Identity IsInRole() GenericPrincipal Identity IsInRole() WindowsPrincipal Identity IsInRole() WindowsPrincipal Identity IsInRole() Custom Principal Identity IsInRole() custom methods Custom Principal Identity IsInRole() custom methods Credentials (username, password) Identity Roles

46 Some Reference Applications ■Task Vision ■Infragistics (Third Party Tools)

47 Reference website ■http://www.windowsforms.net/Applications/ application.aspx?PageID=20&tabindex=8http://www.windowsforms.net/Applications/ application.aspx?PageID=20&tabindex=8 ■http://msdn.microsoft.com/library/default.a sp?url=/library/en- us/dnpag2/html/ehab.asphttp://msdn.microsoft.com/library/default.a sp?url=/library/en- us/dnpag2/html/ehab.asp ■http://www.gotdotnet.com/workspaces/wor kspace.aspx?id=295a464a-6072-4e25- 94e2-91be63527327http://www.gotdotnet.com/workspaces/wor kspace.aspx?id=295a464a-6072-4e25- 94e2-91be63527327

48 Conclusion ■Software Engineer's capability depends on ●what he/she has in his/her toolkit ●His/her ability to apply the right tools for the right purpose


Download ppt "Introduction to Microsoft.NET Enterprise Library (Patterns and Practices) Zaw Moe Tun Myanmar Information Technology."

Similar presentations


Ads by Google