enterprise smart clients architecture, patterns, design, best practices keith elder manager, sr....
Post on 18-Dec-2015
216 views
TRANSCRIPT
Enterprise Smart ClientsArchitecture, Patterns, Design, Best Practices
Enterprise Smart ClientsArchitecture, Patterns, Design, Best Practices
Keith ElderKeith ElderManager, Sr. Software EngineerManager, Sr. Software EngineerQuicken LoansQuicken LoansBlog: http://keithelder.net/blog/Blog: http://keithelder.net/blog/Email: [email protected]: [email protected]
Take AwaysTake Aways Previous SessionPrevious Session
What are Smart ClientsWhat are Smart Clients How to deploy them as easy as a web How to deploy them as easy as a web
applicationapplication Setting Up Visual Studio – How to get Setting Up Visual Studio – How to get
startedstarted ModulesModules
InterfaceInterface Business LogicBusiness Logic Data Access LogicData Access Logic
Understanding the architecture of an Understanding the architecture of an Enterprise Smart Client and how to get Enterprise Smart Client and how to get started building one.started building one.
Handling Business RulesHandling Business Rules Enterprise LibraryEnterprise Library
Enterprise DesktopEnterprise Desktop
Enterprise Smart Client ArchitectureEnterprise Smart Client Architecture
Smart Client ArchitectureSmart Client Architecture
SQL 2005
Client
Web Services Cluster
BenefitsBenefits Provides connection pooling to Provides connection pooling to
databasedatabase Allows for updates to business Allows for updates to business
layer without affecting clientslayer without affecting clients Disconnected / ConnectedDisconnected / Connected
Business LogicDocumentation
Enterprise Smart Client Pattern: Visual Studio Solution Organization
Enterprise Smart Client Pattern: Visual Studio Solution Organization
Visual Studio Solution OrganizationVisual Studio Solution Organization
Think in terms of modularity and re-useThink in terms of modularity and re-use Will not apply to smaller applicationsWill not apply to smaller applications
Modules are collections of projects and Modules are collections of projects and solutionssolutions Web ServiceWeb Service BusinessLayerBusinessLayer DataLayerDataLayer WorkFlowWorkFlow ProxyProxy UI.WebUI.Web UI.WinFormUI.WinForm UI.MobileUI.Mobile Etc.Etc.
Visual Studio Solution Visual Studio Solution Organization:Organization:Things to rememberThings to remember Create a “Common” library early onCreate a “Common” library early on
Common API’s -> EnterpriseDesktop.CommonCommon API’s -> EnterpriseDesktop.Common Typically shared among all projects (it is common right?)Typically shared among all projects (it is common right?) Base APIs to handle validation, serialization, configuration or Base APIs to handle validation, serialization, configuration or
whateverwhatever Common UI -> EnterpriseDesktop.Common.WinFormCommon UI -> EnterpriseDesktop.Common.WinForm
Why separate things out so much?Why separate things out so much? Allows for Multiple User Interfaces to leverage the same logic. Allows for Multiple User Interfaces to leverage the same logic.
Write once. Use it everywhere.Write once. Use it everywhere. Bake Enterprise Library into your application from the start, Bake Enterprise Library into your application from the start,
not as an after thought. More on this later.not as an after thought. More on this later. Each SmartClient “module” will have minimally four Each SmartClient “module” will have minimally four
projects:projects: Web service – provides the means to retrieve, and validate Web service – provides the means to retrieve, and validate
information for your moduleinformation for your module Business Layer – Contains your business rules and business Business Layer – Contains your business rules and business
entitiesentities Data Layer – Facilitates storing and retrieving of data (could be Data Layer – Facilitates storing and retrieving of data (could be
datasets, custom objects, or an ORM)datasets, custom objects, or an ORM) UI (winform) – User controls which make up your user interfaceUI (winform) – User controls which make up your user interface
Web Service
BusinessLayer
DataLayer
Smart ClientMobile 5 App
Web Site
Internal Web App
Smart Client Module
WorkFlow
Folder Structure For Folder Structure For ApplicationApplication
Module
Project Files
Enterprise DesktopEnterprise Desktop
Enterprise Smart Client: Best PracticesEnterprise Smart Client: Best Practices
Handling Business Rules Handling Business Rules With Smart ClientsWith Smart Clients Put your business rules in the web servicePut your business rules in the web service
Business rules change constantly, do you want Business rules change constantly, do you want to redeploy your entire app for a few lines of to redeploy your entire app for a few lines of code change?code change? Answer: No. Just redeploy your web service. Answer: No. Just redeploy your web service.
No one will ever know! No one will ever know! Leverage Biztalk rules engines or WorkFlow Leverage Biztalk rules engines or WorkFlow
rules enginerules engine Great idea but I can only pass back and forth XML, Great idea but I can only pass back and forth XML,
so how do I do it?so how do I do it? Answer. List<Rule> brokenRulesAnswer. List<Rule> brokenRules
Note: EntLib 3.0 has a Validation BlockNote: EntLib 3.0 has a Validation Block
Business RulesBusiness Rules
Enterprise Smart Client: Patterns and Software Factories
Enterprise Smart Client: Patterns and Software Factories
Patterns and Practice Is Your Patterns and Practice Is Your FriendFriend
Enterprise LibraryEnterprise Library Logging BlockLogging Block
Log exceptionsLog exceptions Route SQL Exceptions to pagersRoute SQL Exceptions to pagers Log who is doing whatLog who is doing what Log to flat files, xml or databaseLog to flat files, xml or database
Data Access BlockData Access Block Abstract data access, less code than ADO.NetAbstract data access, less code than ADO.Net
Caching BlockCaching Block DatabaseDatabase File systemFile system Isolated file storageIsolated file storage
Security BlockSecurity Block Manage permissions for your application (who can do Manage permissions for your application (who can do
what)what) ConsoleConsole
Winform Application to configure or re-configure your Winform Application to configure or re-configure your application on the flyapplication on the fly
WSE 3.0 – Web Services Enhanced (pre WCF)WSE 3.0 – Web Services Enhanced (pre WCF)
Quick Look at Enterprise Library
Quick Look at Enterprise Library
Enterprise Smart Client: Deployment TipsEnterprise Smart Client: Deployment Tips
Enterprise Deployment Enterprise Deployment TipsTips Things you need to deployThings you need to deploy
Smart ClientSmart Client Web Service for each moduleWeb Service for each module
Tip: Create master solutions for each web service Tip: Create master solutions for each web service deploymentdeployment
Reminder: Don’t forget to add Enterprise Library to your Reminder: Don’t forget to add Enterprise Library to your servicesservices
DocumentationDocumentation Asp.net web siteAsp.net web site
Purchase software certificate from VersignPurchase software certificate from Versign Sign ClickOnce manifests with certificateSign ClickOnce manifests with certificate Have your windows engineers deploy this certficate as a Have your windows engineers deploy this certficate as a
trusted certficate to the desktops.trusted certficate to the desktops. Build an MSI installer which contains a URL Build an MSI installer which contains a URL
desktop shortcut. Deploy this to the enterprise desktop shortcut. Deploy this to the enterprise based which user’s need the application.based which user’s need the application. Provides an easy on ramp to kick off the application and Provides an easy on ramp to kick off the application and
get it installed.get it installed. Can be placed in desktop image by ISCan be placed in desktop image by IS
Anything Else I Should Anything Else I Should Look At?Look At? Web Service Performance Tip: Gzip Web Service Performance Tip: Gzip
and ExcludeSchemaand ExcludeSchema Smart Client Software FactorySmart Client Software Factory Web Service Software FactoryWeb Service Software Factory Mobile Software FactoryMobile Software Factory Keep eyes on Patterns and Practice Keep eyes on Patterns and Practice
TeamTeam
ResourcesResources My Blog My Blog
http://keithelder.nethttp://keithelder.net EmailEmail
[email protected]@keithelder.net ResourcesResources
http://msdn.microsoft.com/smartclient/http://msdn.microsoft.com/smartclient/ http://practices.gotdotnet.com/projects/scbathttp://practices.gotdotnet.com/projects/scbat
Patterns and PracticesPatterns and Practices http://msdn.microsoft.com/practices/http://msdn.microsoft.com/practices/
Smart Client Software FactorySmart Client Software Factory Enterprise LibraryEnterprise Library Web Services Software FactoryWeb Services Software Factory Mobile Software FactoryMobile Software Factory