• 470 likes • 840 Views
Architecting an Application Using the .NET Framework Peter Ty MCSD, MCDBA, MCP+SB, MCSE Developer Evangelist Microsoft Hong Kong Ltd. peterty@microsoft.com. Agenda. .NET Framework Overview Architecting .NET Applications Visual Studio.NET Implementing Design Goals XML Web Services.
E N D
Architecting an Application Using the .NET Framework Peter TyMCSD, MCDBA, MCP+SB, MCSE Developer EvangelistMicrosoft Hong Kong Ltd.peterty@microsoft.com
Agenda • .NET Framework Overview • Architecting .NET Applications • Visual Studio.NET • Implementing Design Goals • XML Web Services
.NET Framework OverviewWhat is the .NET Framework • New Runtime Environment – Common Language Runtime • Language Interoperability • Common Classes for all Languages • Common Types for all Languages • Runtime Controls Compilation to Machine Code • Assemblies • Application Domains
VB C++ C# JScript … Visual Studio.NET Common Language Specification ASP.NET: Web Services and Web Forms WindowsForms ADO.NET: Data and XML Common Language Runtime Operating System .NET Framework OverviewWhat is the .NET Framework
.NET Framework Overview.NET Framework Different Languages VB C# Compile Same IL MSIL MSIL
.NET Framework Overview.NET Framework VB MSIL Deploy Execute Machine Code MSIL JIT Compile
.NET Framework OverviewCommon Language Runtime • Data Access • File IO • Data Types • Collections • Directory Services • Graphics and Images • Messaging • Network • Cryptography • Threading • XML
.NET Framework OverviewCommon Type System • Int32 = Int32 = Int32 = Int32 • String • DateTime • TimeSpan • Boolean • Byte • Char • Decimal • Double • Guid
.NET Framework OverviewBenefits • Productivity • Unification • Fully Object Oriented • Cleaner design and implementation • Easier reuse • Deployment • OS independence • Platform independence • Performance
Agenda • .NET Framework Overview • Architecting .NET Applications • Visual Studio.NET • Implementing Design Goals • XML Web Services
Architecting .NET ApplicationsDesign Goals • Availability • Uptime at performance and reliability goals • Maintainability • Ease of modifications, enhancements, and defect correction. • Manageability • Monitoring and detection of problems. Ability to correct problems before other goals are affected • Performance • Transactions per second • Requests per second • Time to first/last character
Architecting .NET ApplicationsDesign Goals • Reliability • Error handling and recovery • Scalability • Handle more load without re-architecting • Scale up – Increasing the performance of existing servers with memory or processors • Scale out – Add additional servers
Architecting .NET ApplicationsDesign Goals • Security • Data Theft • Tampering • Denial of Service (DoS) • Spoofing or Impersonation
Architecting .NET ApplicationsDesign Goals for Duwamish • Availability • 100% uptime while meeting the performance and reliability goals • Maintainability • Code should map naturally to design documentation • Code must be segmented so that it can be maintained by different groups • Manageability • Application configuration can be changed while the system is live • Application will store errors in the event log • Application can trace to a text file or event log
Architecting .NET ApplicationsDesign Goals for Duwamish • Performance • Must meet or exceed performance test results of Duwamish 4.0
Architecting .NET ApplicationsDesign Goals for Duwamish • Reliability • Trap and recover when possible • Provide a custom error page • Scalability • Must scale up and out. • Security • Require authentication to prevent URL spoofing
Architecting .NET ApplicationsFunctional Requirements • Testable • Avoid Implementation Details • Good • Administrator must be able to create, read, update, and delete (CRUD) customer accounts. • Administrator must be able to configure the max outstanding balance for a customer • Administrator must be able to change the name of a customer • Bad • Site must be easy to use • Site must be written in VB.NET
Architecting .NET ApplicationsFunctional Requirements for Duwamish • An Internet customer will be able to browse the Duwamish Books product catalog by category. • An Internet customer will be able to search for specific books in the following ways: • Search for books by Title • Search for books by Author • Search for books by ISBN • Search for books by Subject • Search for books by Natural Language Search • An Internet customer will be able to select one or more books and place them in a shopping cart for purchase. • …
Architecting .NET ApplicationsUse Cases • Express the Requirements, as Activities, from the Perspective of the User
Architecting .NET ApplicationsUse Cases • Actors • Roles within the application • Administrator • Customer • Order Entry Clerk • Human Resources • A given “real person” could be in more than one role • Use Cases • Things that actors can do • Purchase Product • Change Salary • Update Items in Stock
Architecting .NET ApplicationsActivity Diagrams • Use Cases Say What the User Can Do • Activity Diagrams Show How the User Does it
.NET Framework ArchitectureLogical Architecture • Requirements are Decomposed Into Large Objects • Responsibilities are Determined for Those Objects
Agenda • .NET Framework Overview • Architecting .NET Applications • Visual Studio.NET • Implementing Design Goals • XML Web Services
Visual Studio.NETIntegration • Integrates All Development Languages • VB • C++ • C# • JScript
Visual Studio.NETIntegration • Integrates All Project Types • Windows Application • Class Library • Windows Control Library • Web Application • Web Service • Web Control Library • Console Application • Windows Service
Visual Studio.NETSolutions • Multi-Project Solutions • Multi-Language Solutions • Project Dependencies • Build Configurations
Visual Studio.NETServer Explorer • Event Logs • Loaded Modules • Message Queues • Performance Counters • Processes • Services • Databases • Web Services
Visual Studio.NETFeatures • Windows Installer Deployment • Robust Debugging • Macros
Agenda • .NET Framework Overview • Architecting .NET Applications • Visual Studio.NET • Implementing Design Goals • XML Web Services
Implementing Design GoalsImplementing Design Goals • Availability Goal • 100% Uptime • Implementation Choices • Web Farm • ASP.NET Availability Enhancements • Session State Stored Externally in Session Server • Automatic Problem Detection and Web Server Restart Without Interruption of Service • Replace DLLs Used By Site, Without Interruption of Service
Implementing Design GoalsImplementing Design Goals • Maintainability Design Goal • Code should map naturally to design documentation • Code must be segmented so that it can be maintained by different groups. • Implementation Choices • Use Cases implemented directly in Business Façade component • Code segmented into 6 Visual Studio projects that can be modified together, or independently
Implementing Design GoalsImplementing Design Goals • Manageability Design Goals • Change site configuration without a restart • Trace and log to the event log, or a file • Implementation Choices • Store configuration info in Web.config • Trace and log to the event log using the CLR EventLog class • Trace to a text file using the CLR FileInfo and StreamWriter classes • ASP.NET provides performance counters for each web application • Requests and response statistics • Cache statistics • Error statistics • Transaction statistics
Implementing Design GoalsImplementing Design Goals • Performance Design Goal • Match or exceed performance of Duwamish 4.0 • Implementation Choices • ASP.NET compiles pages into executables • Utilize ASP.NET page output caching • Full Web Farm support through external session state, and stateless classes
Implementing Design GoalsImplementing Design Goals • Reliability Design Goal • Handle errors gracefully • Never display a raw error message to the user • Implementation Choice • Exception based error handling • ASP.NET custom error page support
Implementing Design GoalsImplementing Design Goals • Scalability Design Goal • Must scale up and out • Implementation Choices • Scale up through ASP.NET Web Garden support • Scale out through external session state. • Access components locally or through .NET remoting.
Implementing Design GoalsImplementing Design Goals • Security Design Goal • Require authentication to prevent URL spoofing • Implementation Choices • Utilize ASP.NET built-in form authentication
Agenda • .NET Framework Overview • Architecting .NET Applications • Visual Studio.NET • Implementing Design Goals • XML Web Services
XML Web ServicesThe Internet Today • Designed for Human Beings • Browser Based • Most Data is Aesthetic
XML Web ServicesBusiness Needs Today • Electronic Application Integration • Business to Business Communication • Business to Business Commerce • Platform Independent • Language Independent • Standards Based • Inexpensive
XML Web ServicesExisting Infrastructure • The Physical Internet (ISPs, Routers, Highspeed Connectivity) • HTTP/HTTPS • XML
XML Web ServicesImplementation Business Rules Web Browser HTML Data Access Database
XML Web ServicesImplementation Business Rules Web Browser Data Access XML Application Database
Session Summary • .NET Makes It Easier to Design a Good Solution • Object Oriented • Native Support for Many Design Goals • Native Support for Web Services • Visual Studio Makes it Easier to Implement a Good Solution • Multi-Project Solutions • Multi-Language Solutions • Excellent Debugging • Productivity Enhancements
For More Information… • MSDN Web Site at • msdn.microsoft.com • Duwamish Online Site at • www.duwamishonline.com
Become A Microsoft Certified Solution Developer • What Is MCSD? • Premium certification for professionals who design and develop custom business solutions • How Do I Get MCSD Status? • It requires passing four exams to prove competency with Microsoft solution architecture, desktop applications, distributed application development, and development tools • Where Do I Get More Information? • For more information about certification requirements, exams, and training options, visit www.microsoft.com/mcp