210 likes | 473 Views
Enterprise Smart Clients Architecture, Patterns, Design, Best Practices. Keith Elder Manager, Sr. Software Engineer Quicken Loans Blog: http://keithelder.net/blog/ Email: keith@keithelder.net. Take Aways. Previous Session What are Smart Clients
E N D
Enterprise Smart ClientsArchitecture, Patterns, Design, Best Practices Keith Elder Manager, Sr. Software Engineer Quicken Loans Blog: http://keithelder.net/blog/ Email: keith@keithelder.net
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
Benefits Provides connection pooling to database Allows for updates to business layer without affecting clients Disconnected / Connected Smart Client Architecture SQL 2005 Business Logic Documentation Web Services Cluster Client
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
Smart Client Module Mobile 5 App Web Service Smart Client DataLayer Internal Web App BusinessLayer Web Site WorkFlow
EnterpriseDesktop Folder Structure For Application Source Module HelpDesk WebService BusinessLayer Project Fi les EnterpriseDesktop.HelpDesk.BusinessLayer DataLayer WorkFlow EnterpriseDesktop.HelpDesk.DataLayer UI WinForm EnterpriseDesktop.HelpDesk.UI.WinForm Web Mobile EnterpriseDesktop.HelpDesk.UI.Mobile Common WinForm
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<Rule> brokenRules • Note: EntLib 3.0 has a Validation Block
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)
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 • http://keithelder.net • Email • keith@keithelder.net • Resources • http://msdn.microsoft.com/smartclient/ • http://practices.gotdotnet.com/projects/scbat • Patterns and Practices • http://msdn.microsoft.com/practices/ • Smart Client Software Factory • Enterprise Library • Web Services Software Factory • Mobile Software Factory