December 2006
Monthly Archive
Monthly Archive
Posted by Aurelio Pascual on 14 Dec 2006 | Tagged as: Java
A software application’s main goal is to provide the user with a reliable, useful, and correct experience. However, as software grows overtime, so does complexity, and this leads to a variety of problems that could affect the reliability and performance of the application. The growth in complexity does not only refer to the lines of code but also includes the hardware. Design patterns address these software and hardware issues. Design pattern, by definition, is a repeatable solution for a commonly-occurring software problem, and they all came from developers and architects who have years of experience dealing with these software problems. But before we dive-in to the common design patterns being used today, let us discuss first the software requirements that these design patterns addresses. These are called the software “ilities”.
The items discussed above are called the “non-functional” requirements of software. These requirements will be easily met using design patterns. Continue Reading »
Comments Off
Posted by Bobby Corpus on 10 Dec 2006 | Tagged as: Performance
Have you ever notice how various establishments make people line in a certain way? Have you gone to a bank and noticed a number of tellers servicing each client but there is only one line? Wouldn’t it be more natural to let people line up before each teller like you see in a grocery? The way customers are lined up in a server or system of servers is called Queueing Discipline.
In this article, we will learn how various queuing disciplines will affect the values of the performance metrics. We will use continuous markov chain analysis that we learned in the last article.
Motivating Scenario
Assume that the counter of a certain fast food store is arrange in a 2-stage way. The customers first place their order in counter 1, pays the cashier and proceeds to counter 2 to wait for their order to be picked up. Let
be the rate at which customers arrive,
the rate at which customers places their order and also the rate at which they leave the second counter. Let us draw the markov chain diagram of this system.
Each state is described by two numbers. The first number refers to the number of customers in the first counter. The second number refers to the number of customers waiting at the second counter. For example, state 00 mean that there are no customers being serviced. State “12″ mean that one customer is in counter 1 and 2 customers in counter 2. The blue arrows represent arrivals at rate a and red arrows are represent the rate of customers going to counter 2 and those leaving the counter 2.

Let us examine the four states in the diagram below. There is a blue arrow from state “00″ to state “10″ because when the first customer arrives, the first station will have 1 customer but no one in line yet in counter 2. This means that when the first customer arrives, the system will be in state “10″. There is an arrow from state “10″ to “01″. The means that the first customer is already in counter 2 to pickup his/her order but no new customer has arrived yet. There is a red arrow from state “01″ to “00″. This means that the single customer has already picked up his/her food and has left leaving the system with no customers at both stations. Notice that there is no arrow from state “10″ to “00″ because the customer who is in counter 1 cannot just leave the system but has to go to counter 2 before leaving.

. This is equal to the flow going out of state “00″ to state “10″: a*P00. Therefore,we have,

Doing this for all states, we get the following balance equations:


Solving for the probabilities using elementary algebra, we get the following:

A simple Example
Suppose that customers arrive on the average of 1 customer per minute and can place and pay for their order in 2 minutes. After that they wait on the average of 2 minutes at the second counter to take out their order. Using the formula above, we have
and
. We can now solve for the probabilities by substituting these values to the above formula.

Computing the rest of the values, we get the following table:
| P00 | 4/13 |
| P01,P10 | 2/13 |
| P02,P11,P20 | 1/13 |
| P03,P12,P21,P30 | 1/26 |
We can compute for the Utilization of the first counter by using it’s idle time. Notice that the first counter does not have anything to do when there are no customers lining in front of it. This happens in states P00, P01, P02 and P03. Notice that these states have the first number equal to 0 (which means: no customer in that counter). Therefore, the utilization is equal to 1 minus the idle time of counter 1, i.e,

Using the Utilization law we learned in a previous article, we can compute the throughput of counter 1 to be:

This happens to be the system throughput also since each customer will visit a counter only once per transaction.
Now that we know how to model using markov chains, in the next article, we will analyze other queueing disciplines and compare them according to throughput and response time.
Comments Off
Posted by Clint Barbosa on 03 Dec 2006 | Tagged as: Articles
AJAX is perhaps one of the hottest buzzwords in web development. I first saw AJAX in action in google mail. When I clicked one of my emails, only the bottom pane refreshed and displayed the email content. I was really amazed and instantly thought of the person who invented this technique.
According to mr. wickipedia “The first use of the term in public was by Jesse James Garrett in February 2005. Garrett thought of the term while in the shower, when he realized the need for a shorthand term to represent the suite of technologies he was proposing to a client.”
So what does Ajax mean? Its not a brand of soap which we are all familiar with. AJAX stands for “Asynchronous JavaScript and XML” . The word “Asynchronous” means irregular or not synchronized. In computer communications, the term is usually applied to data transmitted irregularly rather than as a steady stream. Meaning it has a lot more to do with user interaction. As another example, consider a telephone and a ham radio. The telephone is asynchronous because you can talk whenever you like even when the other party is talking. However, when using the ham radio, you need to wait for the other party to stop speaking or to release the talk button before you can get the chance to talk again. The operation of a ham radio is said to be synchronized.
In an Ajax application the same thing happens with your page. You can see the result of a certain pane or region you want to see in your page without refreshing the whole page. A good example would be a simple text box name lookup. Whenever you type an entry, the page refreshes only that part which shows the relevant information. This information is dynamically retrieve by the page from the server.
It is easy to see that AJAX saves you a lot of bandwidth because you only download the data that changes and not the whole page. Furthermore, the web UI becomes more responsive as you don’t have to wait a long time for that part to refresh as compared to the whole page being refreshed.
However, AJAX is a new technology and as such is not supported in older browsers. It is supported only IE version 6 and the latest versions of Mozilla. Also, different browsers have some slightly different implementations of AJAX, so whenever you develop in AJAX, you should tailor it to the browser used by the user. AJAX also breaks the back button support: data is reset when the back button is pressed.
AJAX is a simple yet extremely powerful technology. With a little creativity, you can already do a lot to make your page highly interactive. To see how simple AJAX is, see the sample code below.
You only need to know one Javascript object, namely the XMLHttpRequest. To send a request, you specify the request method and the path relative to the server. The third parameter to the “open” method is a Boolean to specify whether the request is asynchronous or not. You should specify “true” for this parameter. When the server response is received, you can get the response as a string from the req.responseText variable.
Comments Off