http://msdn.com/practices. john devadoss product unit manager, patterns & practices...

63
http://msdn.com/practices

Upload: jessie-cody-white

Post on 18-Jan-2016

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

http://msdn.com/practices

Page 2: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

an introduction to the application architecture guide

john devadossproduct unit manager, patterns & practices

[email protected] 301

Page 3: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

What is Architecture?

Pop Quiz

Page 4: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Agenda

A Lap around the Application Architecture Guide v2

Architecture Hot Spots

Using the Application Architecture Guide in the Real World

Discussion

Walk-through/demo

Page 5: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301
Page 6: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Ray Ozzie on the Application Architecture Guide 2.0…

“This guide is a tremendous compilation of patterns, practices, architectural styles and other principles to be used when structuring a contemporary .NET application”

“Whether developing software targeted at the PC or a phone; or developing services for the web or an enterprise server; or developing a composite software + services solution, this book will provide you a wealth of useful and practical guidance.”

Page 7: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301
Page 8: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Grady Booch on the Application Architecture Guide 2.0…

Architecture is About Significant DecisionsI find this work to be very interesting (and useful). Architecture is all about making significant design decisions, and this guide focuses on a number of such decision points, including caching, communication, concurrency and transactions, configuration management, coupling and cohesion, data access, exception management, layering, logging and instrumentation, state management, structure, validation, and workflow (collectively, Microsoft calls these "architectural frames").

A Language for ApplicationsFull of best practices and patterns, I particularly liked the enumeration of architectural styles the authors have collected: client-server, component-based, layered, message-bus, model-view-controller, n-tier, object-oriented, and service-oriented. Congruent with these styles is their concept of application archetypes, which include mobile, rich client, rich internet, services, and web. Combine the these styles and archetypes, and you have an interesting language for describing a large class of applications.

Page 9: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301
Page 10: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301
Page 11: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

5 Key Usage Scenarios for the Guide

1. Choose the right architecture for your application

2. Choose the right technologies

3. Make more effective choices for key engineering decisions

4. Map appropriate application patterns

5. Use relevant patterns & practices solution assets

Page 12: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

5 Key Focus Areas of the Guide1. Canonical Application Frame

2. Application Types

3. Architecture Frame

4. Quality Attributes

5. Technologies and capabilities

Page 13: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

1. Canonical Frame

Page 15: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Arch StylesSets of principles that shape the application

Architectural EvolutionMonolithic -> Client-Server -> 3-Tier -> N-Tier ->

Components -> Services

Page 16: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

2. Application Types (Archetypes)Not Exhaustive, Illustrative

Page 17: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Web Application

Page 18: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Rich Internet Application (RIA)

Page 19: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Service

Page 20: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Application type Benefits Considerations

Mobile Applications Support for handheld devices

Input and navigation limitations

Availability and ease of use for out Limited screen display area

Support for offline and occasionally

Rich client applications Ability to leverage client resources

Deployment complexity; however, a range of installation options such as ClickOnce, Windows Installer and XCOPY are available

Better responsiveness, rich UI functionality, and improved user experience

Challenging to version over time

Highly dynamic and responsive interaction Platform-specific

Support for offline and occasionally connected applications

Rich Internet applications (RIA)

The same rich user interface capability as rich clients

Larger application footprint on the client machine compared to a Web application

Support for rich media and graphic display

Restrictions on leveraging client resources compared to a rich client application

Simple deployment and the distribution capabilities (reach) of Web clients

Requirement for deployment of the .NET or Microsoft Silverlight™ run time on the client

Simple upgrade and version updatingCross-platform and cross-browser support

Service applicationsLoosely coupled interactions between client and server

No UI support

Ability to be consumed by different and unrelated applications

Dependent on network connectivity

Support for interoperability

Web applicationsBroad reach, and a standards-based UI across multiple platforms

Dependent on continual network connectivity

Ease of deployment and change management

Difficulty in providing a rich user interface

Application Type Considerations

Page 21: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

3. Architecture Frame

Page 22: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Web Application

Page 23: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Design ConsiderationsPartition your application logicallyUse abstraction to implement loose coupling between layersUnderstand how components will communicate with each otherReduce round tripsConsider using cachingConsider using logging and instrumentationAvoid blocking during long-running tasks boundariesConsider authenticating users across trust boundariesDo not pass sensitive data in plain text across the networkDesign your Web application to run using a least-privileged account

Page 24: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Web Application FrameCategory Key issuesAuthentication Lack of authentication across trust boundaries

Storing passwords in a database as plain textDesigning custom authentication mechanism instead of using built-in capabilities

Authorization Lack of authorization across trust boundariesIncorrect role granularityUsing impersonation and delegation when not required

Caching Caching volatile dataNot considering caching page outputCaching sensitive dataFailing to cache data in a ready-to-use format

Exception Management Revealing sensitive information to the end user

Not logging sufficient details about the exception

Using exceptions to control application flow

Logging and Instrumentation

Failing to implement adequate instrumentation in all layersFailing to log system-critical and business-critical eventsNot supporting run-time configuration of logging and instrumentation

Page 25: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Pattern MapCategory Relevant patternsCaching Cache Dependency

