4.2 Interacting Systems
a) Asynchronus and synchronus communication
Given are the following examples of communication. Decide for each one whether it is asynchronous, synchronous (real-world), synchronous (delivery-based), or synchronous (response-based)
- Calling the doctor to get information of your laboratory results.
- Sending an email.
- Sending a postcard to a distant relative who does not have a telephone and probably won't respond to it.
- Requesting the account balance on the website of your bank.
- Sending an email to a person who configured the mail service that it sends a delivery notification.
- Pinging another computer (or just an IP address) in your company's network.
- Sending a postcard to your grandmother, of whom you know that she will instantly call you after receiving the card.
b) Database system
Model the following scenario of a database system using a UML sequence diagrams.
Users can store and query any data in the database system. However, users cannot access the database directly but need to interact with an authentication service and a request service.
In order to access the database, a user first needs to log in to the authentication service, providing their user name and password. The authentication service checks both and informs the user whether the given inputs are accepted or not. If not, the user has two more tries to login. After the third incorrect attempt, their account is blocked.
If the login succeeded, the authentication service informs the request service that the login was successful and queries from the user may be accepted. Now, the user can interact with the request service. They can send as many requests as they want. Each of them is passed by the request service on to the database backend. After the database has handled the request, it sends the requested data back to the request service, which forwards it to the user.
Once the user has finished their work, they send a logout request to the authentication service, which in turn informs the request service that there will be no more requests by this user. The logout messages will be confirmed.