<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2892701085334104567</id><updated>2024-09-01T11:36:44.124+05:30</updated><category term="singleton"/><category term="singleton pattern"/><category term="API"/><category term="Abstract Programming Interface"/><category term="Architexa"/><category term="Checked Exception"/><category term="Checked vs Runtime Exception"/><category term="Checked vs unchecked exception"/><category term="Class diagram"/><category term="JMeter"/><category term="Java Process"/><category term="Java Thread"/><category term="Manual dependency injection"/><category term="PYPL"/><category term="Process vs Thread"/><category term="Programming language popularity"/><category term="Programming language rank"/><category term="RedMonk"/><category term="Thread vs Process"/><category term="Time series"/><category term="UML"/><category term="What is Process"/><category term="analytics"/><category term="comparison between toArray"/><category term="dependency injection"/><category term="designing"/><category term="diff between toArray"/><category term="eclipse plugin"/><category term="gui load testing"/><category term="gui traffic testing"/><category term="java"/><category term="jmeter trouble shoot"/><category term="layered diagram"/><category term="sequence diagram"/><category term="singleton anti pattern"/><category term="singleton dependency injection"/><category term="singleton disadvantage"/><category term="singleton global access"/><category term="singleton global state"/><category term="singleton global variable"/><category term="singleton vs static"/><category term="static"/><category term="static class"/><category term="static method"/><category term="tiobe"/><category term="toArray()"/><category term="toArray(T[])"/><category term="wildfly"/><category term="wildfly-8"/><title type='text'>Death By Code</title><subtitle type='html'>We try to put our thoughts as well as our understandings/findings on software development in this blog</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-719443806304303956</id><published>2016-05-26T06:47:00.000+05:30</published><updated>2016-05-26T07:17:44.636+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="analytics"/><category scheme="http://www.blogger.com/atom/ns#" term="Time series"/><title type='text'>My Notes On Time Series</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 6pt; margin-top: 18pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 21.333333333333332px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Time Series &lt;/span&gt;&lt;/h2&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Data set for which time lies in one of the axis is known as time series. Most of the economical data, meteorological data is an example of time series. Time series is related to two types of processes:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Continuous : Data/Process which always exists. For example, temperature. Temperature is measured at discrete intervals, i.e., discrete samples are being generated from a continuous data. &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Discrete : Process which occurs only at discrete points of time. Probability of occurring of that incident between two discrete points is zero. For example the closing value of sensex. Another example could be number of customers visiting a bank everyday. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;color: #434343; font-family: &amp;quot;arial&amp;quot;; font-size: 18.666666666666664px; white-space: pre-wrap;&quot;&gt;Autocorrelation for Time Series&lt;/span&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Comparing Y&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 10.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;t &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(the observation at time t) with Y&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 10.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;t-1 &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;(the observation at time t-1) gives an idea about the relationship between consecutive observations. In this case, the observation Y&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 10.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;t-1 &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;is described as “lagged” by one period. Similarly, it is possible to compare observations lagged by two periods, three periods and so on. The relationship between two observations can be measured by calculating the autocorrelation between the series lagged by 1, 2, 3,... periods. &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;margin-left: 0pt;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;154&quot;&gt;&lt;/col&gt;&lt;col width=&quot;133&quot;&gt;&lt;/col&gt;&lt;col width=&quot;139&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Actual Time Series&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Time Series lagged by 1 period &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Time Series lagged by 2 period&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;10&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Correlation can be computed between column 1 and column 2 as if they were two separate series. However, since they are one and the same series (with a lag of 1 period), it is called autocorrelation. The autocorrelation can be plotted against the lags (lagging by one, two, three,.... periods) to form autocorrelation function (ACF) and the plot is called correlogram. This is a standard process in exploring a time series. It provides a useful information for seasonality, trend-cyclicity etc. An example could be found &lt;/span&gt;&lt;a href=&quot;https://www.otexts.org/fpp/2/2&quot; style=&quot;text-decoration: none;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #1155cc; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;. &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;beeracf.png&quot; height=&quot;259&quot; src=&quot;https://lh3.googleusercontent.com/XiHIcedC--G18-RBq-4d7M9SiumTUC-6YNhf64adHFWVKTdYrFcx9woOkZqVkQ-tQm5N6rbBYEqRIvY-1Z5fwjpnQp4c6bVCVrFhhXFSbu6Yyx1xMEPenKjC-bo3yaZvW-uK9KRo&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;421&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Here, autocorrelation at lag 4 is higher than other lags. This indicates seasonality.&lt;/span&gt;&lt;/div&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #434343; font-family: &amp;quot;arial&amp;quot;; font-size: 18.666666666666664px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Time Series Components&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Decomposition methods (discussed in the next section) assume that data consists of following components:&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Trend : On a long term if the data series increases or decreases. For example, the population of India is increasing over time. &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Seasonal : Periodic fluctuations of constant length caused by the time of the year, temperature, rainfall, corporate policies etc. For example, demand for the warm clothes in India.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Cyclic : This component is measured over a long time duration (one year or longer). For example, buying or selling of property is controlled by the economic recession cycle. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Many decomposition techniques considers trend and cyclic as a single component, known as trend-cycle.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li dir=&quot;ltr&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: decimal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Irregular/randomness/error : Along with one or more of the above patterns, data consists of randomness or errors. This part is completely unpredictable. For example, impact of sudden rainfall, earthquake or political disturbance. &lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Decomposition methods tries to analyze each of the components individually. It first removes the seasonal component. Then it removes trend/cycle component. Any thing left is considered as randomness or error. &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;[As per this&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;https://www.otexts.org/fpp/6/1&quot; style=&quot;font-family: &#39;&amp;quot;arial&amp;quot;&#39;; font-size: 15px; white-space: pre-wrap;&quot; target=&quot;_blank&quot;&gt;Forecasting: Principles and Practice - Rob J Hyndman, George Athana­sopou­los&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; white-space: pre-wrap;&quot;&gt;, “Many people confuse cyclic behaviour with seasonal behaviour, but they are really quite different. If the fluctuations are not of fixed period then they are cyclic; if the period is unchanging and associated with some aspect of the calendar, then the pattern is seasonal. In general, the average length of cycles is longer than the length of a seasonal pattern, and the magnitude of cycles tends to be more variable than the magnitude of seasonal patterns.”]&lt;/span&gt;&lt;/div&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #434343; font-family: &amp;quot;arial&amp;quot;; font-size: 18.666666666666664px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Time Series Decomposition&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Additive decomposition model assumes the following mathematical model :&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-left: 72pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; = T&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; + C&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; + P&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; + E&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Y&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; : Actual value of the data at period t.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; : Trend component at period t. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;C&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; : Cyclic component at period t.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;E&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; : Irregular or residual component at period t.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;P&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 8.799999999999999px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: sub; white-space: pre-wrap;&quot;&gt;t&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; : Seasonal component at period t.&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The subscript ‘t’ indicates a specific period of time. This time can be measured in weeks, months, quarters, years or so. For example, sale of warm clothes depends heavily on the time of the year. Due to population growth, it also has a positive trend over time. &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;elecequip_trend.png&quot; height=&quot;265&quot; src=&quot;https://lh3.googleusercontent.com/XX2Z9iJlAX4SNobDyK4OG7i3zVbhUAYnlJ5ezgHwVySDibBTLZQM7Atoji9_tq2rOZl28lwKJdJaXpiGx3_6OKSo1jyYZrHtE98TaCmT_Ynr6kwb9o2EMqPcedn3PVzu93QuQZHH&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;454&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The figure above (&lt;a href=&quot;https://www.otexts.org/fpp/6/1&quot; target=&quot;_blank&quot;&gt;Forecasting: Principles and Practice - Rob J Hyndman, George Athana­sopou­los&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;) is about the new order of electric equipments received over time. Raw data in gray, trend-cycle component (ignoring seasonality and randomness/noise) in red.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The below diagram shows the additive decomposition of the data.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;elecequip_stl.png&quot; height=&quot;403&quot; src=&quot;https://lh3.googleusercontent.com/R4FSajQP8k6GmzEG0h0jVvJAX9-1MVQWsy36ZSuzpqB0AlwozUYgnybhHSBvpCxQnZWhlRbGNM9H8W67TTmze8z60O6eV9AlXIHFgl_8Q3hjfvDEUmUwz9Z4fLwen18s95HxIZCk&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;405&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #434343; font-family: &amp;quot;arial&amp;quot;; font-size: 18.666666666666664px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Smoothing Techniques&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Smoothing techniques removes the fluctuations in time series (due to seasonal or irregular/error components). Once these components are removed only trend-cycle component remains. Moving average and differencing are two smoothing techniques. &lt;/span&gt;&lt;/div&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #434343; font-family: &amp;quot;arial&amp;quot;; font-size: 18.666666666666664px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Moving Average&lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Moving average technique removes the seasonality of the data. &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;margin-left: 0pt;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;65&quot;&gt;&lt;/col&gt;&lt;col width=&quot;93&quot;&gt;&lt;/col&gt;&lt;col width=&quot;100&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Actual Data&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;3 Moving Average&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;103&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;105&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;293.3&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;672&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;293.6&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;104&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;297&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;115&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;303.3&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;691&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;305&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;110&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;306&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;117&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;291&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;9&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;648&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Third column shows the moving average of order 3. The first element (293.3) of the moving average column is the average of the elements 1,2,3 of the actual data column. The second element (293.6) is the average of elements 2,3,4 and so on. Since, we are moving with a block of 3 data points, it’s called 3rd order moving average.&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;As evident from the figure below, moving average removes the seasonality of the data. If there is no trend in the data set, the transformed data set (after applying moving average) will be around the mean. In that case, mean value will be the best forecast.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;MA.jpg&quot; height=&quot;269&quot; src=&quot;https://lh3.googleusercontent.com/NnfzKnXFAg49Rsb35ppfPVOwlpZBo3hFrLLiKHs1FGfSdo0Xmi9R2lDLVK-A1zP7zSYJ-3lMrIIgoATA-g-hyTTgkHjsc4R9Q8n1cGi6dgkniWMsCG1y7lZ4zKBgbAz0GE2sQuab&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;421&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Let’s consider a data set which has seasonal as well as trend component below. &lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;margin-left: 0pt;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;77&quot;&gt;&lt;/col&gt;&lt;col width=&quot;114&quot;&gt;&lt;/col&gt;&lt;col width=&quot;131&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Actual Data&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;3 Moving Average&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;103&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;105&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;293.33&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;672&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;393.67&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;404&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;497&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;415&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;603&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;991&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;672&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;610&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;793&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;617&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;995&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;9&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;1148&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;The next figure shows how the seasonality is removed by the moving average technique, however the trend information remains in the transformed data.&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screenshot_01_03_16__10_39_AM.jpg&quot; height=&quot;243&quot; src=&quot;https://lh5.googleusercontent.com/Di9dOP9eqW3KmwN587AnrH27YCQIVpaatUbickz3gaYdAPehBNos78TW1rUrFpT9XEV5ris7FLM74hGRECgxhmIVFhwl4YhP4sOw6N0EjAjqIuIxFf-uVDVwsIjCeLF1xnZEI0qy&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;416&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Disadvantage of this approach is that sample is size gets reduced. However with a large data set that is not the problem.&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #434343; font-family: &amp;quot;arial&amp;quot;; font-size: 18.666666666666664px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Differencing &lt;/span&gt;&lt;/h3&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Differencing is a method used to remove the trend information from the time series. Once removed, data becomes stationary (i.e data fluctuates around a constant mean, independent of time, and the variance of the fluctuation remains essentially constant over time). For example, let’s consider the data below.&lt;/span&gt;&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;margin-left: 0pt;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;99&quot;&gt;&lt;/col&gt;&lt;col width=&quot;141&quot;&gt;&lt;/col&gt;&lt;col width=&quot;176&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Index&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Actual Data&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Data after Differencing &lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;3&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;4&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;10&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;5&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;12&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;6&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;14&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;7&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;16&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr style=&quot;height: 0px;&quot;&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;8&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;18&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom: solid #000000 1px; border-left: solid #000000 1px; border-right: solid #000000 1px; border-top: solid #000000 1px; padding: 7px 7px 7px 7px; vertical-align: top;&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 12px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;2&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;b style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Here, the 1st element in the “Data after Differencing” column is computed by subtracting 1st element of the actual element column (with value 2) from the second element of the actual element column (with value 4) and so on. As evident from the figure below, the resulting series does not have the trend information any more. But in reality, the transformed data will consists of the error/randomness around the mean. &lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;img alt=&quot;Screenshot_01_03_16__11_37_AM.jpg&quot; height=&quot;327&quot; src=&quot;https://lh5.googleusercontent.com/UAkg0tfNKfV0NMmMU43QXALdFmxM74NQ-pp2diA972Q3J25tuvbgH7W0rhR_DopN6DXW_429R7UXeTCptl0caWkDGFld0sx7wZA0kMDmLX0zxNZQfNJBZI17ThYZ8bWr6E0-sDKG&quot; style=&quot;-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);&quot; width=&quot;624&quot; /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;h3 dir=&quot;ltr&quot; style=&quot;line-height: 1.38; margin-bottom: 4pt; margin-top: 16pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: #434343; font-family: &amp;quot;arial&amp;quot;; font-size: 18.666666666666664px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;Forecasting &lt;/span&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: &amp;quot;arial&amp;quot;; font-size: 14.666666666666666px; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;For forecasting, moving average and/or differencing needs to be applied. Once the seasonal and trend-cyclic information is removed from the data, what remains is the irregular or error component (across the mean). Based on the transformed data, forecasting needs to be done (which is the mean across which errors are distributed). On applying trend-cyclicity and seasonality on top of that, actual forecast is received.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/719443806304303956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2016/05/my-notes-on-time-series.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/719443806304303956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/719443806304303956'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2016/05/my-notes-on-time-series.html' title='My Notes On Time Series'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh3.googleusercontent.com/XiHIcedC--G18-RBq-4d7M9SiumTUC-6YNhf64adHFWVKTdYrFcx9woOkZqVkQ-tQm5N6rbBYEqRIvY-1Z5fwjpnQp4c6bVCVrFhhXFSbu6Yyx1xMEPenKjC-bo3yaZvW-uK9KRo=s72-c" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-6323989290565258480</id><published>2015-12-17T21:33:00.000+05:30</published><updated>2015-12-17T21:55:38.738+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="wildfly"/><category scheme="http://www.blogger.com/atom/ns#" term="wildfly-8"/><title type='text'>Wildfly 8.x : Control maximum number of connections (threads) assigned to an application</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In Wildfly, multiple applications can be deployed together. With the default configuration, there is no control on the maximum number of connections/threads assigned to any particular application. This blog describes configurations needed to restrict maximum number of threads assigned to any application. That way if one of the applications hang (consuming all the threads assigned to it), other applications will not be impacted.&lt;br /&gt;
&lt;br /&gt;
Following steps will make sure that one of the applications (Referred as &quot;myapp&quot; below) will be associated with a different virtual server and host in wildfly w.r.t other applications. Also, maximum number of connections allocated to that application will be controlled by WildFly.&lt;br /&gt;
&lt;br /&gt;
1. Add jboss-web.xml under WEB-INF directory for the application war under question (in addition to the web.xml located at the same location) :&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;jboss-web xmlns=&quot;http://www.jboss.com/xml/ns/javaee&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-web_8_0.xsd&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;context-root&amp;gt;/myapp&amp;lt;/context-root&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;virtual-host&amp;gt;myapp-host&amp;lt;/virtual-host&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;lt;server-instance&amp;gt;myapp-server&amp;lt;/server-instance&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/jboss-web&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
2. Add the new virtual server (with name &quot;myapp-server&quot;) in standalone.xml. The corresponding virtual host is associated with a filter named &quot;limit-connections&quot;. This filter controls maximum number of connections. Also, add a new socket-binding.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;subsystem xmlns=&quot;urn:jboss:domain:undertow:1.2&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;buffer-cache name=&quot;default&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;server name=&quot;default-server&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;http-listener name=&quot;default&quot; socket-binding=&quot;http&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;https-listener name=&quot;secure&quot; socket-binding=&quot;https&quot; security-realm=&quot;ssl-realm&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;host name=&quot;default-host&quot; alias=&quot;localhost&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;location name=&quot;/&quot; handler=&quot;welcome-content&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;filter-ref name=&quot;server-header&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;filter-ref name=&quot;x-powered-by-header&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/host&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/server&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;lt;server name=&quot;myapp-server&quot; default-host=&quot;myapp-host&quot;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;http-listener name=&quot;myapp-listener&quot; socket-binding=&quot;myapp-manager&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;host name=&quot;myapp-host&quot; alias=&quot;localhost&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;location name=&quot;/&quot; handler=&quot;welcome-content&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;filter-ref name=&quot;limit-connections&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/host&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/server&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;servlet-container name=&quot;default&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;jsp-config/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;websockets/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/servlet-container&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;handlers&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;file name=&quot;welcome-content&quot; path=&quot;${jboss.home.dir}/welcome-content&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/handlers&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;filters&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;lt;connection-limit name=&quot;limit-connections&quot; max-concurrent-requests=&quot;5&quot; queue-size=&quot;100&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;response-header name=&quot;server-header&quot; header-name=&quot;Server&quot; header-value=&quot;WildFly/8&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;response-header name=&quot;x-powered-by-header&quot; header-name=&quot;X-Powered-By&quot; header-value=&quot;Undertow/1&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/filters&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/subsystem&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;socket-binding-group name=&quot;standard-sockets&quot; default-interface=&quot;public&quot; port-offset=&quot;${jboss.socket.binding.port-offset:0}&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;management-http&quot; interface=&quot;management&quot; port=&quot;${jboss.management.http.port:9990}&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;management-https&quot; interface=&quot;management&quot; port=&quot;${jboss.management.https.port:9993}&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;ajp&quot; port=&quot;${jboss.ajp.port:8009}&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;http&quot; port=&quot;${jboss.http.port:8080}&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;https&quot; port=&quot;${jboss.https.port:8443}&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;jacorb&quot; interface=&quot;unsecure&quot; port=&quot;3528&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;jacorb-ssl&quot; interface=&quot;unsecure&quot; port=&quot;3529&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;messaging-group&quot; port=&quot;0&quot; multicast-address=&quot;${jboss.messaging.group.address:231.7.7.7}&quot; multicast-port=&quot;${jboss.messaging.group.port:9876}&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;txn-recovery-environment&quot; port=&quot;4712&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;socket-binding name=&quot;txn-status-manager&quot; port=&quot;4713&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;&amp;lt;socket-binding name=&quot;myapp-manager&quot; port=&quot;8282&quot;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;outbound-socket-binding name=&quot;mail-smtp&quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;remote-destination host=&quot;localhost&quot; port=&quot;25&quot;/&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/outbound-socket-binding&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;lt;/socket-binding-group&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s all. Now Wildfly will take care of controlling maximum number of threads/connections assigned to my app.&lt;br /&gt;
&lt;br /&gt;
Reference:&lt;br /&gt;
&lt;br /&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.jboss.org/thread/236975?start=0&amp;amp;tstart=0&quot; target=&quot;_blank&quot;&gt;JBoss Discussion&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://stackoverflow.com/questions/29825894/setting-up-maximum-of-connections-for-web&quot; target=&quot;_blank&quot;&gt;Stackoverflow&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/6323989290565258480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2015/12/wildfly-8x-control-maximum-number-of.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/6323989290565258480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/6323989290565258480'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2015/12/wildfly-8x-control-maximum-number-of.html' title='Wildfly 8.x : Control maximum number of connections (threads) assigned to an application'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-1287530575743838434</id><published>2014-01-12T17:57:00.000+05:30</published><updated>2014-01-14T17:54:51.218+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Programming language popularity"/><category scheme="http://www.blogger.com/atom/ns#" term="Programming language rank"/><category scheme="http://www.blogger.com/atom/ns#" term="PYPL"/><category scheme="http://www.blogger.com/atom/ns#" term="RedMonk"/><category scheme="http://www.blogger.com/atom/ns#" term="tiobe"/><title type='text'>Popularity (Usability) Index for Programming Languages</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;!--?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?--&gt;

