Creating sequence diagrams in Eclipse
Posted on: 2012-08-24 09:55:45

Making sequence diagrams in Eclipse is easy, thanks to the ewsd plugin.

  1. Download the plug-in file
  2. Copy it to your eclipse plugins folder
Now inside eclipse, when you create any file ending in .wsd, you will be able to edit a sequence diagram. Just follow the simple syntax.

More...

Sequence Diagram for a Purchase Order
Posted on: 2012-08-23 16:39:45
The purchase order process is something that many small business will have to learn if they are supplying products to to a larger business. It is something that we at websequencediagrams.com are very familiar with. It is best illustrated with a sequence diagram below:


Click to edit on WebSequenceDiagrams.com

The important things to remember are:
  • The purchase order has a number on it. As a supplier, you have to reference this number in the subject line of all the emails and correspondence that you send to the buyer.
  • You can ship the products as soon as you receive the purchase order. It should be as good as cash, in that they are contractually obligated to pay you, someday.
  • Be sure to invoice right away. The purchase order might contain instructions on how to format the invoice and where to send it and such. ALWAYS INCLUDE THE PURCHASE ORDER NUMBER ON THE INVOICE.
  • Usually companies are pretty good at paying up, though they may be a few months late. If it's been a while, make sure you follow up.
  • European companies like to pay by bank transfers. Call your bank for the information that you need to give them.

Here's some more information on selling to large companies.

More...

How to make different arrows in WebSequenceDiagrams
Posted on: 2012-08-21 15:33:52
WebSequenceDiagrams is very flexible and makes creating sequence diagrams fast and easy. But it has a small learning curve. One of the stumbling blocks of new users is how to create dotted and filled arrows.

The most basic arrow type is the filled arrow.

A->B: Hello

The dotted arrow is often used to signify a result.
A->B: Hello
B-->A: Hi!

UML geeks will tease you if you don't make use of open arrows as well. Open arrows signify asynchronous operations.

A->>B: Hello, asyncronously!

More...

How does a web login work?
Posted on: 2012-08-21 15:14:22
Nowadays, logging in to a web site is almost mandatory. But it wasn't always so. It can help if you have an understanding of what is going on behind the scenes.

Why the complexity?

The background of it all is that when the web was designed, it was never intended to support logins. It was designed to support reading and linking together documents in universities. Information was freely available, and nobody thought that you'd have to sign in to use something. How quickly that changed! But it means today that logging in is a little more complex because the browser and the server have to remember things about each other. The server has to remember that you are logged in, and who you are, and the browser has to identifier itself to the server every time you click on a link.

Without further ado, here is a sequence diagram explaining how web login usually works.

You can make diagrams like this very easily on www.websequencediagrams.com.

More...

How to create sequence diagrams
Posted on: 2012-08-21 14:56:45

What is a sequence diagram?

Sequence diagrams are a part of UML that helps to explain the behaviour of a system. Here's a simple sequence diagram with two participants:

You read them from top to bottom. As time increases, you depict events happening in the system, and how various parts of the system react to each other.

Be aware, however, of people that abuse sequence diagrams. You can very easily confuse people if you try to describe how long things take in a sequence diagram. Some of the most confusing diagrams that I have ever seen were trying to describe the architecture of the system. Don't do that! Sequence diagrams can only describe behaviour.

Always be aware of the primary purpose of a sequence diagram -- to explain. Here is an example of how some explanatory text along the side can make sequence diagrams more clear.

Sequence diagrams like this can be produced very easily on websequencediagrams.com. Here is all you have to type to produce the diagram above.
title Drop shipping

 With drop shipping, the retailer takes orders
 from a customer, but leaves responsibility for
 for shipping to a wholesaler or producer.  

Customer->Retailer: Order
Retailer->Factory: Order detailsn and shipping address
Factory->Customer: Ships final product

option footer=none

More...

The SPDY protocol illustrated with diagrams
Posted on: 2012-07-26 21:21:24

Google is trying to make web browsers faster by inventing a new protocol called SPDY. The acronym doesn't mean anything, but it sounds similar to the word "speedy". SPDY has a few features to help download web pages faster, but it hides a lot of hidden complexity that implementors have to worry about.

