SlideShare une entreprise Scribd logo
1  sur  11
Juan de Hoyos 
Zühlke Engineering GmbH 
Juan.dehoyos@zuehlke.com 
Applying the Presentation Model 
Design Pattern in Qt Style 
© Zühlke 2014 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 1
© Zühlke 2014 
What makes an application awesome? 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 2
What makes a graphical interface awesome?(*) 
© Zühlke 2014 
1. Clarity 
2. Concision 
3. Familiarity 
4. Responsiveness 
5. Consistency 
6. Aesthetics 
7. Efficiency 
8. Forgiveness 
(*) wikipedia:http://en.wikipedia.org/wiki/User_interface 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 3
© Zühlke 2014 
It’s not that easy 
• Complex UI: mix C++/QML/Javascript 
• Low degree of encapsulation 
• Where to place common functionality? 
• Widgets aware of domain layer 
• … 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 4
© Zühlke 2014 
Classical Layer architecture 
View 
Business logic 
Infrastructure 
• Display information 
• React to user actions 
• UI state 
• Data transformation 
• Domain rules 
• Data structures 
• Application state 
• Data Persistence 
• Networking 
• Etc. 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 5
• UI state 
• Data transformation 
• Synchronize View and BL layers 
(*) http://martinfowler.com/eaaDev/PresentationModel.html 
© Zühlke 2014 
Adding a new layer: Presentation Model* 
View 
Presentation Model 
Business logic 
Infrastructure 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 6
© Zühlke 2014 
Qt to rescue! 
What we want: to Pull the functionality out of view but still profit from 
QML/Javascript expressivity: 
• Keep the business logic in C++ 
• Write the model(s) in QML 
– Synchronize via Signal/Slots and property binding 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 7
© Zühlke 2014 
Example: Log viewer 
Display critical logs 
Display all logs 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 8
View Presentation Model 
• Log to display 
• Filter button 
• Window title 
EventLogs.qml 
• List of logs 
• Current Filtering 
(state) 
EventLogsPM.qml 
Set Filter 
Model changed 
Visible logs 
QML 
Retrieve Logs C++ 
• Business Logic 
EventLogs.cpp 
Logs Logs 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 9 © Zühlke 2014
© Zühlke 2014 
Wrap up 
• In complex UIs pulling the presentation behavior out of the widgets pays 
off: Presentation Model Pattern. 
• This increases the complexity, specially by the synchronization of data. 
• Fortunately, Qt provides us features that make the synchronization 
easier: 
• Signal/Slots 
• Property binding 
• By using QML in the model we can benefit of a declarative approach. 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 10
Thanks! 
Juan de Hoyos 
Zühlke Engineering GmbH 
Juan.dehoyos@zuehlke.com 
Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 11 © Zühlke 2014

Contenu connexe

Tendances

AWS Black Belt Tech シリーズ 2015 - AWS CloudFormation
AWS Black Belt Tech シリーズ 2015 - AWS CloudFormationAWS Black Belt Tech シリーズ 2015 - AWS CloudFormation
AWS Black Belt Tech シリーズ 2015 - AWS CloudFormationAmazon Web Services Japan
 
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개Ian Choi
 
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信Amazon Web Services Japan
 
より高品質なメディアサービスを目指す ABEMA の技術進化
より高品質なメディアサービスを目指す ABEMA の技術進化より高品質なメディアサービスを目指す ABEMA の技術進化
より高品質なメディアサービスを目指す ABEMA の技術進化Yusuke Goto
 
適切な Azure AD 認証方式の選択の決め手
適切な Azure AD 認証方式の選択の決め手適切な Azure AD 認証方式の選択の決め手
適切な Azure AD 認証方式の選択の決め手Yusuke Kodama
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. Kellton Tech Solutions Ltd
 
Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~Hideaki Aoyagi
 
Lambda layerをDeployする方法を調べる
Lambda layerをDeployする方法を調べるLambda layerをDeployする方法を調べる
Lambda layerをDeployする方法を調べるshotaueda3
 
Container security
Container securityContainer security
Container securityAnthony Chow
 
