SlideShare a Scribd company logo
Tamir Khason
                http://khason.net
                          Feb’ 09


Sponsored by:
This is not a lesson
You should attend
What is “good application”?
Architecture…
… but what
                        about me?



     This is Nick
  … and Nick has
also a lot of letters
 for this machine
Smart Client Application should be
Simple
Useful
Deployable
Maintainable
Extensible

ACCEPTABLE
What is “Smart Client”?
My presentation July 2002    My presentation Feb’ 2009

 WinForms User Interface     Client User Interface
 Deployed via central server  Zero footprint deployment
 Uses local resources        Users local resource
 Uses server based data and  Synchronizes and distributes
  processing                   data and processes
 Works better connected      Smart sensitive to local
 Works offline                environment
                              Minimum dependencies
The Process
Planning
Focus on FEATURES          Focus on SCENARIOS

 Stability                 Excitement
 Incremental               Breakthroughs
  improvement               Most probably will
 Most probably “End-        leave existing
  to-End” scenarios will     customers behind
  not work
Architectural review
    But it
 cumbersome             We need
                     componentization


 There is a ton of
  dependencies
Dependencies management
 Types in a same component can depend one on each other

 Cross-component dependencies must be controlled
    Can be depend on component in lower layer
    Must not be hard depend on component in higher layer
    Must avoid to be soft depend on component in higher layer
    Need someone else to manage dependencies on the same
     layer

 Less dependencies – better!
 Also less assemblies – better!
 … in general – less is better – simpler is better!
10 Design dogmas
Component oriented           Primitive Oriented

 Rich APIs with lots of      No external dependencies
  features – ton of           Great evolvability, often
  dependencies                 very poor usability
 Great usability, poor       Incoherent type discovery,
  evolvability                 but not required reflection
 Easy type discovery, but    Good for low level stable
  need reflection              framework
 Good for higher level
  components - not for the
  core
Extensibility Framework?
 There is no “Official” extensibility framework, so you
  can…
   Create from scratch
   Buy/use something good…
   Wait for .NET 4.0
   Use MEF - Managed Extensibility Framework + WPF today

                                 Catalog

                             Value Resolver

                          Composition container

          Part                       Part                     Part

 Export          Import     Export          Import   Export          Import