&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;According to &lt;a href=&quot;http://www.oxforddictionaries.com/definition/english/popular&quot; target=&quot;_blank&quot;&gt;Oxford Dictionaries&lt;/a&gt;, the word &quot;popular&quot; means &quot;&lt;span style=&quot;background-color: white; color: #333333; line-height: 20.390625px; text-align: left;&quot;&gt;liked or admired by many people or by a particular person or group&lt;/span&gt;&quot;. I know folks who code just for their living without any love for it. So, I am not going to use the term &quot;Popularity&quot;, but will use the term &quot;Usability&quot; - &quot;Usability Index For Programming Languages&quot;.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
When a programmer decides to learn a new language, these indices may be checked to find out if this new skill will be helpful in future. Also, while starting a new project, one may not be willing to use a programming language which is slowly dying because of various reasons.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;There are&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;different methodologies used by these indices&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;to rank programming languages:&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of times name of a language has been searched or number of times a language has been referred&amp;nbsp;in the internet.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of lines code written in a particular language available in public (e.g. in repositories like &lt;a href=&quot;https://github.com/&quot; target=&quot;_blank&quot;&gt;github&lt;/a&gt;, &lt;a href=&quot;https://bitbucket.org/&quot; target=&quot;_blank&quot;&gt;bitbucket&lt;/a&gt;, &lt;a href=&quot;https://code.google.com/&quot; target=&quot;_blank&quot;&gt;Google Code&lt;/a&gt;&amp;nbsp;etc).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of open source projects available in public repositories.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of questions posted in question answer sites like &lt;a href=&quot;http://stackoverflow.com/&quot; target=&quot;_blank&quot;&gt;stackoverflow&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of books sold for a particular language.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of advertisement posted for a language in different job portals.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Neither of the above mentioned methodologies may actually represent real world usage of a language (For example, data related to corporate or private projects is not publicly available). Or neither of these may be able to identify the best programming&amp;nbsp;language. &amp;nbsp;But, a combination of all these should give some idea about the current trend.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
And here are the different indices available:&lt;/span&gt;&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;1. TIOBE Programming Community Index&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This programming language ranking is prepared based on the query&amp;nbsp;&quot;+ &amp;lt;language&amp;gt; programming&quot;&amp;nbsp;made to&amp;nbsp;25 search engines&amp;nbsp;(including Google, Yahoo, Youtube, Amazon, Baidu, Blogger,&amp;nbsp;Facebook, LinkedIn, Bing, StackOverflow, Twitter, Wikipedia, Wordpress etc). It covers around 229 programming languages (as of January 2014). As per the portal, this index does not consider number of lines of code for a language; Instead it&#39;s based on the number of&amp;nbsp;skilled programmers, available courses and third party vendors. The index shows the trend from 2002 till date and gets updated once in a month.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
In the past, there were controversies around the methodologies followed for this index. As a result, they have fine tuned it over time.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;There are suggestions to use &amp;nbsp;queries such as &quot;programming with &amp;lt;language&amp;gt;&quot;, &quot;&amp;lt;language&amp;gt; development&quot; and &quot;&amp;lt;language&amp;gt; coding&quot; in addition to &quot;&quot;&amp;lt;language&amp;gt; programming&quot; (Not yet implemented).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Currently&amp;nbsp;the team is working on adding queries in natural languages other than English (to start with they are working on Chinese search engine Baidu).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;https://sites.google.com/site/pydatalog/pypl/PyPL-PopularitY-of-Programming-Language&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2. PYPL PopularitY of Programming Language index&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;How frequently a language is searched&amp;nbsp;for a tutorial&amp;nbsp;in google - that is the basis of this index. An&amp;nbsp;example query string is &quot;python tutorial&quot;. Since&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;python has other meanings too,&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;searching&amp;nbsp;only for &quot;python&quot; (as performed by other indices) may lead to inconsistent result.&amp;nbsp;The data is collected from google trends. Right now, it covers only 10 languages.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;As indicated in the portal,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;the approach is different from TIOBE index :&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: #cccccc; font-family: Verdana, sans-serif;&quot;&gt;&lt;i&gt;The &amp;nbsp;TIOBE Index is a lagging indicator. &amp;nbsp;It counts the number of web pages with the language name. &amp;nbsp;Objective-c programming has over 20 million pages on the web,[s] &amp;nbsp;while C programming has only 11 million.[s] This explains why Objective-C has a high TIOBE ranking. &amp;nbsp;But who is reading those Objective-C web pages ? Hardly anyone, according to Google Trends data. &amp;nbsp;Objective C programming is searched 30 times less than C programming.[s] &amp;nbsp;In fact, the use of programming by the TIOBE index is misleading...&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;h4&gt;
&lt;a href=&quot;http://redmonk.com/sogrady/2013/07/25/language-rankings-6-13/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;3.&amp;nbsp;RedMonk Programming Language Rankings&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This index is generated based on two things :&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of projects in github for a language.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of questions tagged for a language in stackoverflow.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;As understood, this approach has it&#39;s own set of limitations (and it accepts that fact). In addition to github, there are other repositories (e.g. bitbucket, google code etc) which are being used by developers, but, RedMonk does not consider those. Also, github is popular among the developers for their personal projects. github may not include the projects they actually work on as a part of their job.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://langpop.corger.nl/&quot; target=&quot;_blank&quot;&gt;Programming Language Popularity Chart&lt;/a&gt;&amp;nbsp;uses a similar approach. In addition to #2 (Number of questions tagged for a language in stackoverflow),&amp;nbsp;it considers the number of lines of commit for a language in github (instead of number of projects in github).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;


&lt;/span&gt;&lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://lang-index.sourceforge.net/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;4.&amp;nbsp;The Transparent Language Popularity Index&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This is an open source, fully automatic, free tool for measuring the popularity of languages (historical data is available on request). It searches for the string &quot;+ language programming&quot; in Google, Yahoo, Bing, Google Blogs, Amazon, YouTube, Wikipedia and languages are ranked accordingly. Being an open source tool (It&#39;s available &lt;a href=&quot;http://sourceforge.net/projects/lang-index/&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;), the data is freely available, so that any one can reproduce and&amp;nbsp;verify the ranking using&amp;nbsp;this tool.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Since, yahoo has stopped returning the number of search results, this index will stop using this search engine in future.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h4&gt;
&lt;a href=&quot;http://langpop.com/&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;5.&amp;nbsp;langpop&lt;/span&gt;&lt;/a&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;This portal presents the trends based on :&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of pages returned for the string &quot;language programming&quot; by Google.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of files found with a specified extension (e.g. &quot;.java&quot;) by Google.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of job posted in&amp;nbsp;&lt;a href=&quot;http://www.craigslist.org/about/sites&quot; target=&quot;_blank&quot;&gt;craigslist&lt;/a&gt; returned by Google.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Based on the data returned by github and &lt;a href=&quot;http://ohloh.net/&quot;&gt;ohloh.net&lt;/a&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of times name of a language is mentioned (in the title) in the following three websites :&amp;nbsp;&lt;a href=&quot;http://lambda-the-ultimate.org/&quot; target=&quot;_blank&quot;&gt;Lambda the Ultimate&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://programming.reddit.com/&quot;&gt;programming.reddit.com&lt;/a&gt;, &lt;a href=&quot;http://slashdot.org/&quot; target=&quot;_blank&quot;&gt;Slashdot&lt;/a&gt;. This particular methodology (#5) highlights the languages people are talking about, but may not be actually using.&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
&lt;b&gt;&lt;a href=&quot;http://www.ohloh.net/languages/compare&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;6.&amp;nbsp;Ohloh&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;ohloh.net is different from code/project hosting sites like github, bitbucket etc. It&#39;s a free, public &lt;u&gt;directory&lt;/u&gt; for open source projects. It provides a search service, so one can search for&amp;nbsp;open source&amp;nbsp;code, irrespective of where the code &amp;nbsp;is actually lying. It measures the activity from almost 600000 open source projects.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
In this portal, one may select a number languages and compare those based on:&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of commits per month.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of contributors who have contributed at least one line of code&amp;nbsp;per month.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of lines of codes changed&amp;nbsp;per month.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Number of projects&amp;nbsp;with at least one line of code changed&amp;nbsp;per month.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Trends are being displayed since 2005.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;


&lt;/span&gt;&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;7. Job Advertisements&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;a href=&quot;http://jobstractor.com/monthly-stats&quot; target=&quot;_blank&quot;&gt;Job Tractor&lt;/a&gt;, &lt;a href=&quot;http://trendyskills.com/&quot; target=&quot;_blank&quot;&gt;Trendy Skills&lt;/a&gt;, &lt;a href=&quot;http://www.indeed.com/jobtrends&quot; target=&quot;_blank&quot;&gt;Indeed&lt;/a&gt;&amp;nbsp;etc rank languages based on the demand for languages in the job market. Job Tractor searches twitter for job postings for different languages.&amp;nbsp;&lt;a href=&quot;http://trendyskills.com/about&quot; target=&quot;_blank&quot;&gt;Trendy Skills&lt;/a&gt; searches for advertisements in popular job portals for the skills and technologies employees are looking for. indeed.com&amp;nbsp;itself is a job portal covering 50 countries and 26 languages; Here, one can check job trends for different skill sets (e.g. languages), companies etc.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;8. Sale of technical books&lt;/span&gt;&lt;/h4&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;Every year, O’Reilly publishes a series of articles (&lt;a href=&quot;http://radar.oreilly.com/2005/04/book-sales-as-a-technology-tre.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://radar.oreilly.com/2006/08/programming-language-trends.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://radar.oreilly.com/2012/04/computer-book-market-2011-part4.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;) related to &quot;computer book market&quot;&amp;nbsp;(based on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Nielsen_BookScan&quot; target=&quot;_blank&quot;&gt;Nielsen BookScan&lt;/a&gt;&#39;s weekly top 3000 tittles sold and data from Amazon). As a part of this effort, O&#39;Reilly tries to gauge the programming language rankings.&amp;nbsp;The assumption here is employers as well as individual programmers buy books based on their current need (job for which they are being paid) and interest. The programming language used for examples used in a book identifies&amp;nbsp;the language of the book. For example, &quot;&lt;a href=&quot;http://www.amazon.com/First-Design-Patterns-Elisabeth-Freeman/dp/0596007124&quot; target=&quot;_blank&quot;&gt;Head First Design Pattern&lt;/a&gt;&quot; is considered to be a Java book, as the code&amp;nbsp;snippets are written in Java. Although, &lt;a href=&quot;http://www.nielsenbookscan.co.uk/uploads/WHAT%20IS%20NIELSEN%20BOOKSCAN.pdf&quot; target=&quot;_blank&quot;&gt;Neilsen BookScan&lt;/a&gt; covers book markets in UK, Ireland, Australia, New Zealand, South Africa, Italy, India, US and Spain, the reports published by O&#39;Reilly seems to concentrate only on US (I am not very sure about it).&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
These studies were made in the past and are not relevant for 2013/14.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&amp;nbsp;&lt;b&gt;References :&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;
1. &lt;a href=&quot;http://en.wikipedia.org/wiki/Measuring_programming_language_popularity&quot; target=&quot;_blank&quot;&gt;Wikipedia :&amp;nbsp;Measuring programming language popularity&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;2.&amp;nbsp;&lt;a href=&quot;http://readwrite.com/2012/06/05/5-ways-to-tell-which-programming-lanugages-are-most-popular#awesm=~osSW5pKswemJpM&quot; target=&quot;_blank&quot;&gt;5 Ways to Tell Which Programming Languages are Most Popular&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;3.&amp;nbsp;&lt;a href=&quot;http://www.drdobbs.com/jvm/the-rise-and-fall-of-languages-in-2013/240165192&quot; target=&quot;_blank&quot;&gt;The Rise And Fall of Languages in 2013&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;4.&amp;nbsp;&lt;a href=&quot;http://blog.timbunce.org/2008/04/12/tiobe-or-not-tiobe-lies-damned-lies-and-statistics/&quot; target=&quot;_blank&quot;&gt;TIOBE or not TIOBE – “Lies, damned lies, and statistics”&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/1287530575743838434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2014/01/popularity-index-for-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/1287530575743838434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/1287530575743838434'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2014/01/popularity-index-for-programming.html' title='Popularity (Usability) Index for Programming Languages'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-3445539206842593156</id><published>2013-05-10T23:47:00.002+05:30</published><updated>2014-01-14T17:22:01.126+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Abstract Programming Interface"/><category scheme="http://www.blogger.com/atom/ns#" term="API"/><category scheme="http://www.blogger.com/atom/ns#" term="designing"/><title type='text'>Fundamentals of good API designing</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:OfficeDocumentSettings&gt;
  &lt;o:AllowPNG/&gt;
 &lt;/o:OfficeDocumentSettings&gt;
&lt;/xml&gt;&lt;![endif]--&gt;

&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Do you write reusable OO code? Code that is being used by
other modules within the same product? Or code that is exposed to the outside
world and used to develop third party applications? If the answer to either of
the questions is true, then you are an API developer. Either you write private
APIs (used internally by other modules) or public APIs (used to develop other
applications). Here are the fundamental principles which you should keep in
mind while designing an API:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;1. Understand the
requirement:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Once you get the requirement from
customer (a real &quot;external&quot; customer or the developer sitting next to
you and working for the other module), break it up into small use cases. That
will help you to start thinking about the first few basic APIs.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;2. Think and discuss:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l3 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Are
     you missing any use case? I am sure, at this stage, the answer might be yes.
     Revisit the requirements again. Think twice. That way you will be able to
     identify few more APIs.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l3 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Once
     you have the preliminary list ready, write it down and send it to others
     (as many as possible). Discuss. This is the most important part of API
     designing.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l3 level1 lfo1; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Listen
     carefully to what others are saying/suggesting. Remember once you write
     and expose your API to the outside world, you can&#39;t change them. So, it&#39;s
     better to debate, decide and then develop.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;3. Not too many, not too less:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;At the end of step 2, you might have a long list. Possibly
one API per use case.&amp;nbsp;Number them. Do you really need those many APIs? Is
it possible to combine the&amp;nbsp;functionality of&amp;nbsp;few of them into one?
That way you may end up writing more generic API. However, your API should not
try to do too many things together. Remember all of us hate complexity.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;4. Name them:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l1 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;A&amp;nbsp;meaningful,
     easy to understand, self-explanatory name helps the user to&amp;nbsp;use it
     even without reading the documentation. A complicated name indicates that
     you are trying to do too many things (which are not a good design). &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l1 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;It
     should be consistent with the names of other existing APIs. Otherwise user
     may get confused. &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;5. Signature:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Design
     the signature in such a way that it could be extended in future (Use
     generic, enum, var-arg etc).&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l4 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;The
     way an API needs to be used should be very obvious. A user (developer)
     always hates surprise!&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;6. Prototype it:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Are you sure that your thoughts can be converted into real
code? Write (code) a prototype.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;7. Implement:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Not
     sure about a validation/functionality? don&#39;t add it. A less restrictive
     approach is always better to start with.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;While
     coding consider not only about the behavior, but also about the
     performance.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l0 level1 lfo4; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Hide
     implementation details. Don&#39;t expose exceptions which talk about internal
     implementation. API should throw exceptions which is relevant to the APIs
     external behavior and not to the internal behavior.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;8. &amp;nbsp;Document it:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l2 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Document
     every small thing. Do it religiously. Document each and every contract,
     limitation, pre &amp;amp; post conditions.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-list: l2 level1 lfo5; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list .5in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;But,
     don&#39;t over explain. Keep it short and crispy. Exposing implementation
     details might be confusing. You may need to change the implementation in
     future, so it&#39;s better not to talk about it.&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;9. Test it:&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;This is where your API will be used for the first
time.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-bidi-font-weight: bold; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;10. Use it:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Is it possible to consume the API even before exposing it to
the outside world? If yes, please do it. This is your last chance to make
things correct. Once exposed, you will never be able to change the external
behavior. However, it will take some time (read few releases) for the internal
implementation to get stable. Remember, Rome wasn&#39;t built in a day!&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Further reading: &lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=aAb7hSCtvGw&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;How
to Design a Good API and Why it Matters&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;,&amp;quot;sans-serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;a href=&quot;http://www.microsoft.com/en-us/download/details.aspx?id=22080&quot; target=&quot;_blank&quot;&gt;The Art of Building a Reusable Class Library&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; mso-fareast-font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:WordDocument&gt;
  &lt;w:View&gt;Normal&lt;/w:View&gt;
  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
  &lt;w:TrackMoves/&gt;
  &lt;w:TrackFormatting/&gt;
  &lt;w:PunctuationKerning/&gt;
  &lt;w:ValidateAgainstSchemas/&gt;
  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
  &lt;w:DoNotPromoteQF/&gt;
  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;
  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;
  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;
  &lt;w:Compatibility&gt;
   &lt;w:BreakWrappedTables/&gt;
   &lt;w:SnapToGridInCell/&gt;
   &lt;w:WrapTextWithPunct/&gt;
   &lt;w:UseAsianBreakRules/&gt;
   &lt;w:DontGrowAutofit/&gt;
   &lt;w:SplitPgBreakAndParaMark/&gt;
   &lt;w:EnableOpenTypeKerning/&gt;
   &lt;w:DontFlipMirrorIndents/&gt;
   &lt;w:OverrideTableStyleHps/&gt;
  &lt;/w:Compatibility&gt;
  &lt;m:mathPr&gt;
   &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;
   &lt;m:brkBin m:val=&quot;before&quot;/&gt;
   &lt;m:brkBinSub m:val=&quot;&amp;#45;-&quot;/&gt;
   &lt;m:smallFrac m:val=&quot;off&quot;/&gt;
   &lt;m:dispDef/&gt;
   &lt;m:lMargin m:val=&quot;0&quot;/&gt;
   &lt;m:rMargin m:val=&quot;0&quot;/&gt;
   &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;
   &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;
   &lt;m:intLim m:val=&quot;subSup&quot;/&gt;
   &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;
  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;w:LatentStyles DefLockedState=&quot;false&quot; DefUnhideWhenUsed=&quot;true&quot;
  DefSemiHidden=&quot;true&quot; DefQFormat=&quot;false&quot; DefPriority=&quot;99&quot;
  LatentStyleCount=&quot;267&quot;&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;0&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Normal&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;heading 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 7&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 8&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 9&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 7&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 8&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 9&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;35&quot; QFormat=&quot;true&quot; Name=&quot;caption&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;10&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Title&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; Name=&quot;Default Paragraph Font&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;11&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtitle&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;22&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Strong&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;20&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Emphasis&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;59&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Table Grid&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Placeholder Text&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;No Spacing&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Revision&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;34&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;List Paragraph&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;29&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Quote&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;30&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Quote&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 1&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 2&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 3&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 4&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 5&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 6&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;19&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Emphasis&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;21&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Emphasis&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;31&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Reference&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;32&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Reference&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;33&quot; SemiHidden=&quot;false&quot;
   UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Book Title&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;37&quot; Name=&quot;Bibliography&quot;/&gt;
  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; QFormat=&quot;true&quot; Name=&quot;TOC Heading&quot;/&gt;
 &lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-priority:99;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0in 5.4pt 0in 5.4pt;
 mso-para-margin-top:0in;
 mso-para-margin-right:0in;
 mso-para-margin-bottom:10.0pt;
 mso-para-margin-left:0in;
 line-height:115%;
 mso-pagination:widow-orphan;
 font-size:11.0pt;
 font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
 mso-ascii-font-family:Calibri;
 mso-ascii-theme-font:minor-latin;
 mso-hansi-font-family:Calibri;
 mso-hansi-theme-font:minor-latin;
 mso-bidi-font-family:&quot;Times New Roman&quot;;
 mso-bidi-theme-font:minor-bidi;}