The driving force behind SPDY is to save TCP setup time. Previously, to retrieve a web page, the browser would make a single connection to the web server. Then, it would request the resources one at a time. For example, it may first request the HTML page, then the scripts, and then the graphics. The problem is that the web server may take a long time to generate some parts of the web page, but it is able to serve other parts immediately. If the browser happens to request the slow parts first, all of the other resources on the web page will have to wait, and it will feel slower.

The new SPDY protocol is simply a way of allowing different resources to be sent over the same connection, in parallel. Here is how it works.

First, the browser opens a TCP connection to the server. This is when SPDY takes over, and where the first bit of complexity begins. Instead of sending an HTTP request, the browser will send a special control frame. SPDY is a framed protocol. That is, each message is prefixed by its length.

  +----------------------------------+
  |C| Version(15bits) | Type(16bits) |
  +----------------------------------+
  | Flags (8)  |  Length (24 bits)   |
  +----------------------------------+
  |               Data               |
  +----------------------------------+

The first bit of complexity then, is how the browser knows that it may use the SPDY protocol. Maybe it is talking to one of the millions of servers that do not speak SPDY. On the server side, the server must detect that the client supports SPDY. In the beginning of an HTTP connection, the first four bytes sent will always be "HTTP". With SPDY, they consist of the version and type. The server could, perhaps, assume that the client is using SPDY if the first message is a semantically valid SPDY message. In practice, however, connections are performed over SSL which includes a negotiation step for the type of connection to be used.

HELLO

At any time in the connection, either side may send the HELLO frame. The HELLO frame may contain four numbers:
  • uplink and downlink bandwidth,
  • maximum number of streams (which should be at least 100)
  • round trip time

However, finding out what these values are is difficult and unreliable. Your bandwidth could change from one moment to the next. At best, they are an approximation. No response is necessaryu for the hello packet.

PING

Either the server or the client may send a PING packet. Its payload is a 32-bit number, which is expected to be unique. Whenever the client or server receives the PING packet, it should echo it back as soon as possible, with a priority higher than all other activities. This helps in calculating the round trip time. However, there are some issues with this priority scheme. What seems to be a simple protocol becomes more complex, if both the client and server need to maintain separate queues of data to be sent, with different levels of priority.

SYN_STREAM

To create a stream, send SYN_STREAM control message. (This SYN_STREAM may also be used to half-close the stream) The syn_stream contains a stream id and compressed HTTP headers, and a flag indicating whether it is bidirectional or unidirectional. If it is bidirectional, the other party replies with a SYN_REPLY message, which can also contain headers.

Part of what makes SPDY speedy is that the headers are compressed. Although a general zlib compressor is used, it is initialized with a standardized string of text prior to compression. This text string contains many common HTTP headers so that it performs best when these are used.

How Data is transmitted

After a stream is setup, and if the stream does not have the FINAL flag, the sender transmits the rest of the data in DATA frames. The final data frame contains a FINAL flag. Although the stream is considered done, other streams may be started.

Ending the connection

Either side may end the TCP connection at any time. However, any active streams that have not been closed, by receipt of the FINAL flag, are deemed to be aborted.

Buffer Bloat, the enemy of SPDY

SPDY attempts to make browsing faster by allowing a single TCP connection to be multiplexed over different resources. However, a problem with this approach is that TCP is not designed to multiplex resources at different priority levels. Consider the case where the server is sending a large web page over a fast, but high-latency connection. During the download of the web page, the client notices that it must download some javascript to continue processing the page. However, due to the nature of TCP, although the client requests the javascript right away, it must download the entire web page before it begins to receive the script file. Here is a sequence diagram depicting this condition. We have used an additional participant in the diagram to show how the various servers buffer data and cause high latency.

The interesting thing is that if the browser had not used SPDY, and instead used an additional TCP connection to request the script file, it could have arrived much sooner. A single TCP connection is like highway that can clog up with traffic. All the cars ahead of you have to get to the end before you can. Having multiple TCP connections is like having an extra lane, over which higher priority traffic can arrive.

Perhaps servers can avoid this condition by carefully managing their transfer rate for all streams, and by assigning streams priorities and bandwidth. But this management comes at great complexity cost to what should be a simple protocol. Hence, implementers of have to deal with a lot of hidden complexity.

References

  1. Speedy Whitepaper
  2. Life beyond HTTP 1.1: Google's SPDY

More...

More Posts