SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

BDD style Unit Testing
BDD style Unit TestingBDD style Unit Testing
BDD style Unit TestingWen-Tien Chang
 
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 TricksJuho 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 DayTroy Miles
 
Javascript and Jquery Best practices
Javascript and Jquery Best practicesJavascript and Jquery Best practices
Javascript and Jquery Best practicesSultan Khan
 
Oozie Summit 2011
Oozie Summit 2011Oozie Summit 2011
Oozie Summit 2011mislam77
 
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 diveepamspb
 
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 Coursepeter_marklund
 
Ruby On Rails Pitfalls
Ruby On Rails PitfallsRuby On Rails Pitfalls
Ruby On Rails PitfallsRobin 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 BasicsRich Ross
 

Tendances (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
 

En vedette (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
 

Similaire à Smart Client Development

Plugins 2.0: The Overview
Plugins 2.0: The OverviewPlugins 2.0: The Overview
Plugins 2.0: The OverviewAtlassian
 
Building a JavaScript Library
Building a JavaScript LibraryBuilding a JavaScript Library
Building a JavaScript Libraryjeresig
 
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
 
Inventing the future Business Programming Language
Inventing the future  Business Programming LanguageInventing the future  Business Programming Language
Inventing the future Business Programming LanguageESUG
 
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 RailsAlex Payne
 
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 Eclipseanshunjain
 
ruby on rails pitfalls
ruby on rails pitfallsruby on rails pitfalls
ruby on rails pitfallsRobbin 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
 
Solid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaSolid And Sustainable Development in Scala
Solid And Sustainable Development in ScalaKazuhiro Sera
 
When To Use Ruby On Rails
When To Use Ruby On RailsWhen To Use Ruby On Rails
When To Use Ruby On Railsdosire
 

Similaire à 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
 

Plus de 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
 

Plus de 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
 

Dernier

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 

Dernier (20)

MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 

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