Docker Networking Tip - Macvlan driver
Docker Networking Tip - Macvlan driverDocker Networking Tip - Macvlan driver
Docker Networking Tip - Macvlan driverSreenivas Makam
 
Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策
Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策
Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策Yusuke Kodama
 
[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드DataUs
 
JAWS-UG初心者支部 リザーブドインスタンス買ってみた
JAWS-UG初心者支部 リザーブドインスタンス買ってみたJAWS-UG初心者支部 リザーブドインスタンス買ってみた
JAWS-UG初心者支部 リザーブドインスタンス買ってみた佐藤 雅樹
 
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪崇之 清水
 
AWS Black Belt Online Seminar AWS Direct Connect
AWS Black Belt Online Seminar AWS Direct ConnectAWS Black Belt Online Seminar AWS Direct Connect
AWS Black Belt Online Seminar AWS Direct ConnectAmazon Web Services Japan
 
[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについて
[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについて[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについて
[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについてAmazon Web Services Japan
 

Tendances (20)

Amazon Simple Workflow Service (SWF)
Amazon Simple Workflow Service (SWF)Amazon Simple Workflow Service (SWF)
Amazon Simple Workflow Service (SWF)
 
AWS Black Belt Tech シリーズ 2015 - AWS CloudFormation
AWS Black Belt Tech シリーズ 2015 - AWS CloudFormationAWS Black Belt Tech シリーズ 2015 - AWS CloudFormation
AWS Black Belt Tech シリーズ 2015 - AWS CloudFormation
 
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
 
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信
20191112 AWS Black Belt Online Seminar AWS Media Services で始めるライブ動画配信
 
より高品質なメディアサービスを目指す ABEMA の技術進化
より高品質なメディアサービスを目指す ABEMA の技術進化より高品質なメディアサービスを目指す ABEMA の技術進化
より高品質なメディアサービスを目指す ABEMA の技術進化
 
Migrating from MFC to Qt
Migrating from MFC to QtMigrating from MFC to Qt
Migrating from MFC to Qt
 
適切な Azure AD 認証方式の選択の決め手
適切な Azure AD 認証方式の選択の決め手適切な Azure AD 認証方式の選択の決め手
適切な Azure AD 認証方式の選択の決め手
 
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain. What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
What’s Mule 4.3? How Does Anytime RTF Help? Our insights explain.
 
Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~Amazon EKS への道 ~ EKS 再入門 ~
Amazon EKS への道 ~ EKS 再入門 ~
 
AWS SDK for Android and iOS
AWS SDK for Android and iOSAWS SDK for Android and iOS
AWS SDK for Android and iOS
 
GraalVm and Quarkus
GraalVm and QuarkusGraalVm and Quarkus
GraalVm and Quarkus
 
Lambda layerをDeployする方法を調べる
Lambda layerをDeployする方法を調べるLambda layerをDeployする方法を調べる
Lambda layerをDeployする方法を調べる
 
Container security
Container securityContainer security
Container security
 
Docker Networking Tip - Macvlan driver
Docker Networking Tip - Macvlan driverDocker Networking Tip - Macvlan driver
Docker Networking Tip - Macvlan driver
 
Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策
Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策
Office365 および Azure AD 管理者が必ずやっておくべきセキュリティ対策
 
[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드[DataUs]클라우드 입문자를 위한 보안 가이드
[DataUs]클라우드 입문자를 위한 보안 가이드
 
JAWS-UG初心者支部 リザーブドインスタンス買ってみた
JAWS-UG初心者支部 リザーブドインスタンス買ってみたJAWS-UG初心者支部 リザーブドインスタンス買ってみた
JAWS-UG初心者支部 リザーブドインスタンス買ってみた
 
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪
AWS Elastic Beanstalk(初心者向け 超速マスター編)JAWSUG大阪
 
AWS Black Belt Online Seminar AWS Direct Connect
AWS Black Belt Online Seminar AWS Direct ConnectAWS Black Belt Online Seminar AWS Direct Connect
AWS Black Belt Online Seminar AWS Direct Connect
 
[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについて
[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについて[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについて
[20210519 Security-JAWS] AWS エッジサービス入門ハンズオンの紹介と AWS WAF のアップデートについて
 

Similaire à Applying the Presentation Model Design Pattern in Qt

Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicICS
 
PyData NYC 2015 Presentation
PyData NYC 2015 PresentationPyData NYC 2015 Presentation
PyData NYC 2015 Presentationviz4biz
 
Advanced proactive and polymorphing cloud application adaptation with MORPHEM...
Advanced proactive and polymorphing cloud application adaptation with MORPHEM...Advanced proactive and polymorphing cloud application adaptation with MORPHEM...
Advanced proactive and polymorphing cloud application adaptation with MORPHEM...OW2
 
Put the Power of Cloud-based Modeling to Work - Spotlight Session
Put the Power of Cloud-based Modeling to Work - Spotlight SessionPut the Power of Cloud-based Modeling to Work - Spotlight Session
Put the Power of Cloud-based Modeling to Work - Spotlight SessionObeo
 
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia ChapterFORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia ChapterDiana Gray, MBA
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...
Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...
Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...mfrancis
 
The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa InitiativeNuvole
 
Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015
Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015
Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015Christophe Lucas
 
Mule soft meetup Houston 16
Mule soft meetup Houston 16Mule soft meetup Houston 16
Mule soft meetup Houston 16Jim Andrews
 
Melbourne Virtual MuleSoft Meetup December 2022
Melbourne Virtual MuleSoft Meetup December 2022Melbourne Virtual MuleSoft Meetup December 2022
Melbourne Virtual MuleSoft Meetup December 2022Daniel Soffner
 
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptxPrinceton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptxSravan Lingam
 
Service Engineering, ZHAW for CeBIT
Service Engineering, ZHAW for CeBITService Engineering, ZHAW for CeBIT
Service Engineering, ZHAW for CeBITAmrita Prasad
 
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...OCCIware
 
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...Marc Dutoo
 
Mastering SCRUM & UCD
Mastering SCRUM & UCDMastering SCRUM & UCD
Mastering SCRUM & UCDuxHH
 
Implementing CloudHub 2.0 CI/CD Pipeline with Bitbucket Integration
Implementing CloudHub 2.0 CI/CD Pipeline with Bitbucket IntegrationImplementing CloudHub 2.0 CI/CD Pipeline with Bitbucket Integration
Implementing CloudHub 2.0 CI/CD Pipeline with Bitbucket Integrationsandeepmenon62
 
Boek Presentatie
Boek PresentatieBoek Presentatie
Boek Presentatieceelen
 
Eclipse Finance Day: Sirius for Finance
Eclipse Finance Day: Sirius for FinanceEclipse Finance Day: Sirius for Finance
Eclipse Finance Day: Sirius for FinanceEtienne Juliot
 
London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023AnuragSharma900
 

Similaire à Applying the Presentation Model Design Pattern in Qt (20)

Software Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business LogicSoftware Development Best Practices: Separating UI from Business Logic
Software Development Best Practices: Separating UI from Business Logic
 
PyData NYC 2015 Presentation
PyData NYC 2015 PresentationPyData NYC 2015 Presentation
PyData NYC 2015 Presentation
 
Advanced proactive and polymorphing cloud application adaptation with MORPHEM...
Advanced proactive and polymorphing cloud application adaptation with MORPHEM...Advanced proactive and polymorphing cloud application adaptation with MORPHEM...
Advanced proactive and polymorphing cloud application adaptation with MORPHEM...
 
Put the Power of Cloud-based Modeling to Work - Spotlight Session
Put the Power of Cloud-based Modeling to Work - Spotlight SessionPut the Power of Cloud-based Modeling to Work - Spotlight Session
Put the Power of Cloud-based Modeling to Work - Spotlight Session
 
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia ChapterFORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
FORWARD 5 Key Highlights and Product Updates - Philadelphia Chapter
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...
Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...
Siemens OpenSOA - A Unified Communications Service Framework built on OSGi - ...
 
The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa Initiative
 
Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015
Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015
Perth DevOps Meetup - Introducing the IBM Innovation Lab - 12112015
 
Mule soft meetup Houston 16
Mule soft meetup Houston 16Mule soft meetup Houston 16
Mule soft meetup Houston 16
 
Melbourne Virtual MuleSoft Meetup December 2022
Melbourne Virtual MuleSoft Meetup December 2022Melbourne Virtual MuleSoft Meetup December 2022
Melbourne Virtual MuleSoft Meetup December 2022
 
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptxPrinceton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
Princeton-NJ-Meetup-Externalizing-Mule-logs-Azure-blog-storage.pptx
 
Service Engineering, ZHAW for CeBIT
Service Engineering, ZHAW for CeBITService Engineering, ZHAW for CeBIT
Service Engineering, ZHAW for CeBIT
 
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
OCCIware Year 1 Milestone: Docker Studio, Studio Factory, pluggable XaaS runt...
 
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
OCCIware Cloud Expo London 2016 - Docker Studio, Studio Factory, erocci bus &...
 
Mastering SCRUM & UCD
Mastering SCRUM & UCDMastering SCRUM & UCD
Mastering SCRUM & UCD
 
Implementing CloudHub 2.0 CI/CD Pipeline with Bitbucket Integration
Implementing CloudHub 2.0 CI/CD Pipeline with Bitbucket IntegrationImplementing CloudHub 2.0 CI/CD Pipeline with Bitbucket Integration
Implementing CloudHub 2.0 CI/CD Pipeline with Bitbucket Integration
 
Boek Presentatie
Boek PresentatieBoek Presentatie
Boek Presentatie
 
Eclipse Finance Day: Sirius for Finance
Eclipse Finance Day: Sirius for FinanceEclipse Finance Day: Sirius for Finance
Eclipse Finance Day: Sirius for Finance
 
London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023London-MuleSoft-Meetup-April-19-2023
London-MuleSoft-Meetup-April-19-2023
 

Dernier

WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 

Dernier (20)

WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
WSO2Con2024 - GitOps in Action: Navigating Application Deployment in the Plat...
 
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
WSO2Con2024 - From Blueprint to Brilliance: WSO2's Guide to API-First Enginee...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AIWSO2CON 2024 Slides - Unlocking Value with AI
WSO2CON 2024 Slides - Unlocking Value with AI
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 

Applying the Presentation Model Design Pattern in Qt

  • 1. Juan de Hoyos Zühlke Engineering GmbH Juan.dehoyos@zuehlke.com Applying the Presentation Model Design Pattern in Qt Style © Zühlke 2014 Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 1
  • 2. © Zühlke 2014 What makes an application awesome? Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 2
  • 3. What makes a graphical interface awesome?(*) © Zühlke 2014 1. Clarity 2. Concision 3. Familiarity 4. Responsiveness 5. Consistency 6. Aesthetics 7. Efficiency 8. Forgiveness (*) wikipedia:http://en.wikipedia.org/wiki/User_interface Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 3
  • 4. © Zühlke 2014 It’s not that easy • Complex UI: mix C++/QML/Javascript • Low degree of encapsulation • Where to place common functionality? • Widgets aware of domain layer • … Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 4
  • 5. © Zühlke 2014 Classical Layer architecture View Business logic Infrastructure • Display information • React to user actions • UI state • Data transformation • Domain rules • Data structures • Application state • Data Persistence • Networking • Etc. Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 5
  • 6. • UI state • Data transformation • Synchronize View and BL layers (*) http://martinfowler.com/eaaDev/PresentationModel.html © Zühlke 2014 Adding a new layer: Presentation Model* View Presentation Model Business logic Infrastructure Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 6
  • 7. © Zühlke 2014 Qt to rescue! What we want: to Pull the functionality out of view but still profit from QML/Javascript expressivity: • Keep the business logic in C++ • Write the model(s) in QML – Synchronize via Signal/Slots and property binding Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 7
  • 8. © Zühlke 2014 Example: Log viewer Display critical logs Display all logs Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 8
  • 9. View Presentation Model • Log to display • Filter button • Window title EventLogs.qml • List of logs • Current Filtering (state) EventLogsPM.qml Set Filter Model changed Visible logs QML Retrieve Logs C++ • Business Logic EventLogs.cpp Logs Logs Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 9 © Zühlke 2014
  • 10. © Zühlke 2014 Wrap up • In complex UIs pulling the presentation behavior out of the widgets pays off: Presentation Model Pattern. • This increases the complexity, specially by the synchronization of data. • Fortunately, Qt provides us features that make the synchronization easier: • Signal/Slots • Property binding • By using QML in the model we can benefit of a declarative approach. Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 10
  • 11. Thanks! Juan de Hoyos Zühlke Engineering GmbH Juan.dehoyos@zuehlke.com Applying the Presentation Model Design Pattern in Qt Style | Juan de Hoyos 30. September 2014 Slide 11 © Zühlke 2014

Notes de l'éditeur

  1. If we go out to the street and ask what’s makes an application really awesome, I’m sure most of the answer we get refer to the graphical interface: how fancy it is, colors? Touch, multi-touch? It’s fast or slow? That’s because the interface is the part of the software we see and touch. Software is immaterial, but the interface give us the possibility of trespassing that border and interact with devices. So, if we say the interface is was makes an application awesome, here is the next question: What makes a graphical interface awesome?
  2. If we go to the books (or wikipedia) we can see there is some guidelines about how a user interface should be. I would summarize it saying it has to be: Functional, easy to use and pretty. So that’s it! Well,.. It’s not that easy.
  3. All of us that had ever deal with the problem of programming a professional user interface have come across a bunch of technical problems: If we are developing in Qt – and most of us do, or we wouldn’t be here now- we have to deal with different languages, like C++ and QML. That’s not a problem by itself. On the contrary, it give us great flexibility. But there is some issues we can run into: Where to place common functionality? How to keep a clean separation between widgets (or QML component ) and our business logic?
  4. What we see in the slide is a classical architecture in layers of a application. It contains some infrastructure functionality in the lower layer. Here is the logic responsible for thing like persistence, networking, an so forth. In the middle we have the business logic. Here is where we place the internal data structures and the algorithms. Where we keep the consistency of the data. If a Model Driven Development, here is where we place the model. On top of that, the views. That’s the visible part. Where we display information and react to user actions. In those applications were the user interface plays a central role, the amount of code we need for fancy animations AND color transitions AND scrolling list AND transforming data for better display, etc., can lead to big, messy overweight views. Fortunately, there is a solution for this that has been around for a while: the Presentation Model
  5. The idea of the presentation model is adding a layer between views and business model and pull information out of the view in order to keep them thin and tidy. What can we move out of the view? Well basically the state and the routines for data manipulation. Advantages The model can be shared between several views. Common place for shared functionality. Models are usually easier to unit-test than views. Pull the state out of the widgets. Stateless views are easy to maintain. Let the model make the decision based on the state. But it also have disadvantages : We’re adding another level of indirection, which means more complexity. We need a way to keep the layers synchronized.
  6. Fortunately, there are some features in Qt we can use to make our live easier: We’ll keep the business logic in C++ and code the model in QML, because the model is closer to the views than to the layer underneath. However, we’ll use the Qt signals and slots as well as property binding to synchronize between layers.
  7. This is an example of a log viewer. The idea is quite simple: The window pops up and shows a list with the latest logs from the system. We have two kind of logs, critical –marked in red- and non-critical –in blue-. At the top we can choose to display all the logs, or just the critical ones. The amount of logs currently displayed is part of the main window’s title. A simple implementation could be having a main window with a ListView and getting the log from the system by asking the C++ classes in the business logic directly. Then, is up to the View to decide whether to show all the logs or just the critical ones, based on the status of the filter. For this simple application, that’s definitely good enough. But imagine a more complex context. Imagine the want to enable some functionality if critical logs are present. A view to report an incident, for instance. This second view must be aware of the filter status and have access to the logs in the ListView to in order to get the information to make the report. As you see, we can end up with high coupling between views. And that’s not a good design.
  8. Applying the Presentation Model to this problem can be something like this: We create 2 different QML components. The one in the left still has a ListView and a couple of buttons, but the state of the filter and what should be displayed whenever the filter changes, is up to the component in the right, which is the model. Basically we divide the responsibilities: The model decides the “what” to display, and the view the “how”. In this example, each time the model get new logs from the system emits a signal “Model Changed” and the view updates. In the other ways, when the filter changes the view updates the filter state in the model and retrieves the logs to display. The amount of logs displayed is a property of the model, and bound to the Main windows’ s title. So the QML engine takes care of the synchronization for us.