&lt;/style&gt;
&lt;![endif]--&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/3445539206842593156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2013/05/fundamentals-of-good-api-designing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/3445539206842593156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/3445539206842593156'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2013/05/fundamentals-of-good-api-designing.html' title='Fundamentals of good API designing'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-8104996137745117480</id><published>2012-08-25T00:24:00.000+05:30</published><updated>2014-01-19T16:28:39.391+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Architexa"/><category scheme="http://www.blogger.com/atom/ns#" term="Class diagram"/><category scheme="http://www.blogger.com/atom/ns#" term="eclipse plugin"/><category scheme="http://www.blogger.com/atom/ns#" term="layered diagram"/><category scheme="http://www.blogger.com/atom/ns#" term="sequence diagram"/><category scheme="http://www.blogger.com/atom/ns#" term="UML"/><title type='text'>Promotion : Architexa</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;border-collapse: separate; color: black; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;I am very much excited about a new development tool suite from a&amp;nbsp;&amp;nbsp;MIT spin-off startup,&amp;nbsp;&lt;a href=&quot;http://www.architexa.com/&quot; target=&quot;_blank&quot;&gt;Architexa&lt;/a&gt;! I am using it regularly and it&#39;s awesome.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;border-collapse: separate; color: black; font-family: Arial,Helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Architexa offers various tools for Java&amp;nbsp;development. So far, I have tried their tool for generating &lt;a href=&quot;http://www.architexa.com/learn-more/understand&quot; target=&quot;_blank&quot;&gt;UML diagrams&lt;/a&gt;. I know you must be thinking &quot;What&#39;s new in that? There are thousands of tools which do the same.&quot;. But, this tool suite is developed with one particular goal. It helps to read&amp;nbsp;and understand&amp;nbsp;any legacy code quickly. Yes, all of us, the developers, inherit code. It might be the proprietary code or the open source one, but whatever be the case, we spend a good amount of time understanding the existing code. Architexa is helping us exactly there.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;I have used their eclipse plugin to generate class diagram, sequence diagram and &lt;a href=&quot;http://www.architexa.com/learn-more/layered-diagrams&quot; target=&quot;_blank&quot;&gt;layered diagram &lt;/a&gt;for various modules of approximately 10 year old large, complex,legacy code base. Believe me, it was quick and easy. I have used rational rose earlier. I Always felt that rational rose is a subject of it&#39;s own. While fixing a bug or developing a new feature, we often feel the need of some tool very quick and easy to adapt. Architexa does that!&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;IMO, following are the advantages of the Architexa tool suite over others:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Quick to learn, designed brilliantly, within an hour or so anyone can learn the tool by his own. &lt;a href=&quot;http://www.architexa.com/support/videos/intro/video&quot; target=&quot;_blank&quot;&gt;Few short videos&lt;/a&gt; and a brief &lt;a href=&quot;http://www.architexa.com/learn-more/document&quot; target=&quot;_blank&quot;&gt;documentation&lt;/a&gt; are available. You may like to go through them ONCE and that&#39;s it. You are ready to go.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;You can decide the complexity of each generated diagram. You decide the content based on need.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.architexa.com/learn-more/layered-diagrams&quot; target=&quot;_blank&quot;&gt;Layered diagram&lt;/a&gt; : This is something new. At least, Architexa claims that no other tool offers this feature. I really loved it. It helps to visualize the dependencies between different packages, so that the cyclic/unwanted dependencies among the packages can be avoided at the initial stage.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;It&#39;s fast. Doesn&#39;t make your eclipse to hang.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;As mentioned earlier for individual users like you and me, it&#39;s free.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;BUT, yes, still there are some buts!&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ol style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;While generating the layered diagram, the tool takes good amount of time to find out dependencies between packages. It may vary between few seconds to few minutes depending on the size of the code base.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;For a complex class diagram, sometimes it becomes difficult to follow the lines (relationships) between entities. User interface has some room for improvement.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Also, there are other minor issues (REAL BUGS!) which I am going to report in their user forum. For example, with eclipse helios (on Windows as well as Linux platform), I am not able to connect between two classes while creating a new class diagram.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif; text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/8104996137745117480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2012/08/architexa.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/8104996137745117480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/8104996137745117480'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2012/08/architexa.html' title='Promotion : Architexa'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-4788084995827692123</id><published>2010-12-19T16:50:00.001+05:30</published><updated>2010-12-19T17:39:07.827+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="dependency injection"/><category scheme="http://www.blogger.com/atom/ns#" term="Manual dependency injection"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton"/><title type='text'>Inject Dependencies - Manually</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;In another post, &lt;a href=&quot;http://deathbycode.blogspot.com/2010/11/do-i-really-need-singleton.html&quot;&gt;“Do I Really Need a Singleton?”&lt;/a&gt;, I wrote about the problems introduced by the Singleton design pattern. When the single unique instance is being accessed through the getInstance() method, Singleton acts as a global variable in disguise and introduces tight coupling and unwanted dependencies. I have received two immediate questions from my readers:&lt;/span&gt;&lt;/div&gt;&lt;ol style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Should a Singleton be used only with Dependency Injection Framework?&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;If accessing a Singleton through getInstance() creates tight coupling, creating an instance of any other class through new() also causes tight coupling. So, how should an object be created maintaining loose coupling?&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;As per my understanding, Dependency Injection is the answer for both the questions. But, that does not mandate the usage of a framework. Dependency Injection is a concept first and then a framework. When the application under question is small, we can always meet the needs by injecting dependencies manually, without using any framework like Spring.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;In any Java application, we repeatedly encounter with two events:&lt;/span&gt;&lt;/div&gt;&lt;ul style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Object creation&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Interaction between the objects - The business logic&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;But, usually we mix up both of them which leads to tight coupling and unwanted dependencies which in turn makes the maintenance as well as unit testing a pain. Let me try to explain it using a very simple example:&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;/div&gt;&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;class MyClass {

 private A a; //A is an interface
 private B b; //B is an interface

 //Object creation within constructor
 MyClass(A a, B b) {  
    a = new AImpl(); //AImpl is the concrete impl of A
    b = new BImpl(); //BImpl is the concrete impl of B
 }

 //Application logic lies within this method
 public void doSomething() {
    //Do A specific thing
    //Do B specific thing
    C c = new CImpl(); //Object creation within the method.
    //Do C specific thing
 }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The Problems with this class is:&lt;/span&gt;&lt;/div&gt;&lt;ol style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;It has not been able to separate out the the object creation from the business logic resulting in a tight coupling.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Here “programing to the implementation” has been done, not to interface. Tomorrow, if different implementations of A, B or C is required, the code inside the class has to be changed.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Testing MyClass would require testing of A, B, C first.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Let me try to fix the problem:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;class MyClass {

 private A a;
 private B b;
 private C c;

 MyClass(A a, B b, C c) {
    //Only Assignment
    this.a = a;
    this.b = b;
    this.c = c;
 }

 //Application Logic
 public void doSomething() {
    //Do A specific thing
    //Do B specific thing
    //Do C specific thing
 }
}