Page CacheException Management Exception ShieldingLogging and Instrumentation Provider

Navigation Model-View-PresenterModel-View-Controller

Page Layout (UI) Template ViewComposite ViewTransform ViewTwo-Step View

Request Processing Intercepting Filter

Page Controller

Front Controller

Passive View

Supervising Controller

Service Interface Layer Façade

Service Interface

Page 26: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

4. Quality Attributes

Page 27: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Quality AttributesType Quality attributesSystem Qualities Supportability

TestabilityRun-time Qualities Availability

InteroperabilityManageabilityPerformanceReliabilityScalabilitySecurity

Design Qualities Conceptual IntegrityFlexibilityMaintainabilityReusability

User Qualities User Experience / Usability

Page 28: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Quality Attribute FrameQuality attribute Description

Availability

Availability defines the proportion of time that the system is functional and working. It can be measured as a percentage of the total system downtime over a predefined period. Availability will be affected by system errors, infrastructure problems, malicious attacks, and system load.

Conceptual Integrity

Conceptual integrity defines the consistency and coherence of the overall design. This includes the way that components or modules are designed, as well as factors such as coding style and variable naming.

Flexibility

Flexibility is the ability of a system to adapt to varying environments and situations, and to cope with changes in business policies and rules. A flexible system is one that is easy to reconfigure or adapt in response to different user and system requirements.

Interoperability

Interoperability is the ability of diverse components of a system or different systems to operate successfully by exchanging information, often by using services. An interoperable system makes it easier to exchange and reuse information internally as well as externally.

MaintainabilityMaintainability is the ability of a system to undergo changes to its components, services, features, and interfaces as may be required when adding or changing the functionality, fixing errors, and meeting new business requirements.

ManageabilityManageability defines how easy it is to manage the application, usually through sufficient and useful instrumentation exposed for use in monitoring systems and for debugging and performance tuning.

Performance

Performance is an indication of the responsiveness of a system to execute any action within a given time interval. It can be measured in terms of latency or throughput. Latency is the time taken to respond to any event. Throughput is the number of events that take place within a given amount of time.

ReliabilityReliability is the ability of a system to remain operational over time. Reliability is measured as the probability that a system will not fail to perform its intended functions over a specified time interval.

ReusabilityReusability defines the capability for components and subsystems to be suitable for use in other applications and in other scenarios. Reusability minimizes the duplication of components and also the implementation time.

ScalabilityScalability is the ability of a system to function well when there are changes to the load or demand. Typically, the system will be able to be extended over more powerful or more numerous servers as demand and load increase.

SecuritySecurity defines the ways that a system is protected from disclosure or loss of information, and the possibility of a successful malicious attack. A secure system aims to protect assets and prevent unauthorized modification of information.

SupportabilitySupportability defines how easy it is for operators, developers, and users to understand and use the application, and how easy it is to resolve errors when the system fails to work correctly.

Testability

Testability is a measure of how easy it is to create test criteria for the system and its components, and to execute these tests in order to determine if the criteria are met. Good testability makes it more likely that faults in a system can be isolated in a timely and effective manner.

UsabilityUsability defines how well the application meets the requirements of the user and consumer by being intuitive, easy to localize and globalize, and able to provide good access for disabled users and a good overall user experience.

Page 29: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

5.Technologies and Capabilities

Page 30: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Rich Client ApplicationsTechnology Benefits Considerations

Windows FormsHas a familiar programming model.

Does not support 3-D graphics, streaming media, flowable text, and other advanced UI features in WPF such as UI styling and templates.

Has Visual Studio Designer support. Must be installed on the client.

Offers good performance on a wide range of client hardware.

Windows Forms with WPF User Controls

Allows you to add rich UI to existing Windows Forms applications.

Depending on the complexity of your UI, it may require higher-powered graphics hardware.

Provides a transition strategy to full WPF applications.

You cannot overlay Windows Forms and WPF controls, reducing visual design flexibility.

WPF application

Provides rich UI and visualization including 2-D and 3-D graphics, display resolution independence, vector graphics, flowable text, and animation.

Depending on the complexity of your UI, it may require higher-powered graphics hardware.

Supports variable-bandwidth streaming media (Adaptive Media Streaming).

Your team may be less familiar with Expression Blend compared to Visual Studio.

XAML makes it easier to define the UI, data-binding, and events.

WPF ships with fewer built-in controls than Windows Forms.

Supports separate developer/graphic designer integration.

WPF with Windows Forms Controls

Allows you to supplement WPF with controls that are not provided by WFP; for example, WPF does not provide a grid control.

Requires a WindowsFormsHost.

It may be difficult to get focus and input to transition across boundaries.You cannot overlap WPF and Windows Forms controls.WPF and Windows Forms controls use different rendering techniques, which can cause inconsistencies in how they look on different platforms.

XAML Browser Application (XBAP) using WPF

Allows you to deploy a WPF application to the Web.

Only works on Vista or on a client with .NET Framework 3.5 and the XBAP browser plug-in installed.

Provides all the rich visualization and UI benefits of WPF.

Only works in Internet Explorer and Mozilla Firefox browsers.

