JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model...

33
JavaFX Straight from the trenches

Transcript of JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model...

Page 1: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

JavaFX

Straight from the trenches

Page 2: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

WANTED

Braz, Anderson

Software Engineer

Java Man since 2000, postgradute, open

source advocate, speaker and training

consultant

mrbraz mrbrazjava

Page 3: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

You cannot love what

You cannot understand

Page 4: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Dependecy Injection

Page 5: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Make it easy to create

conventions

Page 6: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 7: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Event streams

Page 8: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Decouple object

communication

Page 9: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 10: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 11: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 12: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Multithreading

Page 13: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Immutability

The simplest way to avoid problems with

concurrency

Page 14: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 15: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Defensive copy

To protect your class against that you should copy

data you receive and only return copies of data to

calling code.

Page 16: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 17: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 18: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

JavaFX Thread

Command Thread

Background Thread

UI Controls

Page 19: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

java.lang.IllegalStateException:

Not on FX application thread

Page 20: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Platform.runLater()

Page 21: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 22: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Model-View-Presenter

Page 23: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Presenter is the guy

Knows everything about the Model and View contracts

and coordinates the communication between them

Page 24: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 25: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

View is the User Interface

Everything that interacts with the user to

maintain the Subject up to date

Page 26: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 27: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Model is the Subject

Business Domain, Business Data, Meta Data,

Conceptual Objects, etc

Page 28: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 29: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

Easy to test

Model-View-Presenter is the design created to make

it easy to create testable User Interfaces and the

behaviours associated with it.

Page 30: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 31: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User
Page 32: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

MVP: A true revelation

I developed this presentation using MVP design

Page 33: JavaFX - Oracle CloudModel-View-Presenter . Presenter is the guy Knows everything about the Model and View contracts and coordinates the communication between them . View is the User

WANTED

Braz, Anderson

Software Engineer

Java Man since 2000, postgradute, open

source advocate, speaker and training

consultant

mrbraz mrbrazjava

ReactiveFX

An open source solution that

illustrates the use of topics

discussed in this presentation.

Find it on github