SlideShare une entreprise Scribd logo
1  sur  47
Caliburn.Micro Solving real word problems implementing MVVM bart.wullems@ordina.be http://bartwullems.blogspot.com
Agenda MVVM Frameworks Caliburn(.Micro) What is it? Patterns Features
MVVM Frameworks
MVVM Frameworks Explorer Source: http://www.japf.fr/silverlight/mvvm/index.html/
What is Caliburn?
6
What is Caliburn? “Caliburn is a set of libraries designed to aid in the development of WPF, Silverlight and WP7 applications” http://caliburnmicro.codeplex.com
Fact Implementing a User Interface is easy
Fact Implementing a maintainable User Interface is hard
Goals of Caliburn Build WPF/SL/WP7 Applications in a TDD friendly way Simplify usage of various UI design patterns in WPF/SL/WP7 Simplify common UI tasks Provide solutions to common    UI architecture problems Remove the boilerplate code     when building MVVM app’s
It’s all about patterns...
Presentation Model Presentation Model coordinates changes in the Model Presentation Model View calls operations View Model Operations Data Model alerts the Presentation Model View synchronizes  with PresentationModel
Model – View – ViewModel Change notification Presenter coordinates changes in the Model ViewModel View Model Commands Data View binds  to commands  and data Model alerts the Controller
Command ICommand Invoker + Execute() + CanExecute() Command Receiver
Application Controller “A centralized point for handling screen navigation and the flow of an application.” – Martin Fowler
Service Locator Service A Class A Locator Service B
Dependency Injection Container Dependency Injection Container Component
Event Aggregator Results Model Criteria Model hub Publish Handle Publish Handle Advert Model Recent Searches Model
The application
The Application
The Application No Code Behind No Event Wireups No Commands No Data Binding No Data Templates No Async Programming No Custom Controls No 3rd Party Libraries
Features
Features Overview Basic configuration and bootstrapping Actions Screens, Conductors and Composition All about conventions The Window Manager The Event Aggregator Coroutines
Basic Configuration Convention over Configuration Limited amount of configuration needed Simple naming convention to locate Views for ViewModels.  e.g. MyApp.ViewModels.MyViewModelMyApp.Views.MyView.  Bootstrapper Should run at startup Specifies the root view model(=Application Shell) View Model First but can be changed IoC Has it’s own small IoC container Can be replaced by the IoC of your choice(MEF, Unity,…)
Demo- Basic Configuration
Actions - Basics Command implementation for Caliburn.Micro Extend databinding to bind not only data but also methods Leverages System.Windows.Interactivity for it’s trigger mechanism.  Use anything that inherits from TriggerBaseto trigger the sending of an action message(events, …) No need to add a command class and/or property on VM Allows: Execution of methods Passing data from the UI into methods Synchronous/Asynchronous calls
Action - Guards Guard property  Handler: “SayHello” message Guard property: “CanSayHello” CM will observe changes in that property and re-evaluate the guard accordingly. Based on INotifyPropertyChanged to refresh trigger availability Can change the state of the bound control E.g. change a button to disabled, hide a menu item,…
Demo- Actions
UI Lifecycle Management Often using MVVM involves tricky UI lifecycle issues for various UI components Activation Deactivation Shutdown Caliburn.Micro handles this lifecycle with Screens, Conductors and Screen Collections 29
UI Lifecycle Management Screen A statefulunit of work existing within the presentation tier of an application.  Has a lifecycle associated with it. Screen Conductor Enforces the Screen Activation Lifecycle  Activates screens.  Deactivates screens. Allows graceful shutdown.  Screen Collection Maintains the list of currently opened screens or documents
UI Lifecycle Management Conductor Screen 1 Screen 2 Active Active Activate() Screen 2 Deactive() Screen 1 CanClose() Returns True Activate() Screen 2
Demo- Simple Navigation
Demo- Simple MDI
Conventions Removes the need to write boiler plate code Fully customizable Can be turned off if you hate them On by default Conventions for View/ViewModel resolution Data binding Action binding
Demo- Conventions
Window Manager Provides a View-Model-centric way of displaying Windows (ChildWindow in SL and Window in WPF).  Available methods ShowDialog ShowWindow ShowPopup Uses a Conductor under the hood
Demo – Window Manager
Event Aggregator Communicate between objects in a loosely coupled way Follows a bus-style pub/sub model.  Uses weak references Publishes on the UI thread.
Demo – Event Aggregator
Coroutines Wikipedia: “In computer science, coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations. Coroutines are well-suited for implementing more familiar program components such as cooperative tasks, iterators, infinite lists and pipes.”
Coroutines Introduces asynchronous programming in a simple way. Build on top of iterators. 2 required actions Implement the IResult interface on some class, representing the task you wish to execute Yield instances of IResult from an Action
Coroutines Allows you to execute a method, pause it’s execution, do something else, come back and resume execution where you left off.  Extremely powerful in task-based programming
Coroutines Silverlight example:  Dynamically download and show screens not part of the main package.
Coroutines Show “Loading” indicator Load Screen() yieldreturn yieldreturn yieldreturn yieldreturn Asynchronously download the external package Hide“Loading” indicator Navigate to a particular screen inside the dynamic module
Demo - Coroutines
TODAY’s TALK Remember!  Still a lot to discover... CALIBURN
Conclusions Caliburn.Micro is clean and simple Allows you to create very rich applications with a strong focus on maintainability and reuse A LOT of UI principles are applied in Caliburn.Micro Also check it’s big brother Caliburn “If you don’t like the code, use it as a learning tool” 47

