Enterprise Smart Clients Architecture, Patterns, Design, Best Practices Keith Elder Manager, Sr. Software Engineer Quicken Loans Blog:
Take Aways Previous Session What are Smart Clients How to deploy them as easy as a web application Setting Up Visual Studio – How to get started Modules Interface Business Logic Data Access Logic Understanding the architecture of an Enterprise Smart Client and how to get started building one. Handling Business Rules Enterprise Library
Enterprise Desktop
Enterprise Smart Client Architecture
Smart Client Architecture SQL 2005 Client Web Services Cluster Benefits Provides connection pooling to database Allows for updates to business layer without affecting clients Disconnected / Connected Business Logic Documentation
Enterprise Smart Client Pattern: Visual Studio Solution Organization
Visual Studio Solution Organization Think in terms of modularity and re-use Will not apply to smaller applications Modules are collections of projects and solutions Web Service BusinessLayer DataLayer WorkFlow Proxy UI.Web UI.WinForm UI.Mobile Etc.
Visual Studio Solution Organization: Things to remember Create a “Common” library early on Common API’s -> EnterpriseDesktop.Common Typically shared among all projects (it is common right?) Base APIs to handle validation, serialization, configuration or whatever Common UI -> EnterpriseDesktop.Common.WinForm Why separate things out so much? Allows for Multiple User Interfaces to leverage the same logic. Write once. Use it everywhere. Bake Enterprise Library into your application from the start, not as an after thought. More on this later. Each SmartClient “module” will have minimally four projects: Web service – provides the means to retrieve, and validate information for your module Business Layer – Contains your business rules and business entities Data Layer – Facilitates storing and retrieving of data (could be datasets, custom objects, or an ORM) UI (winform) – User controls which make up your user interface
Web Service BusinessLayer DataLayer Smart Client Mobile 5 App Web Site Internal Web App Smart Client Module WorkFlow
Folder Structure For Application ModuleModule Project FilesProject Files
Enterprise Desktop
Enterprise Smart Client: Best Practices
Handling Business Rules With Smart Clients Put your business rules in the web service Business rules change constantly, do you want to redeploy your entire app for a few lines of code change? Answer: No. Just redeploy your web service. No one will ever know! Leverage Biztalk rules engines or WorkFlow rules engine Great idea but I can only pass back and forth XML, so how do I do it? Answer. List brokenRules Note: EntLib 3.0 has a Validation Block
Business Rules
Enterprise Smart Client: Patterns and Software Factories
Patterns and Practice Is Your Friend Enterprise Library Logging Block Log exceptions Route SQL Exceptions to pagers Log who is doing what Log to flat files, xml or database Data Access Block Abstract data access, less code than ADO.Net Caching Block Database File system Isolated file storage Security Block Manage permissions for your application (who can do what) Console Winform Application to configure or re-configure your application on the fly WSE 3.0 – Web Services Enhanced (pre WCF)
Quick Look at Enterprise Library
Enterprise Smart Client: Deployment Tips
Enterprise Deployment Tips Things you need to deploy Smart Client Web Service for each module Tip: Create master solutions for each web service deployment Reminder: Don’t forget to add Enterprise Library to your services Documentation Asp.net web site Purchase software certificate from Versign Sign ClickOnce manifests with certificate Have your windows engineers deploy this certficate as a trusted certficate to the desktops. Build an MSI installer which contains a URL desktop shortcut. Deploy this to the enterprise based which user’s need the application. Provides an easy on ramp to kick off the application and get it installed. Can be placed in desktop image by IS
Anything Else I Should Look At? Web Service Performance Tip: Gzip and ExcludeSchema Smart Client Software Factory Web Service Software Factory Mobile Software Factory Keep eyes on Patterns and Practice Team
Resources My Blog Resources Patterns and Practices Smart Client Software Factory Enterprise Library Web Services Software Factory Mobile Software Factory