Post on 19-Dec-2015
ARC312ARC312Smart Client ArchitectureSmart Client Architecture
Chris J.T. AuldChris J.T. AuldManaging Director- Kognition Managing Director- Kognition Microsoft Regional Director & MVPMicrosoft Regional Director & MVPchris@kognition.co.nzchris@kognition.co.nz
AgendaAgenda
Why smart clients?Why smart clients?
What is a smart client?What is a smart client?
How do you decide between How do you decide between browser-based and smart client UI?browser-based and smart client UI?
Changes in Changes in nn-tier architecture for smart -tier architecture for smart clientsclients
Drill down on client tier architectureDrill down on client tier architecture
Data transportData transport
Data containers Data containers (datasets vs. business objects)(datasets vs. business objects)
A Spiraling Evolution A Spiraling Evolution of Architecturesof Architectures
CentralizedMainframe
DecentralizedClient-Server
CentralizedWeb Server
DistributedSmart Client
Advent of networked PC – Intelligent interfaces improve
productivity
“Dumb” terminals allow minimal
support for user activities
Intelligent interfaces have no cost-effective Internet reach.
“Dumb” browsers have cheap deployment but limited
support for user activities.
Intelligent interfaces develop cost effective deployment and data
transport.
Browsers LimitationsBrowsers Limitations
HTML not designed as application HTML not designed as application interface technologyinterface technology
Minimal GUI elementsMinimal GUI elements
Limited control over user interaction Limited control over user interaction (keystrokes, drag and drop)(keystrokes, drag and drop)
Limited client-side data validationLimited client-side data validation
Costly to produce effective UICostly to produce effective UI
Immature security model (“Would you Immature security model (“Would you like to install this component from like to install this component from Gator Corp?”)Gator Corp?”)
What Is a Smart Client?What Is a Smart Client?
No agreement on general definitionNo agreement on general definition
Emphasizes intelligence in the UIEmphasizes intelligence in the UI
Takes full advantage of the client Takes full advantage of the client machinemachine
Typically means a true Windows interfaceTypically means a true Windows interface
Client UI has some level of detachment Client UI has some level of detachment from the rest of the applicationfrom the rest of the application
This may mean flexible ways to get and This may mean flexible ways to get and store datastore data
Often means offline capabilitiesOften means offline capabilities
Key Decision PointsKey Decision Points
Do you control the user’s operating environment? Do you control the user’s operating environment?
Are offline capabilities required?Are offline capabilities required?
Will a better UI translate to productivity gains and Will a better UI translate to productivity gains and resultant savings?resultant savings?
Is it important for your application to access local Is it important for your application to access local resources on user machines?resources on user machines?
Do you need (or would you benefit from) Do you need (or would you benefit from) alternative UI – handwriting or speech recognition?alternative UI – handwriting or speech recognition?
What security capabilities do you need?What security capabilities do you need?
Lesser factorsLesser factorsDistribution of processing overheadDistribution of processing overhead
Efficient utilization of bandwidth Efficient utilization of bandwidth
Peer-to-peer capabilitiesPeer-to-peer capabilities
Bottleneck: .NET Framework RequiredBottleneck: .NET Framework Required
Limiting factor: the .NET Framework must be Limiting factor: the .NET Framework must be on all client machineson all client machines
First candidates for distributed smart clients:First candidates for distributed smart clients:Corporate applications (control over desktop)Corporate applications (control over desktop)
Commercial or extranet applications where a Commercial or extranet applications where a minimum platform can be requiredminimum platform can be required
.NET Framework becoming ubiquitous.NET Framework becoming ubiquitous# of Framework installations growing rapidly# of Framework installations growing rapidly
Future O/S versionsFuture O/S versions
Service PacksService Packs
Other .NET applicationsOther .NET applications
Where are Smart Clients Where are Smart Clients Most Important?Most Important?
Corporate apps for distributed Corporate apps for distributed operationsoperations
Healthcare, transportation, supply chainHealthcare, transportation, supply chain
Etc.Etc.
Distributed data entry systemsDistributed data entry systems
Commercial packages of all kinds, Commercial packages of all kinds, especially vertical market packagesespecially vertical market packages
Applications that require offline Applications that require offline capabilitiescapabilities
Technologies RequiredTechnologies Required
Standard HTTP connection from Standard HTTP connection from each client machine to a web servereach client machine to a web server
A forms engine and execution A forms engine and execution environment running on the client environment running on the client machinemachine
A way to easily and cheaply deploy A way to easily and cheaply deploy the application to the client machinethe application to the client machine
One or more ways to transport data One or more ways to transport data to and from a central serverto and from a central server
A security model that limits the A security model that limits the ability to do damage to the client ability to do damage to the client machinemachine
A means to secure access to the A means to secure access to the system and the datasystem and the data
Windows Forms
Broadband
Copy and Run / ClickOnce / etc.
Web Services / Remoting
Code Access Security
Authentication / Authorization
Class Three Tier Architecture for Class Three Tier Architecture for Client/Server and WebClient/Server and Web
Must be refined for distributed smart clientsMust be refined for distributed smart clientsIncreased processing power on the clientIncreased processing power on the client
Ability for client to store state informationAbility for client to store state information
Data transport options must be handled – both Data transport options must be handled – both for now and the futurefor now and the future
Presentation TierPresentation TierUser interfaceUser interface
Middle TierMiddle TierComponents, RulesComponents, Rules
Data TierData TierRelational DatabaseRelational Database
Many Many nn-Tier Principles Still Apply-Tier Principles Still Apply
Data tier is mostly unchangedData tier is mostly unchangedStored procs may need to support new paging Stored procs may need to support new paging designs, more robust batch updating, etc.designs, more robust batch updating, etc.
Middle tier still isolates all database Middle tier still isolates all database interactioninteraction
Controls connection to RDB with its own Controls connection to RDB with its own credentialscredentials
Parts exposed to web outside firewall, rest of Parts exposed to web outside firewall, rest of middle tier insidemiddle tier inside
Entry points to business tier can include Entry points to business tier can include technologies such as message queuetechnologies such as message queue
Data tier (database)Data tier (database)
Data access layerData access layer
Business rules, etc.Business rules, etc.
Channel Adapter (data façade)Channel Adapter (data façade)
Common componentsCommon componentsand controlsand controls
UI – Forms and controlsUI – Forms and controls
A Tiered Architecture for Distributed A Tiered Architecture for Distributed Smart ClientsSmart Clients
Client machine
Application server
Database server
Port 2Port 2e.g. Web Servicese.g. Web Services
Port 1Port 1e.g. Remotinge.g. Remoting
Local storageLocal storagefor cachingfor caching
Web server
Client Layer Drill-DownClient Layer Drill-Down
UI – Forms and controlsUI – Forms and controls
Channel Adapter (data facade)Channel Adapter (data facade)
CustomerCustomer OrderOrder ProductProduct VendorVendor Etc.Etc.
Standard interfaceStandard interfacefor Get / Update / etc.for Get / Update / etc.
Common components and controlsCommon components and controls
Data validationData validation SecuritySecurity Base formsBase forms Etc.Etc.
Form AForm A Form BForm B Form CForm C Form DForm D Form EForm E Etc.Etc.
Local store forLocal store forcachingcaching Data transport Data transport
channelschannels
Building the Client TierBuilding the Client Tier
Componentize as much logic as possibleComponentize as much logic as possible
Minimize repeated code patterns in routine Minimize repeated code patterns in routine forms with frameworks or toolkitsforms with frameworks or toolkits
Data validationData validation
Data managementData management
SecuritySecurity
Use high level controller as app-entry pointUse high level controller as app-entry pointIsolates security checking, menu building, etc.Isolates security checking, menu building, etc.
If possible, get data validation rules from If possible, get data validation rules from databasedatabase
Key TechnologiesKey Technologies
Extender Providers in Windows Forms Extender Providers in Windows Forms
Dynamic loading of .NET assembliesDynamic loading of .NET assembliesNeed location of assembly, and name of Need location of assembly, and name of type to get instancetype to get instance
Allows apps to have dynamic construction Allows apps to have dynamic construction and single entry pointand single entry point
An Example of Extender Providers An Example of Extender Providers for “Dirty Checking”for “Dirty Checking”
Drag and drop checking to see if data Drag and drop checking to see if data has changedhas changed
DemonstrationDemonstration
Note that this is an implementation of Note that this is an implementation of the Observer patternthe Observer pattern
Application “Portals”Application “Portals”
Complex applications need an Complex applications need an “application shell” or “portal” to “application shell” or “portal” to coordinate sub-systemscoordinate sub-systems
Flexible plug-in pieces for menuing, Flexible plug-in pieces for menuing, authorization/authenticationauthorization/authentication
Data driven list of user options, with Data driven list of user options, with screens loaded on demandscreens loaded on demand
Process uses dynamic loading of Process uses dynamic loading of assembliesassemblies
Typical Code to Load a Typical Code to Load a Dynamic FormDynamic Form
Dim sLocation As String = {set assembly location}Dim sType As String = {set class name of form}Dim formAsm As [Assembly] = _ [Assembly].LoadFrom(sLocation)Dim ClassType As Type = formAsm.GetType(sType)Dim Classobj As ObjectClassobj = Activator.CreateInstance(ClassType)
Dim FormToShow As Form = CType(Classobj, Form)FormToShow.MdiParent = MeFormToShow.Show()
A Composite A Composite Application ShellApplication Shell
Data TransportData Transport
`
XML
UIUI
Business LogicBusiness Logic
Data Storage and ManagementData Storage and Management
Data AccessData Access
PresentationPresentation
?
Transport vs. HostTransport vs. Host
TransportTransportRPC, Queues, etc.RPC, Queues, etc.
HostHostIIS, Enterprise Services, etc.IIS, Enterprise Services, etc.
Separate but dependant issues Separate but dependant issues
Competing TechnologiesCompeting Technologies
RPCRPCDCOM, RMI, Remoting, Web servicesDCOM, RMI, Remoting, Web services
Async MessagingAsync MessagingMSMQ, MQ Series, JMS, Async RPCMSMQ, MQ Series, JMS, Async RPC
Services (SO)Services (SO)Web services, Indigo, other transportsWeb services, Indigo, other transports
Today’s OptionsToday’s Options
Web SvcWeb Svc Ent SvcsEnt Svcs RemoteRemote
Data-centricData-centric
Object-orientedObject-oriented
XML/SOAPXML/SOAP
BinaryBinary
Pass thru firewallPass thru firewall
IDE supportIDE support
Code controlledCode controlled
Peer to peerPeer to peer
Events/callbacksEvents/callbacks
Stateful objectsStateful objects
nn-Tier-Tier
Application 2Application 2
UIUI
Business LogicBusiness Logic
Service Façade (Data Access)Service Façade (Data Access)
PresentationPresentation
External ServiceExternal Service
Application 1Application 1
UIUI
Business LogicBusiness Logic
Data AccessData Access
Data Storage and ManagementData Storage and Management
PresentationPresentation
DataPortalDataPortal
UIUI
Business LogicBusiness Logic
Data AccessData Access
DataPortal FaçadeDataPortal Façade
DataPortalDataPortal
Data AccessData Access
Data AccessData Access
Data AccessData Access
Data AccessData Access
DataPortalDataPortal
Client facadeClient facadeAbstracts the server/transport/hostAbstracts the server/transport/host
Acts as a channel adapterActs as a channel adapter
Server portalServer portalAbstracts server (transactions, etc.)Abstracts server (transactions, etc.)
Acts as a broker or message routerActs as a broker or message router
Channel Adapter / Ports Channel Adapter / Ports Drill DownDrill Down
Channel Adapter (data façade)Channel Adapter (data façade)
CustomerCustomer OrderOrder ProductProduct VendorVendor Etc.Etc.
On
the clien
tO
n th
e client
Data access layerData access layer
Business rules, etc.Business rules, etc.Data validation requiring connected accessData validation requiring connected access
Aggregation / disaggregation of dataAggregation / disaggregation of data
Web Services
Remoting listener In th
e mid
dle tier
In th
e mid
dle tier
MSMQ Etc.PortsPorts
ChannelsChannels
Data-Centric (Fat UI)Data-Centric (Fat UI)
UIUI
Business LogicBusiness Logic
Data AccessData Access
Logic
E.g. Traditional VB3/4/5/6 Client ServerE.g. Traditional VB3/4/5/6 Client ServerNo way to put logic in datasetNo way to put logic in datasetNeed to use a function library or;Need to use a function library or;Put logic in UIPut logic in UI
How Do We Push Data Around?How Do We Push Data Around?
ObjectsObjectsDatasets/DTOs (per Martin Fowler)Datasets/DTOs (per Martin Fowler)
Data-Centric (“thin” UI)Data-Centric (“thin” UI)
UIUI
Business LogicBusiness Logic
Data AccessData Access
Logic
Logic
Put logic on separate machine so you can’t cheat.Put logic on separate machine so you can’t cheat.
You will cheat.You will cheat.You still need to get data to the UIYou still need to get data to the UI
Distributed Data-CentricDistributed Data-Centric
UIUI
Business LogicBusiness Logic
Data AccessData Access
Logic
Same flaw as original model- just now have network Same flaw as original model- just now have network connection.connection.
Distributed ObjectsDistributed Objects
UIUI
Business LogicBusiness Logic
Data AccessData Access
Logic
Logic
Objects really just pumping data in and out at both ends.Objects really just pumping data in and out at both ends.
Client-side ObjectsClient-side Objects
UIUI
Business LogicBusiness Logic
Data AccessData Access
Logic
Not bad approach.Not bad approach.
Populate local intelligent objects on client from DTOsPopulate local intelligent objects on client from DTOs
Mobile Objects/AgentsMobile Objects/Agents
Fully mobile objects serialized and de-serialized.Fully mobile objects serialized and de-serialized.
Can be useful but has higher overhead at development timeCan be useful but has higher overhead at development time
DemonstrationDemonstration
A multi-transport DataPortalA multi-transport DataPortal
ResourcesResources
More Information:
chris@kognition.co.nz
www.syringe.net.nz
Your FeedbackYour Feedbackis Important!is Important!Please Fill Out Your EvalPlease Fill Out Your Eval
© 2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.