SlideShare a Scribd company logo
1 of 30
Reactive GUI Implemented in 
Clojure 
Denys Lebediev
Quick background
Traditional approach 
• Event Listener pattern 
• Widget model is mutable 
– Example: isPressed/setPressed 
• Widget state is mutable 
– Example: isEnabled/setEnabled
Traditional approach: problems 
• Complicated GUI containers (dialogs, wizards, 
etc) are often difficult to implement, support 
and extend. Why?
Traditional approach: problems 
• Obscuring the logic
Traditional approach: problems 
• Obscuring the logic 
– It may be unclear why the button is enabled and 
when it becomes enabled
Traditional approach: problems 
• Obscuring the logic 
– It may be unclear why the button is enabled and 
when it becomes enabled 
• Spreading the logic
Traditional approach: problems 
• Obscuring the logic 
– It may be unclear why the button is enabled and 
when it becomes enabled 
• Spreading the logic 
– The reasons for the button to be enabled tend to 
be spread across the application code
Traditional approach: problems 
• Obscuring the logic 
– It may be unclear why the button is enabled and 
when it becomes enabled 
• Spreading the logic 
– The reasons for the button to be enabled tend to 
be spread across the application code 
– Moreover with time
Traditional approach: problems 
• Incidental complexity 
– In fact, non-essential code has to be written 
– Developer has to bother deciding when 
– And spend time investigating another developer’s 
decisions 
• Automated testing is tricky 
– Robot-based testing
There is another way 
• The framework takes care of routine 
– It is already implemented and tested 
– Developer concentrates on essential application 
logic
There is another way 
• The framework takes care of routine 
– It is already implemented and tested 
– Developer concentrates on essential application 
logic 
• All logic about a single property in a single 
place
There is another way 
• The framework takes care of routine 
– It is already implemented and tested 
– Developer concentrates on essential application 
logic 
• All logic about a single property in a single 
place 
• Unit tests for code that manages widget 
model and state
Hello world with FlatGUI 
(defcomponent checkbox :say-hello {:text "Greeting"}) 
(def nogreeting-text "Greeting not provided") 
(def greeting-text "Hello, world!") 
(defevolverfn greeting-evolver :text 
(if (get-property [:say-hello] :pressed) 
greeting-text 
nogreeting-text)) 
(defcomponent label :greeting-label 
{:text nogreeting-text 
:evolvers {:text greeting-evolver}})
Hello world with FlatGUI 
(defcomponent checkbox :say-hello {:text "Greeting"}) 
(def nogreeting-text "Greeting not provided") 
(def greeting-text "Hello, world!") 
(defevolverfn greeting-evolver :text 
(if (get-property [:say-hello] :pressed) 
greeting-text 
nogreeting-text)) 
(defcomponent label :greeting-label 
{:text nogreeting-text 
:evolvers {:text greeting-evolver}})
Hello world with FlatGUI 
(defcomponent checkbox :say-hello {:text "Greeting"}) 
(def nogreeting-text "Greeting not provided") 
(def greeting-text "Hello, world!") 
(defevolverfn greeting-evolver :text 
(if (get-property [:say-hello] :pressed) 
greeting-text 
nogreeting-text)) 
(defcomponent label :greeting-label 
{:text nogreeting-text 
:evolvers {:text greeting-evolver}})
What’s the difference? 
• greeting-evolver is a single place for the logic of 
label’s :text property
What’s the difference? 
• greeting-evolver is a single place for the logic of 
label’s :text property 
• It contains the logic, not routine
What’s the difference? 
• greeting-evolver is a single place for the logic of 
label’s :text property 
• It contains the logic, not routine 
• It’s easy to troubleshoot
What’s the difference? 
• greeting-evolver is a single place for the logic of 
label’s :text property 
• It contains the logic, not routine 
• It’s easy to troubleshoot 
• It’s easy to cover with unit tests
What’s the difference? 
• greeting-evolver is a single place for the logic of 
label’s :text property 
• It contains the logic, not routine 
• It’s easy to troubleshoot 
• It’s easy to cover with unit tests 
• Developer does not have to decide when to call it
What’s the difference? 
• greeting-evolver is a single place for the logic of 
label’s :text property 
• It contains the logic, not routine 
• It’s easy to troubleshoot 
• It’s easy to cover with unit tests 
• Developer does not have to decide when to call it 
• Developer does not have to call it
What’s the difference? 
• Reactive framework takes care of these routine 
things 
– Implemented once, no need to solve similar problems 
again 
– Tested
FlatGUI architecture
Engine performs state transition
Option to run as RIA
Setup collaboration sessions
Clojure usage 
• Macros are nice 
– defining widget types and instances, property 
evolvers 
– Layout management, like “below” “to the right of” 
– Though IDE capabilities are still not enough 
• Had fun with profiler to tune engine 
performance 
– Introduced some non-idiomatic code
Current state of the project 
• This is a poof-of-concept implementation 
• What’s next 
– Publish sources 
– Prepare documentation and examples 
– Launch the website 
– Finalize the engine and basic widgets 
– Optimize network solution
info@flatgui.org

