P
P
Prepod212020-11-17 23:29:25
Software design
Prepod21, 2020-11-17 23:29:25

How to properly organize the interaction of ui and business logic?

There is ui. Button and progress bar. By clicking on the button, a large number of files should be copied and the copy progress should be displayed.
Pressing the button calls the on_button_clicked() method, the method calls the FileCopier.copy_files() object method.
The dumbest thing you can do is call the parent progress bar update method in the copy_files() method.
How to smartly update ui progress bar from business logic?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ananiev, 2020-11-18
@SaNNy32

The copy_files() method should provide information on the progress of copying by calling a function (callback) or sending an event (event) (depending on the programming language)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question