//The Factory
class MyFactory {
 public MyClass createMyClass() {
    return new MyClass(new AImpl(), new BImpl(), new CImpl());
 }
}

class Main {
 public static void main(String args[]) {
    MyClass mc = new MyFactory().createMyClass();
    mc.doSomething();
 }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;What have been achieved here: &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;1. &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Constructor does not have a new():&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Objects are not being created within the constructor of MyClass. The constructor is simply being used for field (A, B, C) assignments. &lt;u&gt;Here the constructor asks for the dependencies as parameters, but does not create them (And that is the Simplest definition of dependency injection)&lt;/u&gt;. However, simple Collection objects like ArrayList, HashMap OR value/leaf objects like Person/Employee (i.e the objects within the application which in turn does NOT create other objects) CAN BE created within the Constructor. Constructor should not be used for any other operation like I/O, thread creation etc.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;As a thumb rule, any object should hold references ONLY to other objects whom it needs directly to get it’s work done (This is called the Law of Demeter). For exapmle, if MyClass needs some other class called X, MyClass’ constructor should directly ask for X. It should NOT ask for some other factory F which can return an instance of X. Violation of “Law of Demeter” would result in unwanted dependency between MyClass and F. So, if you find more than one Dot (.) operator be careful - something illegal is happening there.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;2. Factory (MyFactory) is taking care of object creation and wiring:&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;All the new operators (90%-99%) should belong to the factory. It should take care of entire object graph creation for the application and also of relating (wiring) different objects based on their declared dependencies (e.g MyClass needs A, B, C etc). It should not contain anything more - not any other logic (No I/O, thread creation etc).&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Tomorrow if C starts depending on something else called D, only C and the factory would be impacted, not the entire object graph (C would have to introduce an overloaded constructor and factory would have to incorporate the object instantiation plus the object wiring related changes).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;For a large application of course there may be multiple factories. Here, thumb rule is one factory should instantiate all the objects with same life span.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;3. Object creation is separate from the business logic:&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;MyClass is now a Business Logic Holder. It does not have any new(). Even, it does not have any knowledge about the concrete implementations it is using for the business logic (i.e it knows about A but not about AImpl - “program to interface and not to implementation”).&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;You must have started thinking that I started this discussion with the context of Singleton. How does the manual dependency injection take care of a Singleton? How does it create a Singleton (minus the tight coupling, hidden dependency etc) and access it when needed? Surprisingly, we already have three Singletons in our example - AImpl, BImpl, CImpl.&lt;u&gt; If the factory takes care of creating only one instance of a Class (by invoking new() only once), its a Singleton.&lt;/u&gt; Isn’t it? Then &lt;u&gt;the factory may pass that unique instance in the form of dependencies to all other objects those need it.&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;4. So, where are we? MyClass, the business logic holder needs A, B and C for it’s business. It does not create them but asks for them (the dependencies). The factory (MyFactory)   creates those dependencies and wire them to MyClass. But, who creates, the factory? Of course, the main method (the application launcher :-)). Let me repeat the story again, the main method first instantiates the factory, the factory in turn instantiates the object graph, each Object declares their dependencies and finally the main method itself sets the ball rolling - launch the application by invoking doSomething() of MyClass, ie. the objects starts talking to each other executing the usual business.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Let me repeat it once more: &lt;b&gt;Create the factory, create the application using the factory and then start the application!&lt;/b&gt; For a large scale application the same thing can be achieved with a Dependency Injection framework like Spring, Google Guice etc. Of course they will come with lot of other benefits, in addition. But, for a small to medium scale application, dependency injection can be hand crafted making the app loosely coupled, more maintainable and of course unit test friendly.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Further Reading:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span id=&quot;internal-source-marker_0.949339463328124&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1.  This post is strongly influenced by the writings of &lt;a href=&quot;http://misko.hevery.com/about/&quot;&gt;Misko Hevery&lt;/a&gt;  published in his &lt;a href=&quot;http://misko.hevery.com/2008/09/10/where-have-all-the-new-operators-gone/&quot;&gt;personal blog&lt;/a&gt; as well as in &lt;a href=&quot;http://googletesting.blogspot.com/2008/10/dependency-injection-myth-reference.html&quot;&gt;Google Testing Blog&lt;/a&gt;.&lt;/span&gt; Some more interesting articles can be found &lt;a href=&quot;http://misko.hevery.com/2008/11/11/clean-code-talks-dependency-injection/&quot;&gt;here&lt;/a&gt;,&lt;a href=&quot;http://misko.hevery.com/2009/03/30/collaborator-vs-the-factory/&quot;&gt; here&lt;/a&gt; and &lt;a href=&quot;http://misko.hevery.com/code-reviewers-guide/&quot;&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2. &lt;a href=&quot;http://jamesshore.com/Blog/Dependency-Injection-Demystified.html&quot;&gt;Dependency Injection Demystified&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #999999; font-size: xx-small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Technorati short code : &lt;/span&gt;&lt;span class=&quot;status&quot;&gt;RV6SU2CB76BW&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/4788084995827692123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/12/inject-dependencies-manually.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/4788084995827692123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/4788084995827692123'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/12/inject-dependencies-manually.html' title='Inject Dependencies - Manually'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-3027175776332855861</id><published>2010-12-05T15:32:00.004+05:30</published><updated>2010-12-12T11:24:54.129+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Checked Exception"/><category scheme="http://www.blogger.com/atom/ns#" term="Checked vs Runtime Exception"/><category scheme="http://www.blogger.com/atom/ns#" term="Checked vs unchecked exception"/><title type='text'>Problems with Checked Exception in Java</title><content type='html'>&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span id=&quot;internal-source-marker_0.10310190566852617&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Recap: Exception Hierarchy In Java&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In Java, we have three types of Throwables &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;: &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1. Error and it’s subclasses&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2. Runtime Exception and it’s subclasses&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3. And the rest (Non-Runtime Exceptions)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Exceptions those lie in the third category are called Checked  Exceptions. If a method throws a checked exception, the compiler makes  sure that the API user handles it either by using try-catch block or by  propagating it to the higher layer by adding a throws clause to the  method definition. The throwables belonging to the first and second  category are unchecked in nature. Compiler does not force the API user  to handle them. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The Thumb Rule&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;As  an API author (Somewhere I read that every method is an API, if it is a  public method then it is exposed to the world, if it is a private or  package-private method it is an API for internal usage. I liked the  concept), &lt;u&gt;you should use a checked exception only when you believe that  the API user can recover from the exceptional situation&lt;/u&gt;.&lt;u&gt; If it is not recoverable, Runtime Exception (unchecked throwable) should be used.&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;u&gt; As a rule, errors  are generally reserved for JVM related issues (e.g OutOfMemoryError,  StackOverflowError etc).&lt;/u&gt; So, if a custom exception needs to be written  which you believe, should always be recoverable then extend it from the  Exception. Otherwise for any custom unchecked exception derive it from  Runtime Exception. &lt;/span&gt;&lt;span id=&quot;internal-source-marker_0.04313226772464296&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Hence,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;color: black;&quot;&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Expected + Recoverable -&amp;gt; Checked Exception&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unexpected + Not Recoverable -&amp;gt; Runtime Exception&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt; &lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Problems with Checked Exception&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1.&amp;nbsp;  As mentioned earlier that a method should throw Checked Exception, if  the API author believes that the API user can recover from the  exceptional situation. But, in real life, &lt;u&gt;whether an exception is  recoverable or not depends on the situation&lt;/u&gt; - for the same piece of code  one exception may be recoverable in one context and may not be  recoverable in some other context. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Let’s  take up one example. I work with telecom subscriber provisioning  system. There lies a method which validates the cell phone numbers of  subscribers.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;If an operator tries to create a new subscriber through the UI by  providing an invalid number, the Number Validation Method should throw  back a checked exception, because it is recoverable. The operator would  be asked to re-enter a valid phone number. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The operator is trying to search for the number of a particular  subscriber. It is being read from the DB and then validated using the  same Number Validation Method. If the number is found to be invalid, the method  should throw an unchecked exception, because it is NOT recoverable this time. The  subscriber data has got corrupted in the DB.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;By  throwing a checked exception, the API author is forcing the API user to  handle it. If there is no way to “actually” handle the exception (i.e.  recover from the exceptional situation), what will the user do then? In  such a situation, most of us do one of the following:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Swallow the exception by providing an empty catch block (This is nothing but a bug)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Provide a catch block just to log the occurrence of the exception. (This is also the same)&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; list-style-type: disc; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Catch the exception and re-throw it.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;This is true in 90% of the cases. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Of  course, there is a so called better solution - catch the exception,  convert it to a more meaningful checked exception and pass the ball to  higher level. But, this may lead to another problem as indicated in  point number 3 below. The ideal solution, I believe, is to catch the  checked exception and convert it to an unchecked exception. Although, in  Java, the concept of try-catch was introduced to handle the exceptional  conditions, but it’s very rare to find a catch block where the  exception is really handled. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The bottom line is: &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Things may go beyond API authors “belief” and quickly become messy.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: black; font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Most of the time we use Java’s (checked) exception handling machinery  just to log the exception (and then raise a bug and fix it).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; &lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2.&amp;nbsp;  In my application, I wrote an API which throws one checked exception E1  and published the API to the world. Now, because of some new features,  the implementation of the method has to be changed and it has to throw  two new exceptions, say E2 and E3. If E2 and E3 are checked exceptions,  all the client code which are using the API till date, will break. The  way outs are:&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Catch E2 and E3, then convert them to E1. I believe that defeats the use of exception.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Publish new version of the API.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3.&amp;nbsp;  try, catch is not the only way to handle a checked exception. If the  exception can not be immediately handled, it may be propagated to the  higher layer by declaring throws clause. In the higher layer of the  stack, the exception can be handled in a better way. This may also be  problemetic in cases. Say, for a large, layered application one new API  is being developed. It internally invokes three other APIs. Each of  those three methods in turn throws three checked exceptions. If the new  API is not in a position to handle any of those exceptions immediately  (inside the method code), how many exceptions would be thrown back?  NINE. Will not be it difficult for the client to use the API? &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;4.&amp;nbsp; Another use case of checked exception is worth mentioning. Say, for an  UI application, all the methods in all the classes throw the same user  defined checked exception called GuiBaseException. Different instances  of same exception bubble up from different layers of the code in  different exceptional situations and all of them gets handled by the  same exception handler at the top most layer. With this approach,  everybody is happy - the API author is happy because he believes that  “recoverable” exceptions should always be checked, the API user is happy  because he is handling them without any pain and effort (also without making  the code dirty by introducing try and catch here and there). Wonderful  solution, but it completely defeats the very idea of exception handling!&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Then What?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span id=&quot;internal-source-marker_0.04313226772464296&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Though  Checked Exception conveys an warning message to the user “Heey! you  need to pay attention”, but in most of the cases, that warning is  ignored. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;With  the usage of ONLY Unchecked Exception (i.e. by avoiding checked  exceptions), problems 1, 2, 3 can really be addressed. No body is going  to force the API user to handle the exception. Every thing would be  properly documented. The API user would decide whether to handle it or  not depending on the context.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Ok,  this one liner may not be a full proof solution. In fact, I am not  trying to give a solution also. The aim of this post is just to capture  the problems with checked exceptions. Yes, accept it or not; &lt;u&gt;Checked  Exceptions are problematic. &lt;/u&gt;&lt;/span&gt;&lt;span id=&quot;internal-source-marker_0.04313226772464296&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;Java  did an experiment by introducing this concept with a lot of great  expectations, but as per my understanding, over time it has been proved to be a failure. &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;u&gt; C# does not have checked exceptions and the  same is true for other JVM based languages like Groovy and Scala. &lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Dear Reader, what do you feel about it? Which camp are you in - Checked or Unchecked? :-)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Further Reading:&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://www.artima.com/intv/handcuffs2.html&quot;&gt;The Trouble with Checked Exceptions&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://cafe.elharo.com/programming/bruce-eckel-is-wrong/&quot;&gt;Bruce Eckel is Wrong&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Effective Java - &lt;/span&gt;&lt;/span&gt;&lt;span id=&quot;internal-source-marker_0.9811161199920864&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Josh Bloch&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://googletesting.blogspot.com/2009/09/checked-exceptions-i-love-you-but-you.html&quot;&gt;&lt;span id=&quot;internal-source-marker_0.9811161199920864&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Checked exceptions I love you, but you have to go&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://beust.com/weblog/2010/04/25/improving-exceptions/&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Improving exceptions &lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/3027175776332855861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/12/problems-with-checked-exception-in-java.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/3027175776332855861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/3027175776332855861'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/12/problems-with-checked-exception-in-java.html' title='Problems with Checked Exception in Java'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-7622558626224878832</id><published>2010-11-28T16:28:00.000+05:30</published><updated>2010-11-28T16:28:50.539+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="gui load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="gui traffic testing"/><category scheme="http://www.blogger.com/atom/ns#" term="JMeter"/><category scheme="http://www.blogger.com/atom/ns#" term="jmeter trouble shoot"/><title type='text'>Load Testing of GUI using JMeter</title><content type='html'>&lt;div style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
 mso-para-margin:0cm;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;What is JMeter?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;JMeter is a Java based Open Source application which may be used for load/traffic testing of Web Applications. &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Quote from the &lt;a href=&quot;http://jakarta.apache.org/jmeter/&quot;&gt;JMeter home page:&lt;/a&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;Apache JMeter may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to make a graphical analysis of performance or to test your server/script/object behavior under heavy concurrent load.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;What am I trying to do with JMeter?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;I have used JMeter to do load testing of GUI. I wanted to record some regular transaction done in the GUI, like login, browse to different pages, display data (i.e search data from the DB), modify data and finally log out. Once this test case is recorded, then simulate a scenario where multiple users would do the same set of transactions simultaneously. My target was to find out the maximum number possible simultaneous sessions in my GUI.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;How does JMeter do this?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;1&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Initially      JMeter needs to be configured to sit between the browser and the target server      (on which GUI is running) and then it records all the HTTP requests sent      by the browser to the server. If the target GUI accepts only HTTPS      requests, then at this phase the browser should send HTTP requests (and NOT      HTTPS) to the JMeter, JMeter records those requests and finally encrypt and      send those to the server. Reverse thing happens for HTTPS response –      JMeter receives the responses from the server, decrypts those, records and      sends the HTTP responses back to the browser. The logical entity that is      responsible for this HTTP message recording is called Http Proxy manager      (described later).&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;2&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Once      the recording is done, JMeter can be configured to start a large number of      simultaneous threads – each thread represents one user sending/receiving      the same set of requests/responses recorded in the first step. Now onwards,      it’s between the JMeter and the server; browser is no longer used. Not      surprisingly, JMeter maintains separate Http sessions for each user. The      component responsible for this is called thread group.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;3&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The      result can be checked by using something called “listeners” – there are      different flavors for the same.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;How to use JMeter?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;1&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Download      JMeter from the &lt;a href=&quot;http://jakarta.apache.org/site/downloads/downloads_jmeter.cgi&quot;&gt;here&lt;/a&gt;.&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;2&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;In      case the server accessed and the desktop on which JMeter is launched      reside in the same network run jmeter.bat from &lt;span class=&quot;key&quot;&gt;$JMETER_DIR&lt;/span&gt;/bin      or just type “jmeter” in the command prompt.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;3&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;If a      proxy sits in between the JMeter and the server, issue the following      command from the command prompt:&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span lang=&quot;PT-BR&quot;&gt; &lt;i&gt;jmeter -H &amp;lt;my.proxy.server&amp;gt; -P &amp;lt;port&amp;gt; -u &amp;lt;username&amp;gt; -a &amp;lt;password&amp;gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;4&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Add      a Thread Group to the Test Plan by right-clicking on Test Plan and Add      -&amp;gt; Thread Group. Number of threads indicates the number of users to be      simulated. Ramp up period is the time over which all the sessions will      start uniformly one by one.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;5&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Add      the HTTP Cookie Manager to enable session tracking by right-clicking      anywhere in the Test Plan hierarchy Add -&amp;gt; Config Element -&amp;gt; HTTP      Cookie Manager. Set the cookie policy to compatibility.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol start=&quot;6&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Select the thread group. Right click “add -&amp;gt; Config element -&amp;gt;      Http Request Defaults”. Set the Server name or IP to server’s IP. Keep pot      number/path empty. Set Protocol to HTTP.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;7&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Add      a Recording Controller to the Thread Group by right-clicking on Thread      Group -&amp;gt; Add -&amp;gt; Logic Controller -&amp;gt; Recording Controller. Rename      the Recording Controller to take a suitable value. All the Http Requests recorded      would be saved under this recording controller.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;8&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Select      workbench. Right click on workbench and add the Http proxy Server: add      -&amp;gt; non-&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;test elements -&amp;gt;      Http Proxy Server. Port field - Enter “9090” (Any other value would do). Go      to Target Controller – click on the drop down and select the recording      controller created in step 6. As mentioned earlier, Http Proxy Server is      the element which would record the Http requests and 9090 is the port on      which the JMeter recording controller would run.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;9&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;In      the same window, click on the Attempt Http Spoofing. It ensures that while      recording the test case, JMeter encrypts the HTTP request before sending      to the server and decrypts the HTTP response after receiving it back from      the same.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;10&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Add the following to the URL patterns to      exclude:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.png&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.gif&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.jpg&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.php&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.jsp&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.html&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.htm&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.js&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 108pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;.*\.css&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;11&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Add Gaussian Random Timer under Http Proxy      Server. Right click on the Http Proxy Server, add -&amp;gt; Timer -&amp;gt;      Gaussian Random Timer. Put the following values:&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 72pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Deviation (in milliseconds) -&amp;gt; 500.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 72pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Constant Delay Offset (in milliseconds) -&amp;gt; {$T}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 72pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;    &lt;w:UseFELayout/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;  &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;  &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt; &lt;style&gt;
 /* Style Definitions */
 table.MsoNormalTable
 {mso-style-name:&quot;Table Normal&quot;;
 mso-tstyle-rowband-size:0;
 mso-tstyle-colband-size:0;
 mso-style-noshow:yes;
 mso-style-parent:&quot;&quot;;
 mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
 mso-para-margin:0cm;
 mso-para-margin-bottom:.0001pt;
 mso-pagination:widow-orphan;
 font-size:10.0pt;
 font-family:&quot;Times New Roman&quot;;
 mso-ansi-language:#0400;
 mso-fareast-language:#0400;
 mso-bidi-language:#0400;}
&lt;/style&gt; &lt;![endif]--&gt;  &lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Gaussian random timer should be used if you want JMeter to record the time taken by the human user between clicking different links across the GUI. While executing the test case, the HTTP requests would be sent one after another maintaining the same time gap (as taken by the user). If Gaussian random timer is not used, all the requests would be pumped to the server at once. I am sure that no body wants to test such an unrealistic scenario.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;12&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Add Listeners to the      Thread Group by right-clicking on Thread Group -&amp;gt; Add -&amp;gt; Listener      -&amp;gt; View Results in Table &amp;amp; View Results Tree &amp;amp; Aggregate      Report. Different Listeners would represent the result (request sent,      response received, time stamp, success/failure rate etc) in different form      helping you to analyze.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;13&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Go back to the Http Proxy Server. Now we      are ready to record the test cases. So, click on Start button.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;ol start=&quot;14&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Open the browser and configure proxy      settings to point to JMeter&#39;s proxy server. For Internet Explorer, click      on Tools and select Internet Options, click on the Connections tab, click      on LAN Settings, check the &#39;Use proxy server for LAN... &#39; and set the      address to &#39;localhost&#39; and port to &#39;9090&#39; (i.e. the port at which JMeter      is configured to run). Now the browser will send the requests to the      JMeter which in turn will send it to the server. JMeter will record them      in between.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Go to I.E. In the address      bar type the following:&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;http://&amp;lt;Test Machine’s IP&amp;gt;/&amp;lt;Link&amp;gt;/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span&gt;Note, even if the server supports only      secured connection, we are not using “https” here. Since, JMeter has      already been configured to do https spoofing, browser will send normal      http request to Jmeter and Jmeter will do further encryption before      sending the requests to the server.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;ol start=&quot;16&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Login to the      GUI normally. And do some operations. Navigate through, perform      actions etc as per your use case.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;17&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Click on the Stop button from      the Proxy Server once the recording is finished. All the requests will be      stored under the recording controller. &lt;b&gt;If the HTTP requests are not      visible there, you must have missed something in the previous steps. Have      a look. Fix it and then come back.&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;ol start=&quot;18&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Finally, run the test case      by hitting Ctrl+R. A green box on the upper right corner should be visible      indicating the test is running. The figure beside that green field      indicates the number of threads (simulated users running at any instance      of time). &lt;span&gt;&amp;nbsp;&lt;/span&gt;Different listeners will      give detailed information about the test case while it is running. The box      will turn gray once the execution stops. &lt;span&gt;&amp;nbsp;&lt;/span&gt;Go back to the listeners to find the      results.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Trouble shooting:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;ol start=&quot;1&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-top: 0cm;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;If      you find that requests are failing with some errors and if you are not      sure whether the requests are really reaching the server or not, you      should take a look of the access.log (For apache tomcat, the location of      this log is configurable). access.log captures all the requests reaching      the server and the corresponding HTTP response code.&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;If      you are encountering the following&lt;span&gt;&amp;nbsp;      &lt;/span&gt;exception:&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 72pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;&lt;b&gt;java.net.BindException: Address already in use: connect&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 72pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt; text-indent: 18pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;it’s with the Windows. You need to increase the number of ports the OS is using for establishing outbound TCP/IP connections.To fix it, Run regedit. Go to:&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\ Parameters&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 18pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Click on the Parameters. Create a new DWORD value with name MaxUserPort, Value Data -&amp;gt; 65534, Base -&amp;gt; Decimal. Then restart the system.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Arial,Helvetica,sans-serif; margin-left: 36pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;Further Reading: &lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/jmeter/usermanual/index.html&quot;&gt;The Official JMeter User&#39;s Manual&lt;/a&gt;&lt;b&gt; &lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;a href=&quot;http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf%20&quot;&gt;JMeter Proxy Step By Step&lt;/a&gt;&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;span style=&quot;font-family: Arial,Helvetica,sans-serif; font-size: small;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/7622558626224878832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/11/load-testing-of-gui-using-jmeter.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/7622558626224878832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/7622558626224878832'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/11/load-testing-of-gui-using-jmeter.html' title='Load Testing of GUI using JMeter'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-7019131139384255369</id><published>2010-11-14T17:52:00.002+05:30</published><updated>2010-11-14T17:56:50.023+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="singleton"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton anti pattern"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton dependency injection"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton disadvantage"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton global access"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton global state"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton global variable"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton pattern"/><title type='text'>Do I really need a Singleton?</title><content type='html'>&lt;span id=&quot;internal-source-marker_0.4062138082083889&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Recently  I have published a post on &quot;&lt;a href=&quot;http://deathbycode.blogspot.com/2010/11/question-is-really-simple-why-do-i-need.html&quot;&gt;Static Vs Singleton&lt;/a&gt;&quot;. While working on the topic,  I slipped into another: “&lt;a href=&quot;http://stackoverflow.com/questions/137975/what-is-so-bad-about-singletons&quot;&gt;Are Singletons really that bad&lt;/a&gt;?”.  I started reading further. Trust me, it’s a holy war! And here is the result of my investigation.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;To start with let’s take a look of the definition of the pattern. Singleton as a pattern provides two functionality:&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1. &lt;i&gt;Global access to an object&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;&quot;&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2. &lt;i&gt;Only one unique instance of the object across the system&lt;/i&gt; (in some cases, limited number of instances)&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;So, what is bad about Singleton? Why Singletons are so bad?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1. &amp;nbsp;In a Singleton, we have a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: italic; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;private static final instance&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; of that class and we provide a &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: italic; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;public static getInstance()&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;  method to access that instance. This means that the instance can be  accessed/used from any where under the Sun. A developer can use the  instance within a method form any other class just by invoking the &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: italic; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;getInstance()&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.  He is not bound to declare the dependency in the method signature as he  is not explicitly passing that instance through the arguments. Does not  this create unwanted dependency and close coupling? Yes, it does. The  worst thing is ONLY the programmer who has created the dependency knows  about it, but the user of the method who came later never notices it as  the dependency is not explicitly mentioned. So, it is very easy to get a  Singleton, use it and then forget it for the time being. Most of the  programmers (including me :-)) goes on using it almost every where  creating &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;  hidden chain and finally cycle of dependencies. When the bubble bursts,  its too late. Only option left is to refactor the code heavily. So, the  first point - &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;Singletons expose a global variables and global variables creates unwanted dependencies&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2.  By this time it is clear that use of Singleton creates a very tight  coupling between it (the Singleton) and user who uses it. &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;This tight coupling makes it difficult to test the user alone&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.  If I want to test the user, the Singleton has to be tested also (I have  to first create the Singleton and then test the user - maintain a  particular order). But, that ‘s not what I am supposed to do! Ideally  the singleton should be passed in the user classes’ constructor as a  parameter (or in the method as an argument in case a method is being  tested). This way, the tester can easily make a mock of the Singleton  and pass it as a parameter or argument.&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: blue; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3. Another accusation against the Singleton is that &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;it violates the Single Responsibility Principle&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;.  A Singleton class holds the business logic as well as it’s own creation  logic. But the SPR principle states that a class should have one &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: italic; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;and only one&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; responsibility. To be strict enough, one of the responsibilities should be moved out of the Singleton class. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Point  number two of Singleton definition doesn&#39;t &amp;nbsp;have a problem. There may  be a number of real use cases where only one instance (or limited number  of instances) across the system is required. But, the big question is  can I have a single instance without exposing it globally? &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: italic; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;Dependency Injection&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; is the answer. Let the Singleton be created during the initialization of the application and then pass that unique instance &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: italic; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;downwards (from the top layers to the bottom)&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;  as parameter/argument to all the objects those need it. The  getInstance() method should be used ONLY when it is necessary. This is a  much cleaner approach. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;As  per my understanding, the primary purpose of this pattern is to provide  a system wide single instance. Global access is secondary. Otherwise,  the name of this pattern might have been Globalton! Use it properly and  ONLY when it is really needed. But finally, I believe &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;avoiding it would be better than abusing it&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;. &amp;nbsp;Don’t you think so?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: red; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The last WARNING is applicable also &lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: red; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;for me&amp;nbsp; :-)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Further Reading:&lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1.&lt;a href=&quot;http://stackoverflow.com/questions/137975/what-is-so-bad-about-singletons&quot;&gt; StackOverflow.com&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2. &lt;a href=&quot;http://code.google.com/p/google-singleton-detector/wiki/WhySingletonsAreControversial&quot;&gt;Why Singletons Are Controversial &lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;3. &lt;a href=&quot;http://googletesting.blogspot.com/2008/08/root-cause-of-singletons.html&quot;&gt;Root Cause of Singletons&lt;/a&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;4. &lt;a href=&quot;http://www.blogger.com/goog_1563498692&quot;&gt;Singletons are Pathological Liars&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;http://www.blogger.com/goog_1563498692&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: small; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;5. &lt;a href=&quot;http://martinfowler.com/articles/injection.html&quot;&gt;Inversion of Control Containers and the Dependency Injection pattern&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a href=&quot;http://martinfowler.com/articles/injection.html&quot;&gt;&lt;span style=&quot;background-color: transparent; color: #000099; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/7019131139384255369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/11/do-i-really-need-singleton.html#comment-form' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/7019131139384255369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/7019131139384255369'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/11/do-i-really-need-singleton.html' title='Do I really need a Singleton?'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-5051236516741650226</id><published>2010-11-13T21:22:00.003+05:30</published><updated>2010-12-19T09:04:46.178+05:30</updated><title type='text'>Java Sundae Fudge</title><content type='html'>My intention to create this blog entry is to put all java corner cases, quirkiness as we face in one place. I info, Fun facts etc all are welcome..&lt;br /&gt;
&lt;br /&gt;
1. synchronized method has a flag set (ACC_SYNCHRONIZED) in its method_ref entry in class file hence JVM internally acquires/releases monitor. synchronized block does not have this. Hence bytecode of synchronized method yields more no. of instructions.&lt;br /&gt;
&lt;br /&gt;
2. JVM spec does not mandate a jvm implementation has to have some geeky GC techniques. It merely tells JVM implementation has to have some sort of memory management technique. If I have enormous, never ending, self-population kindda memory I can implement a JVM without having Garbage collectors :D</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/5051236516741650226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/11/java-sundae-fudge.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/5051236516741650226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/5051236516741650226'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/11/java-sundae-fudge.html' title='Java Sundae Fudge'/><author><name>Sourav</name><uri>http://www.blogger.com/profile/06746410302862646012</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-6609228938492443365</id><published>2010-11-13T19:30:00.005+05:30</published><updated>2010-11-14T01:04:03.310+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="comparison between toArray"/><category scheme="http://www.blogger.com/atom/ns#" term="diff between toArray"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="toArray()"/><category scheme="http://www.blogger.com/atom/ns#" term="toArray(T[])"/><title type='text'>toArray() Vs. toArray(T[])</title><content type='html'>java.util.ArrayList has 2 conversion methods defined to get an array out of the elements stored in the list.&lt;br /&gt;&lt;br /&gt;1. public &lt;a title=&quot;class in java.lang&quot;&gt;Object&lt;/a&gt;[] &lt;b&gt;toArray&lt;/b&gt;()&lt;br /&gt;2. public &lt;t&gt; T[] &lt;b&gt;toArray&lt;/b&gt;(T[] a), this is a new addtion from java 1.5 onwards.&lt;br /&gt;&lt;br /&gt;So a developer (included me :)) who is placed against java 1.5 arena may be in dilemma which one to use.  Developers who are like minded as myself will at first glance be tempted to use 1st method as it has minimal signature; no parameters. But soon they use this they have to cast it to their respective type to appease compiler as the method returns  Object[].&lt;br /&gt;&lt;br /&gt;Something like this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;List&lt;string&gt; list = new ArrayList&lt;string&gt;();&lt;/string&gt;&lt;/string&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;list.add(&quot;Hello&quot;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;list.add(&quot;World&quot;);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;String[] strArr = (String[]) list.toArray();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What will follow afterwards?...&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;Exception in thread &quot;main&quot; java.lang.ClassCastException: [Ljava.lang.Object;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Voila!!! It will throw ClassCastException during execution. So what went wrong in the first place? We have defined a list of string and thanks to &#39;generics social police&#39;, we are not allowed to add any other types in the list but Strings. So so far so good. Our list contains all Strings. Then we want to make out an array from this and.. it bombed!!!&lt;br /&gt;&lt;br /&gt;Here lies the secret. In java arrays are full fledged objects. And so it also has all idiosyncracies/tantrums that reference types have like inheritence etc.&lt;br /&gt;&lt;br /&gt;Java arrays are covariant in nature. It means if A is subtype of B then A[] is also subtype of B[]. This causes enough problem pre-generics days. As evident from the above example it bombs at runtime if the target array(TC) type is not actually an instance of compatible type of source array (SC) type.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As String(TC) and Object(SC) are in same hierarchy and String is subtype of Object hence String[] is also subtype of Object[]. Thus it passes compile time legality check while using casting conversion expression. (We cannot cast String to Integer or int[] to double[] as they do not fall into same hierarchy.. they are mere siblings)&lt;br /&gt;............&lt;br /&gt;&lt;br /&gt;The runtime validation during casting (the execution of bytecode instruction.. the actual casting) failing because toArray() internally creates pure Object[] instance.  Hence in runtime the 2 objects differ.&lt;br /&gt;&lt;br /&gt;public Object[] toArray() {&lt;br /&gt;  Object[] result = new Object[size]; // This is the source of confusion..&lt;br /&gt;  System.arraycopy(elementData, 0, result, 0, size);&lt;br /&gt;  return result;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;So not only we are getting the type as Object[] it actually points to real Object[] instance; Would it be pointing to String[] the runtime casting will not fail.&lt;br /&gt;&lt;br /&gt;e.g:&lt;br /&gt;Object[] oa = new String[10];&lt;br /&gt;String[] sa = (String[]) oa; Passes both compile time and runtime validation&lt;br /&gt;&lt;br /&gt;&lt;/t&gt;Object[] oa = new Integer[10];&lt;br /&gt;String[] sa = (String[]) oa; Passes only compile time and fails at runtime validation&lt;br /&gt;&lt;br /&gt;&lt;t&gt;&lt;br /&gt;The mystery is now revealed. But then what is the point of keeping such a method?&lt;br /&gt;We should not forget that the method is dated back pre-generics days of java. So they did not have other choices. To use this method, we have to iterate through the array and cast appropiately.(I those days thers is only raw List available).&lt;br /&gt;&lt;br /&gt;So we can now see which tempted us choosing this method at first place has its own price.&lt;br /&gt;&lt;br /&gt;Here the 2nd method.&lt;br /&gt;&lt;br /&gt;From the method signature it is clear that we do not have to enter any casting couch problems (pun intended :D) in this case.&lt;br /&gt;&lt;br /&gt;But one thing is worth to know :&lt;br /&gt;&lt;br /&gt;a)  From the passed in array, the arraylist class finds the correct component type of the target array using reflection. This is the MOST PRIMARY reason of passing the array. Even if we pass 0-length array it will not throw ArrayIndexOutOfBoundsException.&lt;br /&gt;&lt;br /&gt;So in a nutshell, Use toArray(T[])  insted of toArray() from java1.5+.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/t&gt;</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/6609228938492443365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/11/toarray-vs-toarrayt.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/6609228938492443365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/6609228938492443365'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/11/toarray-vs-toarrayt.html' title='toArray() Vs. toArray(T[])'/><author><name>Sourav</name><uri>http://www.blogger.com/profile/06746410302862646012</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-822306570451899891</id><published>2010-11-13T19:10:00.004+05:30</published><updated>2010-11-20T16:46:39.819+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="singleton"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton pattern"/><category scheme="http://www.blogger.com/atom/ns#" term="singleton vs static"/><category scheme="http://www.blogger.com/atom/ns#" term="static"/><category scheme="http://www.blogger.com/atom/ns#" term="static class"/><category scheme="http://www.blogger.com/atom/ns#" term="static method"/><title type='text'>Singleton Vs Static</title><content type='html'>&lt;div style=&quot;color: black;&quot;&gt;&lt;span id=&quot;internal-source-marker_0.17020597574808805&quot; style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The  question is really simple, why do I need a Singleton? Why a class  with static methods/variables will not do the same what a singleton is  supposed to do?&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;I never thought about that. So, I googled for “Singleton vs Static” and here is the excerpt from the results.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;A  class with static utility methods can be used for exposing standalone  methods (e.g. utility/helper methods). Such a class holds little or no  state. On the other side a singleton, should be used whenever there is a  state to store. The main advantage of Singleton over static (i.e. a  class with static utility methods) is, it may use polymorphism. Ideally,  a singleton should return different implementations of the class at  runtime depending on the use case. To explain it further, let’s have a  look of java.lang.Runtime class. The description of the class says:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: italic; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Every  Java application has a single instance of class Runtime that allows the  application to interface with the environment in which the application  is running. The current runtime can be obtained from the getRuntime  method. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: italic; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Actually,  Runtime.getRuntime() method returns a singleton object - an object which  depends on the particular platform over which the JVM is running. Thus,  different implementation of JVM will provide an instance of different subclasses  of Runtime itself, which is designed to run on that specific  platform/OS. &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;It  sounds similar to factory! Is Singleton a factory? The idea is,  Singletons can be extended into a factory. The whole process of object  creation is abstracted from the API user. And hence it can be  maintained/extended/changed easily. But, the fundamental difference  between these two should also be kept in mind. A factory returns a new  instance on each invocation of the getter method, whereas a Singleton always returns the same  instance of the class. But, in most of the cases we don’t use Singleton  pattern in such a way and hence Singletons does not really offer much  advantage over the static.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;In  addition to this, if I have a Singleton, I can implement interfaces and  extend classes. Lazy initialization of Singletons are possible,  i.e. the Singleton object may have a shorter life time than the  application containing it. MySingleton.getInstance() returns an actual  object. These advantages are missing with a class with static utility  methods.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;To  summarize, if you want to write a class with some stateless (or almost  stateless) static methods, go for a class with static methods and static  variables. If you need something more, as I have mentioned before, then  Singleton should be your choice. But, remember, before banking on the  static, analyze and think twice. It should never be the case that in  future you have to rewrite the code and go back to the Singleton!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;u&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;So, the final question. Is Singleton a pattern with all good? I am afraid. The answer is NO!&lt;/span&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;u&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Further Reading: &lt;/span&gt;&lt;/u&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Sun  Java Forum has a nice discussion on this . But, after migration to  Oracle, I am not able to find it out. However a simple google search  should do! &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://java.sun.com/developer/technicalArticles/Programming/singletons/&quot;&gt;When is a Singleton not a Singleton?&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/822306570451899891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/11/question-is-really-simple-why-do-i-need.html#comment-form' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/822306570451899891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/822306570451899891'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/11/question-is-really-simple-why-do-i-need.html' title='Singleton Vs Static'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2892701085334104567.post-4862815379754981168</id><published>2010-10-29T23:12:00.005+05:30</published><updated>2010-12-11T15:09:35.796+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Java Process"/><category scheme="http://www.blogger.com/atom/ns#" term="Java Thread"/><category scheme="http://www.blogger.com/atom/ns#" term="Process vs Thread"/><category scheme="http://www.blogger.com/atom/ns#" term="Thread vs Process"/><category scheme="http://www.blogger.com/atom/ns#" term="What is Process"/><title type='text'>My Study Notes : Process and Thread in Java</title><content type='html'>&lt;span id=&quot;internal-source-marker_0.9143334923330747&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;The  other day, a friend of mine asked me the question “What is the  difference between a Java process or thread?” My instant reply was,  thread is a light weight process. But of course it was not a  complete answer. After doing some amount of googling, I was able to  reach to a logical conclusion. Here is the study note capturing those  information.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;When  we start an application (say our old friend Tomcat), one instance of  JVM starts. In most cases, an instance of JVM generally runs as a single  process. If multiple Java application runs at the same time, that will  start multiple instances of JVM and hence multiple processes. Of course,  this is a much simplified version of the story. In reality an  application may run as a set of processes communicating with each other  through something called inter process communication (IPC) mechanism,  but as an end user, we get a feel that only one process is getting  executed.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Now,  lets have a look at &amp;nbsp;the definition of Process. As per Sun’s Java  Tutorial, a process is an independent, self-contained entity to which  system allocates private set of resources, CPU time and importantly  memory. As mentioned earlier, each instance of JVM runs as a single  process and hence it has also got it&#39;s own set of memory (separate heap,  method area etc which does not overlap with other instances of JVMs  running on the system at the same time). &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;So,  what about thread? A thread can be called as a light weight process,  i.e. it does not require as much resource as a process. A process  contains multiple threads and hence all the threads share the common set  of resources among themselves (including the memory). In the context of  JVM, all the threads share the same heap and method area (but  individual stacks). And of course, the inter communication between the  threads is cheaper than the IPC. Thus, an application has at least one  process and each process has at least one thread. That thread in turn  may start several other threads at the runtime.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Now,  it’s time is to clear one important doubt. Although each process may  contain multiple threads, at any point of time, in a &quot;single process  supporting system&quot;, only one thread and hence only process may get  executed (As a java developer we can consider, at any instance of time  there may multiple &quot;runnable&quot; threads but only one &quot;running&quot; thread). &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;But  why? To answer this question, we need to have some very basic idea  about JVM. JVM can be divided into two logical entities: the class  loader subsystem and the execution engine. The class loader subsystem  loads the class files (i.e. imports the byte codes from the class  files), whereas the execution engine executes the instruction sets  (which is nothing but the code we write for the application/program)  embedded in the byte codes. Here come the BIG surprise, each thread of a  running application, is nothing but an instance of the execution  engine. Through out the life, a thread executes the byte codes. This is  true for all the non-daemon threads and is not applicable for the daemon  threads (e.g. the Garbage Collection Thread) invisible to the running  application. And not surprisingly, for a single processor system (with a  single core), only one instruction can be executed at any point of  time.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: black;&quot;&gt;&lt;i style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Further reading: &lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background-color: transparent; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;1. &lt;a href=&quot;http://download.oracle.com/javase/tutorial/essential/concurrency/index.html&quot;&gt;Sun Java&amp;nbsp; Tutorial On Concurrency&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;background-color: transparent; color: black; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;2. &lt;a href=&quot;http://www.blogger.com/goog_864187378&quot;&gt;Inside Java Virtual Machine - &lt;/a&gt;&lt;/span&gt;&lt;a href=&quot;http://www.artima.com/insidejvm/blurb.html&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;as&quot;&gt;Bill Venners&lt;/span&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://deathbycode.blogspot.com/feeds/4862815379754981168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://deathbycode.blogspot.com/2010/10/my-study-note-process-and-thread-in.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/4862815379754981168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2892701085334104567/posts/default/4862815379754981168'/><link rel='alternate' type='text/html' href='http://deathbycode.blogspot.com/2010/10/my-study-note-process-and-thread-in.html' title='My Study Notes : Process and Thread in Java'/><author><name>Arnab Biswas</name><uri>http://www.blogger.com/profile/04713075170640671243</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjTrSr8tcXLfpZTHXYsOBfTK4N1y3et3Q6okC0lmVzPsZ_YbJjvAdffORTL6lkUIFNH6DM4vUURF5O3wmtKiUiXpUujvEn82ZP3xjzImG68vVCElRq5JnMy7UzLm8hAw/s1600/*'/></author><thr:total>3</thr:total></entry></feed>