Contenu connexe

Tendances

Deploy mule application
Deploy mule applicationDeploy mule application
Deploy mule applicationSon Nguyen
 
Buzzword, How'd They Build That?
Buzzword, How'd They Build That?Buzzword, How'd They Build That?
Buzzword, How'd They Build That?dcoletta
 
Integration with CMIS using Mule ESB
Integration with CMIS using Mule ESBIntegration with CMIS using Mule ESB
Integration with CMIS using Mule ESBSanjeet Pandey
 
Mule integration-application
Mule integration-applicationMule integration-application
Mule integration-applicationNaresh Naidu
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Thecreating Experts
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesQamar Abbas
 
Logging best practice in mule using logger component
Logging best practice in mule using logger componentLogging best practice in mule using logger component
Logging best practice in mule using logger componentGovind Mulinti
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with muleF K
 
Models used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMModels used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMAndrei Popa
 
Acrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVMAcrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVMDong-Ho Lee
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Jeremy Likness
 
ReactiveCocoa - Functional Reactive Programming concepts in iOS
ReactiveCocoa - Functional Reactive Programming concepts in iOSReactiveCocoa - Functional Reactive Programming concepts in iOS
ReactiveCocoa - Functional Reactive Programming concepts in iOSAndrei Popa
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in MuleKhasim Saheb
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksRobert MacLean
 

Tendances (20)

Mule testing
Mule testingMule testing
Mule testing
 
Mvvm basics
Mvvm basicsMvvm basics
Mvvm basics
 
Deploy mule application
Deploy mule applicationDeploy mule application
Deploy mule application
 
Anypoint lessons
Anypoint lessonsAnypoint lessons
Anypoint lessons
 
Buzzword, How'd They Build That?
Buzzword, How'd They Build That?Buzzword, How'd They Build That?
Buzzword, How'd They Build That?
 
Integration with CMIS using Mule ESB
Integration with CMIS using Mule ESBIntegration with CMIS using Mule ESB
Integration with CMIS using Mule ESB
 
Mule integration-application
Mule integration-applicationMule integration-application
Mule integration-application
 
Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2 Selenium Training in Chennai Demo Part-2
Selenium Training in Chennai Demo Part-2
 
Mobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelinesMobile App Architectures & Coding guidelines
Mobile App Architectures & Coding guidelines
 
Logging best practice in mule using logger component
Logging best practice in mule using logger componentLogging best practice in mule using logger component
Logging best practice in mule using logger component
 
Automatic documentation with mule
Automatic documentation with muleAutomatic documentation with mule
Automatic documentation with mule
 
Models used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVMModels used in iOS programming, with a focus on MVVM
Models used in iOS programming, with a focus on MVVM
 
Acrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVMAcrhitecture deisign pattern_MVC_MVP_MVVM
Acrhitecture deisign pattern_MVC_MVP_MVVM
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
ReactiveCocoa - Functional Reactive Programming concepts in iOS
ReactiveCocoa - Functional Reactive Programming concepts in iOSReactiveCocoa - Functional Reactive Programming concepts in iOS
ReactiveCocoa - Functional Reactive Programming concepts in iOS
 
No brainer
No brainerNo brainer
No brainer
 
Cbr
CbrCbr
Cbr
 
Deploying and Running in Mule
Deploying and Running in MuleDeploying and Running in Mule
Deploying and Running in Mule
 
Mule
MuleMule
Mule
 
Windows Store Apps: Tips & Tricks
Windows Store Apps: Tips & TricksWindows Store Apps: Tips & Tricks
Windows Store Apps: Tips & Tricks
 

Similaire à Caliburn.micro

Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernatebwullems
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applicationsIvano Malavolta
 
MVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebdayMVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebdayRicardo Fiel
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Svetlin Nakov
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCAnton Krasnoshchok
 
Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...
Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...
Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...Codemotion
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Steven Smith
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...Fwdays
 
HCI 3e - Ch 8: Implementation support
HCI 3e - Ch 8:  Implementation supportHCI 3e - Ch 8:  Implementation support
HCI 3e - Ch 8: Implementation supportAlan Dix
 
Part 2 improving your software development v1.0
Part 2   improving your software development v1.0Part 2   improving your software development v1.0
Part 2 improving your software development v1.0Jasmine Conseil
 
ActionScript Design Patterns
ActionScript Design Patterns ActionScript Design Patterns
ActionScript Design Patterns Yoss Cohen
 
Porting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidancePorting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidanceOur Community Exchange LLC
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC StructureDipika Wadhvani
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVMBoulos Dib
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the informationToushik Paul
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderSimon Massey
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0Jasmine Conseil
 
Best practices for creating modular Web applications
Best practices for creating modular Web applicationsBest practices for creating modular Web applications
Best practices for creating modular Web applicationspeychevi
 

Similaire à Caliburn.micro (20)

Building an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernateBuilding an enterprise app in silverlight 4 and NHibernate
Building an enterprise app in silverlight 4 and NHibernate
 
Developing maintainable Cordova applications
Developing maintainable Cordova applicationsDeveloping maintainable Cordova applications
Developing maintainable Cordova applications
 
MVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebdayMVVM+MEF in Silvelight - W 2010ebday
MVVM+MEF in Silvelight - W 2010ebday
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
 
MVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVCMVC Pattern. Flex implementation of MVC
MVC Pattern. Flex implementation of MVC
 
Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...
Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...
Next generation of frontend architectures - Luca Mezzalira - Codemotion Milan...
 
Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013Common ASP.NET Design Patterns - Telerik India DevCon 2013
Common ASP.NET Design Patterns - Telerik India DevCon 2013
 
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai..."Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
"Micro-frontends: Scalable and Modular Frontend in Parimatch Tech", Kyrylo Ai...
 
HCI 3e - Ch 8: Implementation support
HCI 3e - Ch 8:  Implementation supportHCI 3e - Ch 8:  Implementation support
HCI 3e - Ch 8: Implementation support
 
Part 2 improving your software development v1.0
Part 2   improving your software development v1.0Part 2   improving your software development v1.0
Part 2 improving your software development v1.0
 
ActionScript Design Patterns
ActionScript Design Patterns ActionScript Design Patterns
ActionScript Design Patterns
 
Porting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application GuidancePorting the Legacy Application to Composite Application Guidance
Porting the Legacy Application to Composite Application Guidance
 
Ppt of Basic MVC Structure
Ppt of Basic MVC StructurePpt of Basic MVC Structure
Ppt of Basic MVC Structure
 
Introduction To MVVM
Introduction To MVVMIntroduction To MVVM
Introduction To MVVM
 
Soft serve prism
Soft serve prismSoft serve prism
Soft serve prism
 
Monorail Introduction
Monorail IntroductionMonorail Introduction
Monorail Introduction
 
A report on mvc using the information
A report on mvc using the informationA report on mvc using the information
A report on mvc using the information
 
Design Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-BinderDesign Patterns in ZK: Java MVVM as Model-View-Binder
Design Patterns in ZK: Java MVVM as Model-View-Binder
 