Is easier to deploy and update than a WPF or Windows Forms application.

Page 31: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

5 Key Features of the Guide1. Canonical Application Frame

2. Application Types

3. Architecture Frame

4. Quality Attributes

5. Technologies and capabilities

Page 32: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots

Page 33: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Filter Failure

“What we're dealing with now is not the problem of information overload, because we're always dealing (and always have been dealing) with

information overload...thinking about information overload isn't accurately

describing the problem; thinking about filter failure is.”

Clay Shirky, New York University New-media Professor, Writer, and Consultant

Page 34: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Architecture Hot Spots Are the FiltersLenses

FocusSignificance

If you don’t know what you’re looking for …

… you’re not going to see it

Page 35: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots for Architecture

Page 36: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots for Web Applications

Page 37: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots for Security

If you know what you’re looking for, you can find it

Page 38: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots for Performance

If you know what you’re looking for, you can find it

Page 39: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

http://apparchguide.codeplex.com/walkthrough/demo

Page 40: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Using the Application Architecture Guide in the Real World

Page 41: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

ApproachStep 1. Identify Objectives. Step 2. Key Scenarios.

Architecturally Significant Use Cases

Step 3. Application Overview.Application TypeDeploymentArchitecture StylesTechnologies

Step 4. Key Hot Spots. Architecturally Significant Use CasesQuality AttributesArch Frame

Step 5. Candidate Solutions.Baseline / Candidate ArchitecturesArchitectural Spikes

Page 42: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 1.Identify Objectives

Page 43: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 1. Identify Objectives

Scope and TimeWhat’s the scopeHow much time

Purpose and Priorities Building prototypes Identifying key technical risks Testing potential paths Sharing models and understanding

Page 44: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 2. Key Scenarios

Page 45: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 2. Key Scenarios

Architecturally significant use cases.Intersection of quality attributes with functionality (e.g. authentication)Intersection of cross-cutting concerns (e.g. security impact on performance)

User stories, business stories, AND system stories

Page 46: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 3. Application Overview

Page 47: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 3. Application Overview

Key PartsApplication TypeDeploymentArchitecture StylesTechnologies

Be Able to Whiteboard It

Page 48: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Choosing Application TypesApplication Type

Benefits Considerations

Mobile Can support handheld devices Availability and ease of use for out-of-office users Can support offline and occasionally-connected applications

Input and navigation limitations Limited screen display area

Rich Client Applications

Can leverage client resources Provide better responsiveness, rich UI functionality, and improved user experience Highly dynamic and responsive interaction Can support offline and occasionally-connected applications

Deployment complexity. Can be challenging to version over timePlatform-specific

Rich Internet Applications (RIA)

Provide the same rich user interface capability as Rich Clients Provide support for rich media and graphic display Simple deployment and the distribution capabilities (reach) of Web clients

Larger application footprint on the client machine compared to a Web application Restrictions on leveraging client resources compared to a Rich Client application Requires the deployment of the .NET or Silverlight runtime on the client

Services Application

Provide loosely coupled interactions between client and server Can be consumed by different and unrelated applications Supports interoperability

No UI support Client is dependent on network connectivity

Web Application

Broad reach, and a standards-based UI across multiple platforms Ease of deployment and change management

Application is dependent on network connectivity Providing a rich user interface is difficult

Page 49: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Deployment PatternsNon-distributed

Distributed

Web/App Farms

Work back from the end in mind!

Page 50: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Architectural StylesSets of principles that shape the application.

Applications are a Mash Up of Arch Styles ... Not Mutually Exclusive

Page 51: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Technologies

In a mature market, expect lots of options and specialization

When You Choose Candidate App Types, You Slice/Dice Your Options Down

Page 52: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Rich Client

Page 53: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Web Applications

Page 54: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 4. Key Hot Spots

Page 55: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 4. Key Hot Spots

Architecture Hot SpotsQuality Hot Spots

If you don’t know what you’re looking for … … you’re not going to see it

Hot spots are the filters.

Page 56: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots for Architecture

Page 57: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots for Security

If you know what you’re looking for, you can find it.

Page 58: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Hot Spots for Performance

If you know what you’re looking for, you can find it.

Page 59: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 5. Candidate Solutions

Page 60: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Step 5. Candidate Solutions

OutcomesBaseline / Candidate ArchitecturesArchitectural Spikes

IterativeIncremental

Page 61: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

ApproachStep 1. Identify Objectives. Step 2. Key Scenarios.

Architecturally Significant Use Cases

Step 3. Application Overview.Application TypeDeploymentArchitecture StylesTechnologies

Step 4. Key Hot Spots. Architecturally Significant Use CasesQuality AttributesArch Frame

Step 5. Candidate Solutions.Baseline / Candidate ArchitecturesArchitectural Spikes

Page 62: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

Recap

A Lap around the Application Architecture Guide v2

Architecture Hot Spots

Using the Application Architecture Guide in the Real World

Discussion

Walk-through/demo

http://apparchguide.codeplex.com/

Page 63: Http://msdn.com/practices. john devadoss product unit manager, patterns & practices johnd@microsoft.com DPR 301

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.