Decoupling Flashcards
What are some elements used in networking to make it as decoupled as possible?
- MessageHandler interface
- Communicator interface
How does MessageHandler aid in decoupling?
It allows the existance of multiple handling possibilities for the messages. This way networking is decoupled from the functionality of handling a message.
How does Communicator aid in decoupling?
Allows the MessageHandler implementation to use a communicator instead of a client. This way the functionality of handling a message is decoupled from networking.
What does synchronous mean in this context?
Sth is synchrounous when it executes only one thing at a time.
What does blocking mean in this context?
Whenever you call a method,
your program will only continue after that method has fully completed its operations/computations.
What is mocking used for?
To fake the functionality of dependencies that would be too complicated to create. Any class or interface can be mocked.
How does mocking work?
Essentially mocking a class/interface mean creating a stub implementation. The created object and the associated methods can be used without actually providing an implementation.
How to use mocking for a method that returns something?
You have to specify what the mocked object should return by using the when().thenReturn(); method
What is busy waiting?
ex: while(!operationComplete)) Note that there is no body to this while loop. Busy waiting is a process synchronization technique in which a process/task waits and constantly checks for a condition to be satisfied before proceeding with its execution. It is not ideal because we are wasting CPU cycles by continuously checking whether the condition is true.
How can busy waiting be prevented?
By using awaitility. It doesn’t suffer from busy waiting since it will only periodically check for the condition.
What is the difference between verify method and thenReturn method in mocking?
The verify method checks if the specific method was called at all while the thenReturn method allows us to check the behavior of a method by checking if it returns as expected.
What is the Corrective Software Maintenance and what is the order in which the phases happen?
This type of maintenance corrects the defects, errors, faults and the order is: implement, test, release.
What is the Perfective Software Maintenance and what is the order in which the phases happen?
This type of maintenance adds features to improve features for user experience and the order is: requirements, design, implement, test, release.
What is the Adaptive Software Maintenance and what is the order in which the phases happen?
This type responds to changes in environment/context. The order is: design, implement, test, release
What is the Preventive Software Maintenance and what is the order in which the phases happen?
This type improves software to reduce risk of deterioration. The order is: design, implement, test, release.