- OOP in WinJS #1: Namespaces
- OOP In WinJS #2: Nested Namespaces
- OOP in WinJS #3: Classes
- OOP In WinJS #4: Inheritance
- OOP in WinJS #5: Encapsulation
In this article, I'll be speaking about real world events and uses in programming.
Programming World
Let's give some example in programming world:
- Facebook's Messaging System: If they hadn't added async operations,we wouldn't chat while navigating through the news feed.
- Facebook's Notification System: While exploring through website and at the same time reading notifications (friend requests,comments,likes,messages).
- Skype's Notification System: While talking to someone and receiving messagesat the same time without affecting the quality of call.
- WhatsApp's Notification System: While messaging to someone, and another friend(s) chat with you
If there weren't async operations in tese popular websites/apps, the UI thread would lock up until the job ended which is really bad.
Real World Events
- Would you rather be taken care of by a single doctor in a hospital or by many? Think about all the other patients.
- Would you like to wait for the previous customer to finish his/her order or instead would you like to give order as well in the meantime?
- Would you like to wait for the taxi station to send you an available car or would you like to look for the nearest taxi to take you asap?
Ever realized async programming was created by real world examples?
Lets take Starbucks for example:
You enter the Starbucks and make an order of your favorite beverage.

You place your order and choose your payment option and the cashier puts that order in the queue by marking an empty cup with your name on it.
Later the other people responsible for brewing fill the cup and call your name out.When you get the cup you get out of the queue and another individual comes after you and on and on. It keeps going...
Now, If you think of the cashier as UI thread, you shall see that it never stops flowing,it never hangs.The process keeps going.
Lets take Starbucks for example:
You enter the Starbucks and make an order of your favorite beverage.

You place your order and choose your payment option and the cashier puts that order in the queue by marking an empty cup with your name on it.
Later the other people responsible for brewing fill the cup and call your name out.When you get the cup you get out of the queue and another individual comes after you and on and on. It keeps going...
Now, If you think of the cashier as UI thread, you shall see that it never stops flowing,it never hangs.The process keeps going.


Vignesh ManiPosted May 10, 2016, 8:31 AM
Nice