In: Computer Science
Draw two Sequence diagrams (by hand, or by tools)
1. Draw (by hand or tool) the sequence diagram for a typical drive through restaurant protocol (choose as the 3 actors the driver who is ordering, the window attendant, and the cook).
2. Draw (by hand or tool) the sequence diagram for a typical web connection between your laptop as a client and a remote web server after you have typed a URL into the browser (you do not have to draw all the intermediate switches, routers, and firewalls), but do include DNS, HTTP, and TCP interactions.
1.) In the sequence diagram customer is the actor as well as cook and window attendant. Customer first ask for items to enquire about availability. Window attendant in turn ask cook for item availability and cook reply with yes or no. When cook reply with yes then window attendant reply the customer with yes and then customer places an order. Then the window attendant passes the order to the cook. Cook prepares the item and passes it back to the window attendant. Window attendant delivers the item to the customer and customer eat the food. After eating customer makes payment and window attendant process the payment and prepare bill. At last, the customer receives the bill.
In second case when the item is not available with the cook he replies a no to the window attendant and in turn window attendant reply a no to the customer and the diagram ends
2.) In the sequence diagram there are three actors named client, DNS server and web server. Client make a DNS request with the domain name of web address first to the DNS server and then the DNS server can reply in two ways. In first case, DNS server can reply with the IP address and then the client start a TCP connection to the web server. At this time, the lifeline of web server start. First, client send a TCP request and web server reply with acknowledgement and send a synchronisation request to which in turn, client reply back with the acknowledgement. After this process, client send http request to the web server and server process the request and reply with HTML, JavaScript and css pages. In the second case when DNS server reply with no IP address found, the connection terminates here and sequence diagram ends.