Presentation 1 open source tools in continuous integration environment v1.0
Presentation 1   open source tools in continuous integration environment v1.0Presentation 1   open source tools in continuous integration environment v1.0
Presentation 1 open source tools in continuous integration environment v1.0
 
Best practices for creating modular Web applications
Best practices for creating modular Web applicationsBest practices for creating modular Web applications
Best practices for creating modular Web applications
 

Plus de bwullems

GraphQL - A love story
GraphQL -  A love storyGraphQL -  A love story
GraphQL - A love storybwullems
 
ElasticSearch - Search done right
ElasticSearch - Search done rightElasticSearch - Search done right
ElasticSearch - Search done rightbwullems
 
Techorama - Evolvable Application Development with MongoDB
Techorama  - Evolvable Application Development with MongoDBTechorama  - Evolvable Application Development with MongoDB
Techorama - Evolvable Application Development with MongoDBbwullems
 
Git(hub) for windows developers
Git(hub) for windows developersGit(hub) for windows developers
Git(hub) for windows developersbwullems
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!bwullems
 
Tfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 AppTfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 Appbwullems
 
Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0bwullems
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overviewbwullems
 

Plus de bwullems (8)

GraphQL - A love story
GraphQL -  A love storyGraphQL -  A love story
GraphQL - A love story
 
ElasticSearch - Search done right
ElasticSearch - Search done rightElasticSearch - Search done right
ElasticSearch - Search done right
 
Techorama - Evolvable Application Development with MongoDB
Techorama  - Evolvable Application Development with MongoDBTechorama  - Evolvable Application Development with MongoDB
Techorama - Evolvable Application Development with MongoDB
 
Git(hub) for windows developers
Git(hub) for windows developersGit(hub) for windows developers
Git(hub) for windows developers
 
Javascript omg!
Javascript omg!Javascript omg!
Javascript omg!
 
Tfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 AppTfs Monitor Windows Phone 7 App
Tfs Monitor Windows Phone 7 App
 
Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0Convention over configuration in .Net 4.0
Convention over configuration in .Net 4.0
 
Visual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 OverviewVisual Studio 2010 and .NET 4.0 Overview
Visual Studio 2010 and .NET 4.0 Overview
 

Dernier

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 

