BISW GUI Workshop 13122018 Iason Dimitrios Rodis 2
BISW GUI Workshop 13/12/2018 Iason Dimitrios Rodis 2
GUI Development Patterns • Model-View-Controller • MVC design pattern divides an application into three major aspects: Model, View, and Controller. Model • A collection of classes + Business Logic • View • UI Components • Monitors the model for any state change • Controller • Mediator between the View and the Model • Processes incoming requests • 3
GUI Development Patterns • Model-View-Presenter • It is derived from MVC pattern, wherein the controller is replaced by the presenter. This pattern divides an application into three major aspects: Model, View, and Presenter. Model • A collection of classes + Business Logic • View • UI Components • No logic implemented. • Presenter • Receives the input from users via View • Processes Data Through Model • Returns data to view • 4
GUI Development Patterns • Model-View. Model • Supports two-way data binding between View and View-Model. Generally, the View-Model utilizes the observer pattern to inform changes in the View-Model to the Model. • View. Model View has a reference to View-Model • View-Model has no information about the View. • There is many-to-one relationship between View and View -Model means many Views can be mapped to one View. Model. It is completely independent of Views. • 5
GUI Development Patterns • Observer Pattern • The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. • Java. FX Properties are examples of Observer Pattern through binding. • Benefits: • Loosely coupled components 6
GUI Development Patterns 7
GUI Development - Java Swing • PROs • Ready to use Components (Dataviewer, Timing. Pane, Console etc) • Section Expertise • Dev. Ops (artifactory, maven, CBNG) • CONs • To be removed from the JDK • Old look & feel • Broken Components • No Bidirectional Binding 8
GUI Development - Py. QT • PROs • Less code • Rapid Development (? ) • Freedom for the developer • CONs • TN has no Internet Access • Slow • No Expertise • Too much freedom for the developer • No Bidirectional Binding • Py. Qt conventions != PEP 8 9
GUI Development Templates • Py. Qt • Simple Form • Example Py. Japc (Get, Subscribe) • Tab based • Programmatic • Qt Creator based • https: //gitlab. cern. ch/bisw-python/python-template • Big thanks to BI-BL Andreas Alexopoulos! • Swing • Using BISW Components • Timing. Pane • Console • Plain project • https: //gitlab. cern. ch/bisw-java-fwk/swing-archetype-template • https: //wikis. cern. ch/display/BISW/Create+new+Java+Swing+Project 10
Thank you!
- Slides: 11