Title: Smart Client Program
1Smart Client Program
- Composite UI Application Block
Eugenio Pace eugeniop_at_microsoft.com Product
Manager - patterns practices June 2005
2Agenda
- Customer scenarios and requirements
- What is CAB?
- Architecture
- Timeline
- Call to action
3Smart Client ProgramCustomer demand
- Thompson Financial Data Portal
- Dell Call Center
- Commonwealth Bank of Australia Teller
Application - MSFT Call Centre Framework scenarios
- Many othersall trying to build the same thing
4Thomson FinancialsProject Background
- Provide integrated Data/Analysis Services To
Financial Services Community - Thomson ONE Analytics
- Integrated Research and Analysis
- Monitoring and Analysis Tools
- Access to Research Data
- Dual Channel Delivery
- Smart Client Advanced, Premier Users
- Integration Of Client-Side Data Sources
- Web Ad Hoc, Casual Users
5ThomsonONEGoals
- Common Architecture for Next-Gen Apps
- Streamline Development Process
- Customizable Extensible
- User Composed Solutions
- Solution Composed of Pluggable Service Agents
- User Defined Views
- Portfolio Research Data
- Smart Client Platform Services
- Deployment, User Interface, etc.
6ThomsonONE - Analytics
7Dell Call CentreProject Background
- 8,000 Telephone Sales Agents
- Internal and remote call centers
- Integrated View Of The Customer
- 40 Disparate Applications
- Sales, CRM, Tech Support Tools
- Releases of new front-ends took a lot of time
- Web based solution 500K lines of javascript
8DellGoals
- Maximize Agent Productivity
- Rich, Responsive and Flexible
- Simpler Development Model
- Hosted Applications Independently Developed,
Tested, Deployed - Solution Profile Specific Combination Of Hosted
Applications - User Role Flexibility
- Common Architecture for Next-Gen Apps
- Smart Client Platform Services
9Integrated Dell Desktop
10Composite UI Application BlockBuilding
Enterprise Smart Clients
- Value for architecture teams Quality
Consistency - Value for developer teams Productivity and
faster ramp-up - Business goals increased end-user productivity
and agility of business tasks
11Abstract
Code-based
Architecture Scenarios
Smart Client Baseline Architectures
- Smart Client encompasses a family of architecture
scenarios. Customers have prioritized LOB Front
End and Mobile scenarios
- Many application styles for LOB front end
Outlook hosted is just one - Baseline architecture composition of patterns
blocks
LOB Front End
Mobile
Specialized Devices
Smart Client Scenario Family
Outlook-Hosted LOB Front End
Composite LOB Front End
Tool Extensions
- Making an app self-updatable
- Adding offline to service agents
- Creating MVC skeletons
- Configuring Offline Caches
- Smart Client Blocks
- Updater AB (ev)
- Offline AB
- Composite AB
- Service Agents
- Elixir (OHAB)
Smart Client Patterns
- Collaboration with Siemens
- Distributed authoring under Creative Commons
license - Using patternshare.org (pattern-focused Wiki)
Smart Client Block Library
- Built on Enterprise Library foundation (logging,
caching, etc)
12Asset LineageHow did we get here?
UIP1 PAG
UIP2 PAG
CAB PAG
CCF Field
This is not an emergent pattern!
Other field frameworks
CAB DPE
Dell DPE Customer
David Hill
Thomson DPE Customer
PAG Asset
Field FX / Prototype
David Hill, Brenton Webster et al.
Customer Solution
13Composite UI Design
Shell
- Customers build Modules
- Modules Contain
- SmartParts Widgets
- Support Services
- Module Configuration
- Whatever else the app needs
- Modules typically will contain
- Business Logic
- Infrastructure component
- 3rd party vendors
- Community
- Partners
14CAB Shell
UI Elements
Shell
Context State
SmartParts
Workflow Process management
15Composite UI Design
Shell
Services
- CAB Layering
- Shell
- Visual Styles
- Hosting Model
- CAB Core
- Implementation of UI-less host
- Contract of Shells
- Contract of Modules
- Services
- Support Services
- Crosscutting stuff
- Declarative
User Interface Elements
Security
Management
Communications State Mgmt
SmartPart Managers
SmartPart X
SmartPart Y
CAB
Host
Service X
Module Mgmt
Event Broker
Service Y (e.g. UIP)
Global Context
OtherContext1
16Simple Shell CAB Together
Shell
Main Form
User Interface Elements
SmartPart Managers Base Classes
Shell Devs
Hosted Control
StatusStrip UI Element
Layout
MenuStrip UI Element
MDI
ToolStrip UI Element
CAB
Host
Services
Infrastructure Devs
ModuleCatalog
EventBroker
ModuleLoader
UI Process?
Configuration
Authorization?
Global Context
Context Foo
Shared State
Shared State
Context Foo
Biz Logic Devs
SmartPart 1
SmartPart X
SmartPart Y
Controller 1
Controller X
Controller Y
17Event Broker
- Challenge
- Notifications events one-way are necessary in
UI design - publishers subscribers dont know about each
other - You may have sources without handlers and vice
versa - Solution
- Event Broker
- Events identified by an Event Topic
- event//MyApp/Updates/UpdateAvailable
- N publishers and M subscribers
- Supporting strong-typed EventArgs between
publishers and subscribers - Two scopes global and WorkItem-wide events
18Event Broker Design Overview
Subscribers
Background Worker
Publishers
Event Topic
Publication
BackgroundSubscription
event//UpdatesAvailable
Method
Event
Publication
Subscription
1
Event Catalog Service
EventPublication(event//UpdatesAvailable) eve
nt EventHandlerltSomeArggt UpdatesAvailable if
(UpdatesAvailable ! null)
UpdatesAvailable(this, new SomeArg(3) )
EventSubscription(event//UpdatesAvailable) Pu
blic void NewUpdates(object sender, SomeArg
numUpdates) MessageBox.Show(numUpdates.ToStr
ing(), updates available)
19Features of the Event Broker
- Strong Typing
- EventHandlerltTgt lets you pass your own eventArgs
type (e.g. MyType EventArgs) - EventSubscription(event//foo,EventScope.Globa
l)public void DoSomething(object source, MyType
stuff) - Subscribe to receive on different Threads
- Using the Background worker
- EventSubscription(event//foo/bar/baz,EventSco
pe.Global ,isBackgroundtrue) - Event Scoping
- Global Events and WorkItem-Wide Events
- EventSubscription(event//foo/bar/baz,EventSco
pe.Global)EventSubscription(event//foo/bar/ba
z,EventScope.WorkIteml) - Works on components, normal classes and static
types - Components and objects get inspected when added
to a Context or Host - Static types need to be manually registered
- Can publish, subscribe to, and fire events
programmatically as well as declaratively
20Event Broker Background Subscriptions
- Subscribers can declare the intent to run the
subscription in a background worker - No change to publisher or subscriber code!
- If the publisher or some other class wants
fine-grained control of the background workers,
it can - EventTopic eventTopic EventCatalogServiceevent
//myEvent - Examples of control functions
- eventTopic.RunningBackgroundWorkers.Count
- eventTopic.RunningBackgroundWorkers2
- eventTopic.RunningBackgroundWorkerssubscriberInst
ance.Cancel - eventTopic.RunningBackgroundWorkers.Cancel()
21State Persistence
- Example Scenarios
- Suspend-And-Continue
- Delegate work items
- Checkpoint and rollback work item state
- Problem
- Work Items have shared state elements that may
need to be saved - Solution
- Provide a simple mechanism to store load
WorkItem state - Essentially apply memento to the WorkItem (which
is an application controller) to allow having a
separate State object instead of just member
variables and providing a service which acts as a
repository for this State object
22State Persistence
- State persistence managed via a service
- Provided Implementations
- SQL
- Isolated File
- File
- Optional DPAPI Encryption
- Invoking persistence
- Programmatically
- Q Should we add the Save Load method to the
WorkItem class? - Coming Soon
- At persist points in UIP schema (onEnter,
onExit states transitions) - When WorkItems get suspended
public interface IStatePersistenceService
void Save(State state) State Load(Guid id)
void Remove(Guid id)
//your WorkItem ServiceDependency Public
IStatePersistenceService persistence public
void SomeMethod() persistence.Save(this.Stat
e)
23Acquiring Services
- Services are singleton components that provide
access to infrastructure - Think EventBroker, Authorization, Logging,
- Any module may include services
- Services can be obtained programmatically or via
an IoC declaration from any component - Override - Contexts can have services as well
when a component asks for it it precedes the host
service - Services can use other services. Services can
declare CompositeUIEvents - Only basic bootstrap services are included in the
CAB main assembly Catalog, Loader, Registry, and
EventBroker
CAB
Host
Services
ModuleCatalog
EventBroker
ModuleLoader
UI Process?
Configuration
Logging
Global Context
Context Foo
Shared State
Shared State
Context Foo
SmartPart 1
SmartPart X
Logging
Controller 1
Controller X
24UI Elements
- UI Element Controls are portions of UI that
modules have to Share - Toolbars, menu bars, status bars, notification
areas - UI Elements are the things these controls know
how to handle - Toolbar Items, menu items, Status Panel, Balloon,
Action Panes - Shell developers
- 1) decide what UIElements their shell will
provide - Write implementations of IUserInterfaceElementCont
rol - Write implementations of IUserInterfaceElement
- Module Developers
- 1) Decide what UI element instances they need (
Add new customer menu) - 2) Build Metadata and/or code to add those
UIElements - May include hints for relative layout, but in
the end the shell control implementations decides
where things get shown - 3) Write code to respond to events from, or
display text in, those UI Elements (or whatever
the UI Element does) - This means a Module Developer will reference a
specific shell, 99 of the time! - To mitigate this, CAB will provide two basic
UIElement interfaces all shells should implement - One for Action Commands Which a shell may
display as menus, command bars, taskbars, etc
25Demo
26CAB is not
- A product
- It is an Application Block from Microsoft
patterns practices that helps you implement
common patterns in development - A library of UI controls useful for Smart Client
- It is a set of components to help you structure
what lies beneath the UI and the display - A metadata language to define UIs
- The interaction between code components could be
specified declaratively but you will not find
schemas to define forms, fields, etc. - For that look to XAML Avalon all that
- We do intend to help component design that
migrates easily to those architectures as they
become available
27Schedule
MAR APR MAY JUN JUL
AUG
Internal
VS
Dev Start
M0
FeatureFreeze
.NET Beta 2
Tech Preview on Beta 2
RTM on .NET 2.0
Content Complete
Community
Expert Advisor Conference Calls
Code Drop
Code Drop
Code Drop
28Call to action!
- Join the CAB community
- http//workspaces.gotdotnet.com/cab
- Download the Code Drop
- Tell us what you think!
- Stay tuned to the team blogs
- http//blogs.msdn.com/edjez
- http//www.peterprovost.com
- http//blogs.msdn.com/eugeniop
29Thanks!