Dernier (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
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
 

Caliburn.micro

  • 1. Caliburn.Micro Solving real word problems implementing MVVM bart.wullems@ordina.be http://bartwullems.blogspot.com
  • 2. Agenda MVVM Frameworks Caliburn(.Micro) What is it? Patterns Features
  • 4. MVVM Frameworks Explorer Source: http://www.japf.fr/silverlight/mvvm/index.html/
  • 6. 6
  • 7. What is Caliburn? “Caliburn is a set of libraries designed to aid in the development of WPF, Silverlight and WP7 applications” http://caliburnmicro.codeplex.com
  • 8. Fact Implementing a User Interface is easy
  • 9. Fact Implementing a maintainable User Interface is hard
  • 10. Goals of Caliburn Build WPF/SL/WP7 Applications in a TDD friendly way Simplify usage of various UI design patterns in WPF/SL/WP7 Simplify common UI tasks Provide solutions to common UI architecture problems Remove the boilerplate code when building MVVM app’s
  • 11. It’s all about patterns...
  • 12. Presentation Model Presentation Model coordinates changes in the Model Presentation Model View calls operations View Model Operations Data Model alerts the Presentation Model View synchronizes with PresentationModel
  • 13. Model – View – ViewModel Change notification Presenter coordinates changes in the Model ViewModel View Model Commands Data View binds to commands and data Model alerts the Controller
  • 14. Command ICommand Invoker + Execute() + CanExecute() Command Receiver
  • 15. Application Controller “A centralized point for handling screen navigation and the flow of an application.” – Martin Fowler
  • 16. Service Locator Service A Class A Locator Service B
  • 17. Dependency Injection Container Dependency Injection Container Component
  • 18. Event Aggregator Results Model Criteria Model hub Publish Handle Publish Handle Advert Model Recent Searches Model
  • 21. The Application No Code Behind No Event Wireups No Commands No Data Binding No Data Templates No Async Programming No Custom Controls No 3rd Party Libraries
  • 23. Features Overview Basic configuration and bootstrapping Actions Screens, Conductors and Composition All about conventions The Window Manager The Event Aggregator Coroutines
  • 24. Basic Configuration Convention over Configuration Limited amount of configuration needed Simple naming convention to locate Views for ViewModels. e.g. MyApp.ViewModels.MyViewModelMyApp.Views.MyView. Bootstrapper Should run at startup Specifies the root view model(=Application Shell) View Model First but can be changed IoC Has it’s own small IoC container Can be replaced by the IoC of your choice(MEF, Unity,…)
  • 26. Actions - Basics Command implementation for Caliburn.Micro Extend databinding to bind not only data but also methods Leverages System.Windows.Interactivity for it’s trigger mechanism. Use anything that inherits from TriggerBaseto trigger the sending of an action message(events, …) No need to add a command class and/or property on VM Allows: Execution of methods Passing data from the UI into methods Synchronous/Asynchronous calls
  • 27. Action - Guards Guard property Handler: “SayHello” message Guard property: “CanSayHello” CM will observe changes in that property and re-evaluate the guard accordingly. Based on INotifyPropertyChanged to refresh trigger availability Can change the state of the bound control E.g. change a button to disabled, hide a menu item,…
  • 29. UI Lifecycle Management Often using MVVM involves tricky UI lifecycle issues for various UI components Activation Deactivation Shutdown Caliburn.Micro handles this lifecycle with Screens, Conductors and Screen Collections 29
  • 30. UI Lifecycle Management Screen A statefulunit of work existing within the presentation tier of an application. Has a lifecycle associated with it. Screen Conductor Enforces the Screen Activation Lifecycle Activates screens. Deactivates screens. Allows graceful shutdown. Screen Collection Maintains the list of currently opened screens or documents
  • 31. UI Lifecycle Management Conductor Screen 1 Screen 2 Active Active Activate() Screen 2 Deactive() Screen 1 CanClose() Returns True Activate() Screen 2
  • 34. Conventions Removes the need to write boiler plate code Fully customizable Can be turned off if you hate them On by default Conventions for View/ViewModel resolution Data binding Action binding
  • 36. Window Manager Provides a View-Model-centric way of displaying Windows (ChildWindow in SL and Window in WPF). Available methods ShowDialog ShowWindow ShowPopup Uses a Conductor under the hood
  • 37. Demo – Window Manager
  • 38. Event Aggregator Communicate between objects in a loosely coupled way Follows a bus-style pub/sub model. Uses weak references Publishes on the UI thread.
  • 39. Demo – Event Aggregator
  • 40. Coroutines Wikipedia: “In computer science, coroutines are program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations. Coroutines are well-suited for implementing more familiar program components such as cooperative tasks, iterators, infinite lists and pipes.”
  • 41. Coroutines Introduces asynchronous programming in a simple way. Build on top of iterators. 2 required actions Implement the IResult interface on some class, representing the task you wish to execute Yield instances of IResult from an Action
  • 42. Coroutines Allows you to execute a method, pause it’s execution, do something else, come back and resume execution where you left off. Extremely powerful in task-based programming
  • 43. Coroutines Silverlight example: Dynamically download and show screens not part of the main package.
  • 44. Coroutines Show “Loading” indicator Load Screen() yieldreturn yieldreturn yieldreturn yieldreturn Asynchronously download the external package Hide“Loading” indicator Navigate to a particular screen inside the dynamic module
  • 46. TODAY’s TALK Remember! Still a lot to discover... CALIBURN
  • 47. Conclusions Caliburn.Micro is clean and simple Allows you to create very rich applications with a strong focus on maintainability and reuse A LOT of UI principles are applied in Caliburn.Micro Also check it’s big brother Caliburn “If you don’t like the code, use it as a learning tool” 47

Notes de l'éditeur

  1. The Sword in the Stone about the magician Merlin and King Arthur
  2. View has references to PresentationModelPresentationModel also coordinates control state changes (eg: enabled/disabled controls)Contains plumbing code for synchronization.NET Data binding was not yet ready for this
  3. View  ViewModel : Binding to commands and dataViewModel: Abstraction of the View, Has no reference to the View (unlike MVP)ViewModel  View : Change notifcation: EventsViewModel  Model : Normal interaction