More Related Content

Viewers also liked

Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In PracticeMichiel Borkent
 
FlatGUI: Reactive GUI Toolkit Implemented in Clojure
FlatGUI: Reactive GUI Toolkit Implemented in ClojureFlatGUI: Reactive GUI Toolkit Implemented in Clojure
FlatGUI: Reactive GUI Toolkit Implemented in Clojuredenyslebediev
 
JavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.asyncJavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.asyncFalko Riemenschneider
 
JavaFX – 10 things I love about you
JavaFX – 10 things I love about youJavaFX – 10 things I love about you
JavaFX – 10 things I love about youAlexander Casall
 

Viewers also liked (6)

Functional Programming In Practice
Functional Programming In PracticeFunctional Programming In Practice
Functional Programming In Practice
 
Clojure - Why does it matter?
Clojure - Why does it matter?Clojure - Why does it matter?
Clojure - Why does it matter?
 
FlatGUI: Reactive GUI Toolkit Implemented in Clojure
FlatGUI: Reactive GUI Toolkit Implemented in ClojureFlatGUI: Reactive GUI Toolkit Implemented in Clojure
FlatGUI: Reactive GUI Toolkit Implemented in Clojure
 
JavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.asyncJavaFX GUI architecture with Clojure core.async
JavaFX GUI architecture with Clojure core.async
 
JavaFX – 10 things I love about you
JavaFX – 10 things I love about youJavaFX – 10 things I love about you
JavaFX – 10 things I love about you
 
JavaFX Pitfalls
JavaFX PitfallsJavaFX Pitfalls
JavaFX Pitfalls
 

Similar to Reactive GUI Implemented in Clojure

Staging and Deployment
Staging and DeploymentStaging and Deployment
Staging and Deploymentheyrocker
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...SQALab
 
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Fwdays
 
Guide to Destroying Codebases The Demise of Clever Code
Guide to Destroying Codebases   The Demise of Clever CodeGuide to Destroying Codebases   The Demise of Clever Code
Guide to Destroying Codebases The Demise of Clever CodeGabor Varadi
 
Store Beyond Glorp
Store Beyond GlorpStore Beyond Glorp
Store Beyond GlorpESUG
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST Huddle
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedAlexander Makarov
 
Deployment is the new build
Deployment is the new buildDeployment is the new build
Deployment is the new buildAndrew Phillips
 
How to crack java script certification
How to crack java script certificationHow to crack java script certification
How to crack java script certificationKadharBashaJ
 
Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics 丈 宮本
 
Application Deployment at UC Riverside
Application Deployment at UC RiversideApplication Deployment at UC Riverside
Application Deployment at UC RiversideMichael Kennedy
 
Development Environment Tips
Development Environment TipsDevelopment Environment Tips
Development Environment TipsAdam Culp
 
Alm with tfs 2013
Alm with tfs 2013Alm with tfs 2013
Alm with tfs 2013MSDEVMTL
 
Neo4j Training Cypher
Neo4j Training CypherNeo4j Training Cypher
Neo4j Training CypherMax De Marzi
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchHoward Greenberg
 

Similar to Reactive GUI Implemented in Clojure (20)

Staging and Deployment
Staging and DeploymentStaging and Deployment
Staging and Deployment
 
Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...Generalization in Auto-Testing. How we put what we had into new Technological...
Generalization in Auto-Testing. How we put what we had into new Technological...
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
Алексей Ященко и Ярослав Волощук "False simplicity of front-end applications"
 
Guide to Destroying Codebases The Demise of Clever Code
Guide to Destroying Codebases   The Demise of Clever CodeGuide to Destroying Codebases   The Demise of Clever Code
Guide to Destroying Codebases The Demise of Clever Code
 
Store Beyond Glorp
Store Beyond GlorpStore Beyond Glorp
Store Beyond Glorp
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Devconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developedDevconf 2011 - PHP - How Yii framework is developed
Devconf 2011 - PHP - How Yii framework is developed
 
JavaFX 101
JavaFX 101JavaFX 101
JavaFX 101
 
Deployment is the new build
Deployment is the new buildDeployment is the new build
Deployment is the new build
 
How to crack java script certification
How to crack java script certificationHow to crack java script certification
How to crack java script certification
 
Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics Short Introduction of software engineering for bioinformatics
Short Introduction of software engineering for bioinformatics
 
Application Deployment at UC Riverside
Application Deployment at UC RiversideApplication Deployment at UC Riverside
Application Deployment at UC Riverside
 
Development Environment Tips
Development Environment TipsDevelopment Environment Tips
Development Environment Tips
 
Alm with tfs 2013
Alm with tfs 2013Alm with tfs 2013
Alm with tfs 2013
 
rsyslog meets docker
rsyslog meets dockerrsyslog meets docker
rsyslog meets docker
 