How it works?
              Who has service
                 I need?




          I have!




                    [Import]
                    public IEnumerable<IYourService>
                    YourServices { get; set; }
                    [Export(typeof(IYourService)]
                    public class SomeService : IYourService
Who is who and what can it do?
 Parts relate through contracts
 Imports are contracts parts need
 Exports are contracts parts offer
 The Container is matchmaker
   It queues catalogs
 Parts can load lazily
 Parts can have different lifetimes
 Parts are extensible and reusable
Contracts
  Preconditions, rather then endless try-catch blocks
  Postconditions, rather then endless if-else blocks
Assumption.SetPolicy(AssumptionPolicy.Break, new AssumptionHelper());
…
public NotNullSet(HashSet<T> set) Assumption.NotNull(set);
…
Assumption.IsTrue(typeof(T1) != typeof(T2), quot;The two types of values in a mapping cannot be the
same type.quot;);


  The best about this is Static Analysis!
But what’s with “Compatibility”?
 Cross-Version Compatibility
 Cross-Redistribution Compatibility
 Backward Compatibility
 Forward Compatibility
 Binary Compatibility
 Source Compatibility
 API Compatibility
Primitives and extensibility?
 APIs are published as interfaces into a
  “programmability” assembly
 Embed interfaces at compile time
 Can be deployed to any version of the managed
  application
 We can “cast” one interface into other in runtime
  – loose type coupling
 We can add some aspects and logic in compile
  time with custom compilers
 In .NET 4.0 only!
 By now – you can use PostSharp
Generic co- and contravariance
  It’s scary, but simple
  We can cast to ancestor types
private void WriteSomething(object[] something) { }
…
var something = new string[] { quot;It's somethingquot; };
WriteSomething(something);

  But it not always works
private void WriteSomething(IEnumerable<object> something) { }
…
var something = new List<string> { quot;It's somethingquot; };
WriteSomething(something); // Compiler says “NO”!


  So should we be able to pass Ixxx<TDerived> for
    Ixxx<TBase>?
Generic co- and contravariance
  If T is an output → IX<TDerived> for IX<T>
      It’s covariance
      …and can be used as IX<out T>


  If T is an input → IX<TBase> for IX<T>
      It’s contravariance
      …and can be used as IX <in T>
private void DoSomething(Func<object, IValueConverter> something) {
  this.Converter = something(this.Whatever); // Oh, NOT!!!
    }
…
var something = new Func<string, IValueConverter> { };
DoSomething(something);
AOP – WTF?
  You have INotifyPropertyChanged primitive
public class MyPrimitive : INotifyPropertyChanged {
  public event PropertyChangedEventHandler PropertyChanged;
  protected virtual void OnPropertyChanged(string name) {
    if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(name));

  For each setter of each descendant you need to call
     virtual method OnPropertyChanged
public class MyClass : MyPrimitive {
  private int _myProperty;
  public int MyProperty { get { return _myProperty; }
    set { if (_myProperty != value) { _myProperty = value;
         OnPropertyChanged(quot;MyPropertyquot;);


  Rather then use automatic setters
public int MyProperty { get; set; }
AOP – WTF?
  The best is to create your own compilation rule…
     … or even some dynamic primitives…
     … but it only possible in .NET 4.0
  Meanwhile, you can use PostSharp and
    OnMethodBoundaryAspect primitive to tell compiler
    what to do
internal class SetterWrapper : OnMethodBoundaryAspect {
public override void OnEntry(MethodExecutionEventArgs eventArgs) {
 var myPrimitive = eventArgs.Instance as MyPrimitive ;
_propertyInfo = myPrimitive.Class.GetProperty(_propertyName);
eventArgs.MethodExecutionTag = myPrimitive.OnBeforePropertyChange(_propertyInfo, newValue,
oldValue);
 eventArgs.FlowBehavior = FlowBehavior.Return;

  All the rest will be done automagically
Side by Side
 .NET 1.x and 2.x CLR - Side by Side on the same
 machine
   Good for programs
   Bad for add-ins
   Breaks on 3.x “red bits”


 .NET 4.x CLR – Side by Side in process with 2.x CLR
    Each module runs again its expected version of CLR


 Can be done today by some unmanaged injections
The Concept
Real life software       Perform
                     Specialised tasks



                       Can process
                      more than one
                     request at a time



                      Increase staff
                       during peek
                     hours or replace
                     staff on trouble
Real life software
Async Process



                  Queues




                  Storages

    Dispatcher   Processor   Worker
Need a change of thinking
 To throw out
   Local states
   Client locks, transactions and scopes
   Fault tolerance

 To bring aboard
   Asynchronous operations
   Simplicity
   Self descriptive behaviors and
   components
Local resources?
 Windows Sensor and Location platform
   Basically the better way to access well-known device types
   Build context aware applications
   Can be used today by wrapping HID_* methods


 Microsoft Sync Framework
   You can synchronize your application or device and provide
    it offline capabilities
   Build “sometimes connected” applications


 “DirectHardware” is your friend and savior
    DirectX helps you to leverage client’s hardware
    It also can varnish a bit your app
WPF – Huh?
Architecture (should)= Simplicity
Are you familiar
with WPF?
We already have a lot of stuff
 We have trees in WPF
   Logical tree – is what you put in XAML
   Visual tree – the what WPF renders for us
   Inheritance – frozen hybrid of two above

 We have Context
   All Data Context inherited via trees
   Resources inherited via Logical tree
   Routed events and commands can be used
    through Visual tree

 Data Templates = Views
2 conclude
 Think as consumer, not as developer
 DO design APIs by using it (writing code)
 Keep It Simple, Stupid!
 Set goals, gates and make an order
                       Staging        Feature
                       branch         branch
                       Staging
   Main                               Feature
                       branch
                                      branch
                       Staging
                       branch

 Avoid integrating unfinished features (yes, even if it is
  very cool feature)
2 Read
 My Blog
    http://khason.net
   Windows Client Development
    http://windowsclient.net
   Windows Presentation Foundation (Toolkit, Futures,
    Ribbon, Labs, M-V-VM)
    http://codeplex.com/wpf
   Managed Extensibility Framework (MEF)
    http://codeplex.com/mef
   PostSharp + Aspect-Oriented Programming.NET
    http://postsharp.org
   Microsoft WHDC site (Sensors)
    http://microsoft.com/whdc/sensors
   Microsoft Sync Framework
    http://msdn.microsoft.com/en-us/sync
Thank you
Questions?
… and I do not need “Potential – Passion” slide anymore…




                                                   tamir@khason.biz
                                                    http://khason.net

More Related Content

What's hot

BDD style Unit Testing
BDD style Unit TestingBDD style Unit Testing
BDD style Unit TestingWen-Tien Chang
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
Martin Gutenbrunner
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Gill Cleeren
 
Rise of the Single Page Application
Rise of the Single Page ApplicationRise of the Single Page Application
Rise of the Single Page ApplicationPiyush Katariya
 
Survive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and TricksSurvive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and Tricks
Juho Vepsäläinen
 
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
Alessandro Nadalin
 
React Native One Day
React Native One DayReact Native One Day
React Native One Day
Troy Miles
 
Javascript and Jquery Best practices
Javascript and Jquery Best practicesJavascript and Jquery Best practices
Javascript and Jquery Best practices
Sultan Khan
 
Oozie Summit 2011
Oozie Summit 2011Oozie Summit 2011
Oozie Summit 2011
mislam77
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
Mobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast diveMobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast dive
epamspb
 
Introduction to Bazaar
Introduction to BazaarIntroduction to Bazaar
Introduction to BazaarTim Penhey
 
Scaling Rails With Torquebox Presented at JUDCon:2011 Boston
Scaling Rails With Torquebox Presented at JUDCon:2011 BostonScaling Rails With Torquebox Presented at JUDCon:2011 Boston
Scaling Rails With Torquebox Presented at JUDCon:2011 Bostonbenbrowning
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
peter_marklund
 
Ruby On Rails Pitfalls
Ruby On Rails PitfallsRuby On Rails Pitfalls
Ruby On Rails Pitfalls
Robin Lu
 
When Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz NiedźwiedźWhen Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz Niedźwiedź
AEM HUB
 
Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...
Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...
Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...
Atlassian
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprisebenbrowning
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React Basics
Rich Ross
 

What's hot (19)

BDD style Unit Testing
BDD style Unit TestingBDD style Unit Testing
BDD style Unit Testing
 
Old code doesn't stink
Old code doesn't stinkOld code doesn't stink
Old code doesn't stink
 
Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!Top 10 HTML5 features every developer should know!
Top 10 HTML5 features every developer should know!
 
Rise of the Single Page Application
Rise of the Single Page ApplicationRise of the Single Page Application
Rise of the Single Page Application
 
Survive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and TricksSurvive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and Tricks
 
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
SPA, isomorphic and back to the server: our journey with JavaScript @ JsDay 2...
 
React Native One Day
React Native One DayReact Native One Day
React Native One Day
 
Javascript and Jquery Best practices
Javascript and Jquery Best practicesJavascript and Jquery Best practices
Javascript and Jquery Best practices
 
Oozie Summit 2011
Oozie Summit 2011Oozie Summit 2011
Oozie Summit 2011
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Mobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast diveMobile Open Day: React Native: Crossplatform fast dive
Mobile Open Day: React Native: Crossplatform fast dive
 
Introduction to Bazaar
Introduction to BazaarIntroduction to Bazaar
Introduction to Bazaar
 
Scaling Rails With Torquebox Presented at JUDCon:2011 Boston
Scaling Rails With Torquebox Presented at JUDCon:2011 BostonScaling Rails With Torquebox Presented at JUDCon:2011 Boston
Scaling Rails With Torquebox Presented at JUDCon:2011 Boston
 
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory CourseRuby on Rails 101 - Presentation Slides for a Five Day Introductory Course
Ruby on Rails 101 - Presentation Slides for a Five Day Introductory Course
 
Ruby On Rails Pitfalls
Ruby On Rails PitfallsRuby On Rails Pitfalls
Ruby On Rails Pitfalls
 
When Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz NiedźwiedźWhen Sightly Meets Slice by Tomasz Niedźwiedź
When Sightly Meets Slice by Tomasz Niedźwiedź
 
Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...
Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...
Peer Code Review: In a Nutshell and The Tantric Team: Getting Your Automated ...
 
When Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the EnterpriseWhen Two Worlds Collide: Java and Ruby in the Enterprise
When Two Worlds Collide: Java and Ruby in the Enterprise
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React Basics
 

Viewers also liked

Client computing evolution ppt11
Client computing evolution ppt11Client computing evolution ppt11
Client computing evolution ppt11Tech_MX
 
Mobile Computing UNIT-7
Mobile Computing UNIT-7Mobile Computing UNIT-7
Mobile Computing UNIT-7Ramesh Babu
 
Mobile Computing UNIT-6
Mobile Computing UNIT-6Mobile Computing UNIT-6
Mobile Computing UNIT-6
Ramesh Babu
 
Unit 6
Unit 6Unit 6
Ch2
Ch2Ch2
Ch7
Ch7Ch7
Ch6
Ch6Ch6
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
Kathirvel Ayyaswamy
 
Ch1
Ch1Ch1
Mobile Computing UNIT-I TO III
Mobile Computing UNIT-I TO IIIMobile Computing UNIT-I TO III
Mobile Computing UNIT-I TO III
Ramesh Babu
 
Mobile computing unit 5
Mobile computing  unit 5Mobile computing  unit 5
Mobile computing unit 5
Assistant Professor
 
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
Kathirvel Ayyaswamy
 
Mobile Computing
Mobile ComputingMobile Computing
Mobile Computing
gaurav koriya
 
Mobile operating system ppt
Mobile operating system pptMobile operating system ppt
Mobile operating system pptSantosh Kumar
 
Unit 4
Unit 4Unit 4

Viewers also liked (15)

Client computing evolution ppt11
Client computing evolution ppt11Client computing evolution ppt11
Client computing evolution ppt11
 
Mobile Computing UNIT-7
Mobile Computing UNIT-7Mobile Computing UNIT-7
Mobile Computing UNIT-7
 
Mobile Computing UNIT-6
Mobile Computing UNIT-6Mobile Computing UNIT-6
Mobile Computing UNIT-6
 
Unit 6
Unit 6Unit 6
Unit 6
 
Ch2
Ch2Ch2
Ch2
 
Ch7
Ch7Ch7
Ch7
 
Ch6
Ch6Ch6
Ch6
 
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
 
Ch1
Ch1Ch1
Ch1
 
Mobile Computing UNIT-I TO III
Mobile Computing UNIT-I TO IIIMobile Computing UNIT-I TO III
Mobile Computing UNIT-I TO III
 
Mobile computing unit 5
Mobile computing  unit 5Mobile computing  unit 5
Mobile computing unit 5
 
IT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTINGIT6601 MOBILE COMPUTING
IT6601 MOBILE COMPUTING
 
Mobile Computing
Mobile ComputingMobile Computing
Mobile Computing
 
Mobile operating system ppt
Mobile operating system pptMobile operating system ppt
Mobile operating system ppt
 
Unit 4
Unit 4Unit 4
Unit 4
 

Similar to Smart Client Development

Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The Overview
Atlassian
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
jeresig
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 NotesRoss Lawley
 
Android Bootcamp
Android   BootcampAndroid   Bootcamp
Android Bootcampahkjsdcsadc
 
Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09
Bruno Matos Tavares
 
Inventing the future Business Programming Language
Inventing the future  Business Programming LanguageInventing the future  Business Programming Language
Inventing the future Business Programming Language
ESUG
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)Fabien Potencier
 
Securing Rails
Securing RailsSecuring Rails
Securing Rails
Alex Payne
 
Api Design
Api DesignApi Design
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesHenrik Olsson
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
anshunjain
 
ruby on rails pitfalls
ruby on rails pitfallsruby on rails pitfalls
ruby on rails pitfalls
Robbin Fan
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And MavenPerconaPerformance
 
[Muir] Seam 2 in practice
[Muir] Seam 2 in practice[Muir] Seam 2 in practice
[Muir] Seam 2 in practicejavablend
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
 
MySQL Proxy tutorial
MySQL Proxy tutorialMySQL Proxy tutorial
MySQL Proxy tutorial
Giuseppe Maxia
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
Kazuhiro Sera
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
dosire
 

Similar to Smart Client Development (20)

Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The Overview
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Library
 
Rails Conf Europe 2007 Notes
Rails Conf  Europe 2007  NotesRails Conf  Europe 2007  Notes
Rails Conf Europe 2007 Notes
 
Android Bootcamp
Android   BootcampAndroid   Bootcamp
Android Bootcamp
 
Os Haase
Os HaaseOs Haase
Os Haase
 
Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09Asp.Net Mvc Dev Days09
Asp.Net Mvc Dev Days09
 
Inventing the future Business Programming Language
Inventing the future  Business Programming LanguageInventing the future  Business Programming Language
Inventing the future Business Programming Language
 
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
symfony: An Open-Source Framework for Professionals (Dutch Php Conference 2008)
 
Securing Rails
Securing RailsSecuring Rails
Securing Rails
 
Api Design
Api DesignApi Design
Api Design
 
Ten Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project ExperiencesTen Man-Years of JavaFX: Real World Project Experiences
Ten Man-Years of JavaFX: Real World Project Experiences
 
Understanding Framework Architecture using Eclipse
Understanding Framework Architecture using EclipseUnderstanding Framework Architecture using Eclipse
Understanding Framework Architecture using Eclipse
 
ruby on rails pitfalls
ruby on rails pitfallsruby on rails pitfalls
ruby on rails pitfalls
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And Maven
 
[Muir] Seam 2 in practice
[Muir] Seam 2 in practice[Muir] Seam 2 in practice
[Muir] Seam 2 in practice
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
MySQL Proxy tutorial
MySQL Proxy tutorialMySQL Proxy tutorial
MySQL Proxy tutorial
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in Scala
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Rails
 
Introducing spring
Introducing springIntroducing spring
Introducing spring
 

More from Tamir Khason

WPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF applicationWPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF applicationTamir Khason
 
Understanding Reflection
Understanding ReflectionUnderstanding Reflection
Understanding ReflectionTamir Khason
 
Creating A Game Using Microsoft’s Next Generation Technologies
Creating A Game Using Microsoft’s Next Generation TechnologiesCreating A Game Using Microsoft’s Next Generation Technologies
Creating A Game Using Microsoft’s Next Generation TechnologiesTamir Khason
 
Modern C&C Systems, Using New Technologies
Modern C&C Systems, Using New TechnologiesModern C&C Systems, Using New Technologies
Modern C&C Systems, Using New TechnologiesTamir Khason
 
Wpf Under The Hood Engines
Wpf Under The Hood EnginesWpf Under The Hood Engines
Wpf Under The Hood EnginesTamir Khason
 
Introduction To Wpf Engines
Introduction To Wpf   EnginesIntroduction To Wpf   Engines
Introduction To Wpf EnginesTamir Khason
 

More from Tamir Khason (6)

WPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF applicationWPF for developers - optimizing your WPF application
WPF for developers - optimizing your WPF application
 
Understanding Reflection
Understanding ReflectionUnderstanding Reflection
Understanding Reflection
 
Creating A Game Using Microsoft’s Next Generation Technologies
Creating A Game Using Microsoft’s Next Generation TechnologiesCreating A Game Using Microsoft’s Next Generation Technologies
Creating A Game Using Microsoft’s Next Generation Technologies
 
Modern C&C Systems, Using New Technologies
Modern C&C Systems, Using New TechnologiesModern C&C Systems, Using New Technologies
Modern C&C Systems, Using New Technologies
 
Wpf Under The Hood Engines
Wpf Under The Hood EnginesWpf Under The Hood Engines
Wpf Under The Hood Engines
 
Introduction To Wpf Engines
Introduction To Wpf   EnginesIntroduction To Wpf   Engines
Introduction To Wpf Engines
 

Recently uploaded

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

Smart Client Development

  • 1. Tamir Khason http://khason.net Feb’ 09 Sponsored by:
  • 2. This is not a lesson You should attend
  • 3. What is “good application”?
  • 5. … but what about me? This is Nick … and Nick has also a lot of letters for this machine
  • 6. Smart Client Application should be Simple Useful Deployable Maintainable Extensible ACCEPTABLE
  • 7.
  • 8. What is “Smart Client”? My presentation July 2002 My presentation Feb’ 2009  WinForms User Interface  Client User Interface  Deployed via central server  Zero footprint deployment  Uses local resources  Users local resource  Uses server based data and  Synchronizes and distributes processing data and processes  Works better connected  Smart sensitive to local  Works offline environment  Minimum dependencies
  • 9.
  • 11. Planning Focus on FEATURES Focus on SCENARIOS  Stability  Excitement  Incremental  Breakthroughs improvement  Most probably will  Most probably “End- leave existing to-End” scenarios will customers behind not work
  • 12. Architectural review But it cumbersome We need componentization There is a ton of dependencies
  • 13. Dependencies management  Types in a same component can depend one on each other  Cross-component dependencies must be controlled  Can be depend on component in lower layer  Must not be hard depend on component in higher layer  Must avoid to be soft depend on component in higher layer  Need someone else to manage dependencies on the same layer  Less dependencies – better!  Also less assemblies – better!  … in general – less is better – simpler is better!
  • 14. 10 Design dogmas Component oriented Primitive Oriented  Rich APIs with lots of  No external dependencies features – ton of  Great evolvability, often dependencies very poor usability  Great usability, poor  Incoherent type discovery, evolvability but not required reflection  Easy type discovery, but  Good for low level stable need reflection framework  Good for higher level components - not for the core
  • 15. Extensibility Framework?  There is no “Official” extensibility framework, so you can…  Create from scratch  Buy/use something good…  Wait for .NET 4.0  Use MEF - Managed Extensibility Framework + WPF today Catalog Value Resolver Composition container Part Part Part Export Import Export Import Export Import
  • 16. How it works? Who has service I need? I have! [Import] public IEnumerable<IYourService> YourServices { get; set; } [Export(typeof(IYourService)] public class SomeService : IYourService
  • 17. Who is who and what can it do?  Parts relate through contracts  Imports are contracts parts need  Exports are contracts parts offer  The Container is matchmaker  It queues catalogs  Parts can load lazily  Parts can have different lifetimes  Parts are extensible and reusable
  • 18. Contracts  Preconditions, rather then endless try-catch blocks  Postconditions, rather then endless if-else blocks Assumption.SetPolicy(AssumptionPolicy.Break, new AssumptionHelper()); … public NotNullSet(HashSet<T> set) Assumption.NotNull(set); … Assumption.IsTrue(typeof(T1) != typeof(T2), quot;The two types of values in a mapping cannot be the same type.quot;);  The best about this is Static Analysis!
  • 19. But what’s with “Compatibility”?  Cross-Version Compatibility  Cross-Redistribution Compatibility  Backward Compatibility  Forward Compatibility  Binary Compatibility  Source Compatibility  API Compatibility
  • 20. Primitives and extensibility?  APIs are published as interfaces into a “programmability” assembly  Embed interfaces at compile time  Can be deployed to any version of the managed application  We can “cast” one interface into other in runtime – loose type coupling  We can add some aspects and logic in compile time with custom compilers  In .NET 4.0 only!  By now – you can use PostSharp
  • 21. Generic co- and contravariance  It’s scary, but simple  We can cast to ancestor types private void WriteSomething(object[] something) { } … var something = new string[] { quot;It's somethingquot; }; WriteSomething(something);  But it not always works private void WriteSomething(IEnumerable<object> something) { } … var something = new List<string> { quot;It's somethingquot; }; WriteSomething(something); // Compiler says “NO”!  So should we be able to pass Ixxx<TDerived> for Ixxx<TBase>?
  • 22. Generic co- and contravariance  If T is an output → IX<TDerived> for IX<T>  It’s covariance  …and can be used as IX<out T>  If T is an input → IX<TBase> for IX<T>  It’s contravariance  …and can be used as IX <in T> private void DoSomething(Func<object, IValueConverter> something) { this.Converter = something(this.Whatever); // Oh, NOT!!! } … var something = new Func<string, IValueConverter> { }; DoSomething(something);
  • 23. AOP – WTF?  You have INotifyPropertyChanged primitive public class MyPrimitive : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string name) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(name));  For each setter of each descendant you need to call virtual method OnPropertyChanged public class MyClass : MyPrimitive { private int _myProperty; public int MyProperty { get { return _myProperty; } set { if (_myProperty != value) { _myProperty = value; OnPropertyChanged(quot;MyPropertyquot;);  Rather then use automatic setters public int MyProperty { get; set; }
  • 24. AOP – WTF?  The best is to create your own compilation rule…  … or even some dynamic primitives…  … but it only possible in .NET 4.0  Meanwhile, you can use PostSharp and OnMethodBoundaryAspect primitive to tell compiler what to do internal class SetterWrapper : OnMethodBoundaryAspect { public override void OnEntry(MethodExecutionEventArgs eventArgs) { var myPrimitive = eventArgs.Instance as MyPrimitive ; _propertyInfo = myPrimitive.Class.GetProperty(_propertyName); eventArgs.MethodExecutionTag = myPrimitive.OnBeforePropertyChange(_propertyInfo, newValue, oldValue); eventArgs.FlowBehavior = FlowBehavior.Return;  All the rest will be done automagically
  • 25. Side by Side  .NET 1.x and 2.x CLR - Side by Side on the same machine  Good for programs  Bad for add-ins  Breaks on 3.x “red bits”  .NET 4.x CLR – Side by Side in process with 2.x CLR  Each module runs again its expected version of CLR  Can be done today by some unmanaged injections
  • 27. Real life software Perform Specialised tasks Can process more than one request at a time Increase staff during peek hours or replace staff on trouble
  • 28. Real life software Async Process Queues Storages Dispatcher Processor Worker
  • 29. Need a change of thinking  To throw out  Local states  Client locks, transactions and scopes  Fault tolerance  To bring aboard  Asynchronous operations  Simplicity  Self descriptive behaviors and components
  • 30. Local resources?  Windows Sensor and Location platform  Basically the better way to access well-known device types  Build context aware applications  Can be used today by wrapping HID_* methods  Microsoft Sync Framework  You can synchronize your application or device and provide it offline capabilities  Build “sometimes connected” applications  “DirectHardware” is your friend and savior  DirectX helps you to leverage client’s hardware  It also can varnish a bit your app
  • 34. We already have a lot of stuff  We have trees in WPF  Logical tree – is what you put in XAML  Visual tree – the what WPF renders for us  Inheritance – frozen hybrid of two above  We have Context  All Data Context inherited via trees  Resources inherited via Logical tree  Routed events and commands can be used through Visual tree  Data Templates = Views
  • 35. 2 conclude  Think as consumer, not as developer  DO design APIs by using it (writing code)  Keep It Simple, Stupid!  Set goals, gates and make an order Staging Feature branch branch Staging Main Feature branch branch Staging branch  Avoid integrating unfinished features (yes, even if it is very cool feature)
  • 36. 2 Read  My Blog http://khason.net  Windows Client Development http://windowsclient.net  Windows Presentation Foundation (Toolkit, Futures, Ribbon, Labs, M-V-VM) http://codeplex.com/wpf  Managed Extensibility Framework (MEF) http://codeplex.com/mef  PostSharp + Aspect-Oriented Programming.NET http://postsharp.org  Microsoft WHDC site (Sensors) http://microsoft.com/whdc/sensors  Microsoft Sync Framework http://msdn.microsoft.com/en-us/sync
  • 37. Thank you Questions? … and I do not need “Potential – Passion” slide anymore… tamir@khason.biz http://khason.net