Chapter 1: Fundamentals Flashcards
What distinguishes applications with a GUI from applications without a GUI?
App without GUI is an app with a sequence of instructions that is executed and then the program stops.
App with GUI is an app where the execution of various parts of the code depends on events generated by the user with different steps which can occur in any order.
What kind of events can be generated by a user?
Events generated by user:
- touchpad
- keystroke
- mouse clicks
- input via sensors
- voice commands
What is a Thread?
Threads are used to execute code in parallel. An app with a GUI has a main thread dedicated to the UI and has parallel worker threads that take care of time-consuming tasks, so that the UI remains responsive.
What is the difference between a Thread and a Process?
Processes have their own separated memory space, while threads share the same memory space. A particular object can be accessed in multiple threads.
What does an event source do?
Event source informs the registered listeners each time an event occurs.
How do event sources and listeners interact?
Interested objects register as listeners to an event source.
Event source informs the registered listeners each time an event occurs.
What is the role of a listener?
Listener is an object that keeps receiving and reacts to information about an event and when the event occurs at the source object (click, key press, actions…).
What are typical tasks of the main UI loop?
Paints windows, handles events (e.g mouse clicks) and call methods, if necessary, execute scheduled custom code.
Which operations do not belong in the main UI loop?
Time consuming tasks like file download and lengthy computation.
What is the MVC model?
Model-View-Controller paradigm is used to separate the data from its representation and from the actions that are triggered by the user.