Sunday 17 November 2013

Hunger turns into a Sequence Diagram

I woke up in the middle of the night and felt hungry. Everyone at home was sleeping. It was too late to wake my Mom up. So I got out of my bed and searched the fridge and guess what that was my lucky day I found 2 pieces of Pizza in the fridge. I went to the kitchen to heat up my food in the microwave oven. I started the oven and those 3 minute time seemed like an hour at that time so I started thinking about my day and the thoughts came to my Software engineering class ..Ahh Sequence diagram.. and  I started relating microwave to the sequence diagram.
I am hungry Person I put the food in oven and oven does to functions simultaneously (parallel ) that are rotating the food and nuking the food. And then the microwave rung... Tringgg there came my tasty Hot Pizza microwave returned  yummy food to  that hungry person.
This is I guess the simplest example of Sequence Diagram.

Eating Pizza was the best part :D
There are different type of system models.Sequence Diagram can be considered as interaction model.

8 comments:

  1. Sequence Diagrams are part of UML diagrams. They comes under Interaction model because they show the interaction and transaction between different entities.The arrowhead taking the message will point towards the receiver and away from the sender. The arrow returning the output will point towards the sender(of the command).The returning arrow is a dotted line.
    Because I am a big fan of food here is an Example of Sequence Diagram:
    https://drive.google.com/file/d/0B2tAqelZWKHyVlBlNWdST1FfSTQ/edit?usp=sharing
    The customer,waiter and chef are three entities.
    Customer will order food to the waiter.
    Waiter immediately serve the water and plates and order food to the chef.
    Chef returns cooked food to waiter.
    Waiter Serve that food to the customer.
    Customer will pay to the waiter.

    ReplyDelete
  2. That was a pretty good example.It made me understand well the purpose of making these diagrams.But I'm confused at one thing.Why the life line of the customer gets finished as he is served with water.Shouldn't it remain activated for the whole process.?

    ReplyDelete
    Replies
    1. I guess we can do it that way as well I have considered serving water and serving food two different instance.

      Delete
    2. We are working on another post related to Sequence Diagrams to make things clear.

      Delete
    3. This comment has been removed by the author.

      Delete
    4. actually wahan pe object destroy ho k naya object bana hai to call order food wala function

      Delete
  3. your blog is an appetizer :P. its great to read :). there is a confusion with the ececution time. i dont understand why the execution time for rotate food is drawn on the execution time of cookfood() function call. please help. :)

    ReplyDelete
  4. that is parallal programming
    Jub parallal ma do task ho rae hon with in a function to un ko aise represent krty hain

    ReplyDelete