Agile
AgileAgile
Agile
 
Neo4j Training Cypher
Neo4j Training CypherNeo4j Training Cypher
Neo4j Training Cypher
 
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
 

Recently uploaded

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 

Recently uploaded (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 

Reactive GUI Implemented in Clojure

  • 1. Reactive GUI Implemented in Clojure Denys Lebediev
  • 3. Traditional approach • Event Listener pattern • Widget model is mutable – Example: isPressed/setPressed • Widget state is mutable – Example: isEnabled/setEnabled
  • 4. Traditional approach: problems • Complicated GUI containers (dialogs, wizards, etc) are often difficult to implement, support and extend. Why?
  • 5. Traditional approach: problems • Obscuring the logic
  • 6. Traditional approach: problems • Obscuring the logic – It may be unclear why the button is enabled and when it becomes enabled
  • 7. Traditional approach: problems • Obscuring the logic – It may be unclear why the button is enabled and when it becomes enabled • Spreading the logic
  • 8. Traditional approach: problems • Obscuring the logic – It may be unclear why the button is enabled and when it becomes enabled • Spreading the logic – The reasons for the button to be enabled tend to be spread across the application code
  • 9. Traditional approach: problems • Obscuring the logic – It may be unclear why the button is enabled and when it becomes enabled • Spreading the logic – The reasons for the button to be enabled tend to be spread across the application code – Moreover with time
  • 10. Traditional approach: problems • Incidental complexity – In fact, non-essential code has to be written – Developer has to bother deciding when – And spend time investigating another developer’s decisions • Automated testing is tricky – Robot-based testing
  • 11. There is another way • The framework takes care of routine – It is already implemented and tested – Developer concentrates on essential application logic
  • 12. There is another way • The framework takes care of routine – It is already implemented and tested – Developer concentrates on essential application logic • All logic about a single property in a single place
  • 13. There is another way • The framework takes care of routine – It is already implemented and tested – Developer concentrates on essential application logic • All logic about a single property in a single place • Unit tests for code that manages widget model and state
  • 14. Hello world with FlatGUI (defcomponent checkbox :say-hello {:text "Greeting"}) (def nogreeting-text "Greeting not provided") (def greeting-text "Hello, world!") (defevolverfn greeting-evolver :text (if (get-property [:say-hello] :pressed) greeting-text nogreeting-text)) (defcomponent label :greeting-label {:text nogreeting-text :evolvers {:text greeting-evolver}})
  • 15. Hello world with FlatGUI (defcomponent checkbox :say-hello {:text "Greeting"}) (def nogreeting-text "Greeting not provided") (def greeting-text "Hello, world!") (defevolverfn greeting-evolver :text (if (get-property [:say-hello] :pressed) greeting-text nogreeting-text)) (defcomponent label :greeting-label {:text nogreeting-text :evolvers {:text greeting-evolver}})
  • 16. Hello world with FlatGUI (defcomponent checkbox :say-hello {:text "Greeting"}) (def nogreeting-text "Greeting not provided") (def greeting-text "Hello, world!") (defevolverfn greeting-evolver :text (if (get-property [:say-hello] :pressed) greeting-text nogreeting-text)) (defcomponent label :greeting-label {:text nogreeting-text :evolvers {:text greeting-evolver}})
  • 17. What’s the difference? • greeting-evolver is a single place for the logic of label’s :text property
  • 18. What’s the difference? • greeting-evolver is a single place for the logic of label’s :text property • It contains the logic, not routine
  • 19. What’s the difference? • greeting-evolver is a single place for the logic of label’s :text property • It contains the logic, not routine • It’s easy to troubleshoot
  • 20. What’s the difference? • greeting-evolver is a single place for the logic of label’s :text property • It contains the logic, not routine • It’s easy to troubleshoot • It’s easy to cover with unit tests
  • 21. What’s the difference? • greeting-evolver is a single place for the logic of label’s :text property • It contains the logic, not routine • It’s easy to troubleshoot • It’s easy to cover with unit tests • Developer does not have to decide when to call it
  • 22. What’s the difference? • greeting-evolver is a single place for the logic of label’s :text property • It contains the logic, not routine • It’s easy to troubleshoot • It’s easy to cover with unit tests • Developer does not have to decide when to call it • Developer does not have to call it
  • 23. What’s the difference? • Reactive framework takes care of these routine things – Implemented once, no need to solve similar problems again – Tested
  • 25. Engine performs state transition
  • 26. Option to run as RIA
  • 28. Clojure usage • Macros are nice – defining widget types and instances, property evolvers – Layout management, like “below” “to the right of” – Though IDE capabilities are still not enough • Had fun with profiler to tune engine performance – Introduced some non-idiomatic code
  • 29. Current state of the project • This is a poof-of-concept implementation • What’s next – Publish sources – Prepare documentation and examples – Launch the website – Finalize the engine and basic widgets – Optimize network solution