<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xml:lang="en" xml:base="http://realitydrivendeveloper.com/wp-atom.php">
	<title type="text">Software development in the real world</title>
	<subtitle type="text" />

	<updated>2009-08-15T07:34:28Z</updated>
	<generator uri="http://wordpress.org/" version="2.9.1">WordPress</generator>

	<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com" />
	<id>http://realitydrivendeveloper.com/feed/atom/</id>
	

			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SoftwareDevelopmentInTheRealWorld_posts" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="softwaredevelopmentintherealworld_posts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[WorldTimeEngine: How to show all times in user&#8217;s local time zone]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2009/08/worldtimeengine-how-to-show-all-times-in-users-local-time-zone/" />
		<id>http://realitydrivendeveloper.com/?p=102</id>
		<updated>2009-08-15T07:34:28Z</updated>
		<published>2009-08-15T07:24:24Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="development" /><category scheme="http://realitydrivendeveloper.com" term="API" /><category scheme="http://realitydrivendeveloper.com" term="worldtimeengine" />		<summary type="html"><![CDATA[When I visit some site and it shows me that some action performed at some time &#8211; it confuses me a little, because I don&#8217;t know in which time zone is this time.
Sure, you can spend some time to read about one&#8217;s time zone settings and rules, BUT Don&#8217;t make me think. Every website uses [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2009/08/worldtimeengine-how-to-show-all-times-in-users-local-time-zone/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ywmPj8Awl7J7_CP64dormiu-rmA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ywmPj8Awl7J7_CP64dormiu-rmA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ywmPj8Awl7J7_CP64dormiu-rmA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ywmPj8Awl7J7_CP64dormiu-rmA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;When I visit some site and it shows me that some action performed at some time &amp;#8211; it confuses me a little, because I don&amp;#8217;t know in which time zone is this time.&lt;br /&gt;
Sure, you can spend some time to read about one&amp;#8217;s time zone settings and rules, BUT &lt;strong&gt;&lt;a href="http://en.wikipedia.org/wiki/Don't_Make_Me_Think"&gt;Don&amp;#8217;t make me think&lt;/a&gt;&lt;/strong&gt;. Every website uses his own rules for time setting &amp;#8211; some uses &lt;strong&gt;GMT zone&lt;/strong&gt;, some says something like: London or New York or Moscow time.&lt;/p&gt;
&lt;p&gt;I, as a potential user, will be much more satisfied if I would see the only one explanation:&lt;br /&gt;
&lt;blockquote&gt;All dates and times are in your local time zone settings.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Sounds easy, yet powerful. And on the other hand &amp;#8211; hard to implement such flexibility.. But it&amp;#8217;s really not.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-102"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Recently, I was working on some site, where exact clear time was essential. It was scheduled message sending feature. We had users from many countries in great variety of time zones.&lt;br /&gt;
My first idea about how this feature can be implemented &amp;#8211; was in involvement of time zones select option, where user can choose his time zone to say to us his local time. But this isn&amp;#8217;t very reliable because in one particular GMT time zone many can be located lots of countries with their own time setting rules.&lt;/p&gt;
&lt;p&gt;Every single country decides every year when DST transitions will occur.  There can be any number of offset transitions during the year: 0, 1, 2, 3, 4 etc. There can be offset transitions that aren&amp;#8217;t DST transitions.  For example, in 1946 Hawaii changed its standard time offset from -10.5 hours to -10 hours&amp;#8211;and this had nothing to do with DST.  &lt;/p&gt;
&lt;p&gt;So we couldn&amp;#8217;t count neither on GMT zone to be sure for 100%, nor for country&amp;#8217;s capital GMT offset(Russia, USA, Canada and so on).&lt;/p&gt;
&lt;p&gt;The answer was very simple and beautiful.&lt;/p&gt;
&lt;p&gt;There is &lt;b&gt;&lt;a href="http://worldtimeengine.com"&gt;WorldTimeEngine&lt;/a&gt;&lt;/b&gt; service, which provides a simple &lt;b&gt;API&lt;/b&gt; for retrieving user&amp;#8217;s local time based on his IP address. It costs not so much, and this information can be cached for quite a long period of time.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve written some simple class, which calculates offset between our server&amp;#8217;s time(London, GMT+0) and user&amp;#8217;s local time, then it saves this offset to the IP address &amp;#8211; Offset dictionary stored in database. So, when we show some time-related information, we implement this offset for every single timestamp &amp;#8211; and user always see all info in his local time settings.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Very useful.&lt;/strong&gt;&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2009/08/worldtimeengine-how-to-show-all-times-in-users-local-time-zone/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2009/08/worldtimeengine-how-to-show-all-times-in-users-local-time-zone/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[Memory Palace method example: Strategy pattern]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2009/03/memory-palace-method-example-strategy-pattern/" />
		<id>http://realitydrivendeveloper.com/?p=47</id>
		<updated>2009-07-30T13:17:39Z</updated>
		<published>2009-03-05T17:41:29Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="Object oriented programming" /><category scheme="http://realitydrivendeveloper.com" term="design patterns" /><category scheme="http://realitydrivendeveloper.com" term="GoF" /><category scheme="http://realitydrivendeveloper.com" term="memory palace" /><category scheme="http://realitydrivendeveloper.com" term="mnemonics" /><category scheme="http://realitydrivendeveloper.com" term="strategy pattern" />		<summary type="html"><![CDATA[This post is a sequel of previous How to start using Design Patterns post, describing the Memory Palace memorization method. I recommend you to read it before starting to read this post.
For example, I can use my sitting room as a basis for the remembering path. In this room I have the following objects:
Table, big [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2009/03/memory-palace-method-example-strategy-pattern/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/FadipFYpEyNLiA4nGmpA971DA_s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FadipFYpEyNLiA4nGmpA971DA_s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/FadipFYpEyNLiA4nGmpA971DA_s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/FadipFYpEyNLiA4nGmpA971DA_s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;This post is a sequel of previous &lt;a href="http://realitydrivendeveloper.com/2009/02/how-to-start-using-design-patterns/"&gt;How to start using Design Patterns&lt;/a&gt; post, describing the Memory Palace memorization method. I recommend you to read &lt;a href="http://realitydrivendeveloper.com/2009/02/how-to-start-using-design-patterns/"&gt;it&lt;/a&gt; before starting to read this post.&lt;/p&gt;
&lt;p&gt;For example, I can use my sitting room as a basis for the remembering path. In this room I have the following objects:&lt;br /&gt;
Table, big bright window, lamp, sofa, picture on the wall, small bookcase, CD rack, telephone, television, DVD player, chair, mirror, black and white photographs, etc.&lt;/p&gt;
&lt;p&gt;I want to put all the units required for remembering the StrategyContext implementation in that room. I&amp;#8217;ll start from window and will move to the door out of the room.&lt;/p&gt;
&lt;p&gt;When I hear the word &amp;#8220;strategy&amp;#8221;, the first image comes to my mind is an ancient roman warrior with armors. &amp;#8220;Context&amp;#8221; associates with Jacuzzi for me(something that surrounds you). So I &amp;#8220;see&amp;#8221; the roman warrior sitting in the Jacuzzi(pay attention at bubbles and moist air in the room).&lt;/p&gt;
&lt;p&gt;Here is an example implementation of the GoF Strategy pattern, main concept of which we want to remember:&lt;br /&gt;
I&amp;#8217;ve taken it at &lt;a href="http://sourcemaking.com/design_patterns/strategy/php"&gt;Strategy PHP example&lt;/a&gt; from &lt;a href="http://sourcemaking.com/design_patterns/"&gt;software pattern catalog&lt;/a&gt;:&lt;br /&gt;
&lt;span id="more-47"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div class="codesnip-container" &gt;
&lt;div class="codesnip"&gt;&lt;span class="kw2"&gt;class&lt;/span&gt; StrategyContext &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;private &lt;span class="re0"&gt;$strategy&lt;/span&gt; = &lt;span class="kw2"&gt;NULL&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="co1"&gt;//bookList is not instantiated at construct time&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;public &lt;span class="kw2"&gt;function&lt;/span&gt; __construct&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$strategy_ind_id&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw1"&gt;switch&lt;/span&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$strategy_ind_id&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw1"&gt;case&lt;/span&gt; &lt;span class="st0"&gt;&amp;#8220;C&amp;#8221;&lt;/span&gt;:&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;strategy = &lt;span class="kw2"&gt;new&lt;/span&gt; StrategyCaps&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="kw1"&gt;break&lt;/span&gt;;&lt;br /&gt;
&lt;span class="kw1"&gt;case&lt;/span&gt; &lt;span class="st0"&gt;&amp;#8220;E&amp;#8221;&lt;/span&gt;:&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;strategy = &lt;span class="kw2"&gt;new&lt;/span&gt; StrategyExclaim&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="kw1"&gt;break&lt;/span&gt;;&lt;br /&gt;
&lt;span class="kw1"&gt;case&lt;/span&gt; &lt;span class="st0"&gt;&amp;#8220;S&amp;#8221;&lt;/span&gt;:&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;strategy = &lt;span class="kw2"&gt;new&lt;/span&gt; StrategyStars&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="kw1"&gt;break&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;public &lt;span class="kw2"&gt;function&lt;/span&gt; showBookTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$book&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;strategy-&amp;amp;gt;showTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$book&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;interface StrategyInterface &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
public &lt;span class="kw2"&gt;function&lt;/span&gt; showTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$book_in&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;class&lt;/span&gt; StrategyCaps implements StrategyInterface &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
public &lt;span class="kw2"&gt;function&lt;/span&gt; showTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$book_in&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="re0"&gt;$title&lt;/span&gt; = &lt;span class="re0"&gt;$book_in&lt;/span&gt;-&amp;amp;gt;getTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;titleCount++;&lt;br /&gt;
&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;a href="http://www.php.net/strtoupper"&gt;&lt;span class="kw3"&gt;strtoupper&lt;/span&gt;&lt;/a&gt; &lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$title&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;class&lt;/span&gt; StrategyExclaim implements StrategyInterface &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
public &lt;span class="kw2"&gt;function&lt;/span&gt; showTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$book_in&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="re0"&gt;$title&lt;/span&gt; = &lt;span class="re0"&gt;$book_in&lt;/span&gt;-&amp;amp;gt;getTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;titleCount++;&lt;br /&gt;
&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;a href="http://www.php.net/str_replace"&gt;&lt;span class="kw3"&gt;Str_replace&lt;/span&gt;&lt;/a&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;#8216; &amp;#8216;&lt;/span&gt;,&lt;span class="st0"&gt;&amp;#8216;!&amp;#8217;&lt;/span&gt;,&lt;span class="re0"&gt;$title&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;class&lt;/span&gt; StrategyStars implements StrategyInterface &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
public &lt;span class="kw2"&gt;function&lt;/span&gt; showTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$book_in&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="re0"&gt;$title&lt;/span&gt; = &lt;span class="re0"&gt;$book_in&lt;/span&gt;-&amp;amp;gt;getTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;titleCount++;&lt;br /&gt;
&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;a href="http://www.php.net/str_replace"&gt;&lt;span class="kw3"&gt;Str_replace&lt;/span&gt;&lt;/a&gt;&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;#8216; &amp;#8216;&lt;/span&gt;,&lt;span class="st0"&gt;&amp;#8216;*&amp;#8217;&lt;/span&gt;,&lt;span class="re0"&gt;$title&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="kw2"&gt;class&lt;/span&gt; Book &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
private &lt;span class="re0"&gt;$author&lt;/span&gt;;&lt;br /&gt;
private &lt;span class="re0"&gt;$title&lt;/span&gt;;&lt;br /&gt;
&lt;span class="kw2"&gt;function&lt;/span&gt; __construct&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$title_in&lt;/span&gt;, &lt;span class="re0"&gt;$author_in&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;author = &lt;span class="re0"&gt;$author_in&lt;/span&gt;;&lt;br /&gt;
&lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;title&amp;nbsp; = &lt;span class="re0"&gt;$title_in&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw2"&gt;function&lt;/span&gt; getAuthor&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;author;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw2"&gt;function&lt;/span&gt; getTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;title;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw2"&gt;function&lt;/span&gt; getAuthorAndTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; &lt;span class="br0"&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt;
&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;getTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt; . &lt;span class="st0"&gt;&amp;#8216; by &amp;#8216;&lt;/span&gt; . &lt;span class="re0"&gt;$this&lt;/span&gt;-&amp;amp;gt;getAuthor&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt;
&lt;span class="br0"&gt;&amp;#125;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="re0"&gt;$book&lt;/span&gt; = &lt;span class="kw2"&gt;new&lt;/span&gt; Book&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;#8216;PHP for Cats&amp;#8217;&lt;/span&gt;,&lt;span class="st0"&gt;&amp;#8216;Larry Truett&amp;#8217;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;span class="re0"&gt;$strategyContextC&lt;/span&gt; = &lt;span class="kw2"&gt;new&lt;/span&gt; StrategyContext&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="st0"&gt;&amp;#8216;C&amp;#8217;&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.php.net/echo"&gt;&lt;span class="kw3"&gt;echo&lt;/span&gt;&lt;/a&gt; &lt;span class="re0"&gt;$strategyContextC&lt;/span&gt;-&amp;amp;gt;showBookTitle&lt;span class="br0"&gt;&amp;#40;&lt;/span&gt;&lt;span class="re0"&gt;$book&lt;/span&gt;&lt;span class="br0"&gt;&amp;#41;&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;?&amp;amp;gt;&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;After I see the robot made from LEGO constructor, which holds the &lt;strong&gt;E&lt;/strong&gt; letter in its manipulator-hand at the picture at the wall.&lt;/p&gt;
&lt;p&gt;After that I see the robot&amp;#8217;s manipulator is getting out of picture and moves the letter &lt;strong&gt;E&lt;/strong&gt; to the opposite corner of the room, while the roman warrior has got out of the Jacuzzi and moved to those part of room. Manipulator gives this &lt;strong&gt;E&lt;/strong&gt; letter, and while it falls down to the warrior&amp;#8217;s hands it transforms into the exclamation mark(assign the strategy property an StrategyExclamation implementation &amp;#8211; $this-&amp;gt;strategy = new StrategyExclaim())&lt;/p&gt;
&lt;p&gt;Now let&amp;#8217;s move to particular StrategyExclaim implementation:&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll use the kitchen for that class. I see the warrior standing near the table, holding the knife. He wants to cut the tasty cake in form of exclamation mark, lying on the table(StrategyExclaim).&lt;/p&gt;
&lt;p&gt;Near the sink I the the ostsilograf with right sine function on them. At the end of room, I see the black &amp;#8220;magic&amp;#8221; curtains, like those in circus. And after that I see the top of the curtains lowering(опускаются), until we can see the book&amp;#8217;s, standing behind the curtains, top part  with its title(function showTitle($book));&lt;/p&gt;
&lt;p&gt;Now, If I&amp;#8217;ll walk this path I&amp;#8217;ll can remind this pattern implementation. It is important, to now only remember every line of implementation, but more of core concepts(main parts), which will help you to remind the implementation.&lt;/p&gt;
&lt;p&gt;Because remembering the source code is not a linear information, you&amp;#8217;ll have to be creative and find the way of grouping the concepts and make a cross connections between them.&lt;/p&gt;
&lt;p&gt;It is strongly recommended for you, to make your own &amp;#8220;story&amp;#8221;, because your own feelings and imagination images means much more to you, than other peoples perception, hence are remembered faster and stronger.&lt;/p&gt;
&lt;p&gt;Our main purpose is not just in fast remembering the pattern, but in stay it with us for a quite long period of time. After first learning I reminisce the remembered information in my imagination, without looking at the paper or laptop&lt;/p&gt;
&lt;p&gt;1) after 15 minutes&lt;/p&gt;
&lt;p&gt;2) after an hour&lt;/p&gt;
&lt;p&gt;3) after about 6 hours&lt;/p&gt;
&lt;p&gt;4) on the next day&lt;/p&gt;
&lt;p&gt;5) .. week&lt;/p&gt;
&lt;p&gt;After that, if you want this information to stay in your &lt;a href="http://en.wikipedia.org/wiki/Long-term_memory"&gt;long-term memory&lt;/a&gt; all you have to do is to reminisce this information on a monthly basis. It will be enough.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m using the technique to memorizing different types of information: UNIX shell commands, foreign language words, framework constructs, etc.&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2009/03/memory-palace-method-example-strategy-pattern/#comments" thr:count="15" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2009/03/memory-palace-method-example-strategy-pattern/feed/atom/" thr:count="15" />
		<thr:total>15</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[stackoverflow]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2009/03/stackoverflow/" />
		<id>http://realitydrivendeveloper.com/?p=79</id>
		<updated>2009-03-05T18:32:16Z</updated>
		<published>2009-03-05T15:50:25Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="communication" />		<summary type="html"><![CDATA[Finally have decided to register at stackoverflow.
I like to talk on software development related topics, asking question and provide some recommendations to other developers. Sometimes I face different unique challenges, which is not described in the software dev books &#8211; in that cases all you can do is to rely on your own experience.
One head [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2009/03/stackoverflow/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ag-5vQk_Wo6gj9sTRUTW2-vc-Vw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ag-5vQk_Wo6gj9sTRUTW2-vc-Vw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ag-5vQk_Wo6gj9sTRUTW2-vc-Vw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ag-5vQk_Wo6gj9sTRUTW2-vc-Vw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Finally have decided to register at &lt;a href="http://stackoverflow.com/"&gt;stackoverflow&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I like to talk on software development related topics, asking question and provide some recommendations to other developers. Sometimes I face different unique challenges, which is not described in the software dev books &amp;#8211; in that cases all you can do is to rely on your own experience.&lt;/p&gt;
&lt;p&gt;One head is good. No, not like that &lt;img src='http://realitydrivendeveloper.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt;  One good head is good, but a community is much better. In that way our experience summarize in solving particular problems, and answering particular questions.&lt;/p&gt;
&lt;p&gt;I like the community it has, type of questions and discussions manner.&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2009/03/stackoverflow/#comments" thr:count="41" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2009/03/stackoverflow/feed/atom/" thr:count="41" />
		<thr:total>41</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[How to start using Design Patterns]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2009/02/how-to-start-using-design-patterns/" />
		<id>http://realitydrivendeveloper.com/?p=67</id>
		<updated>2009-02-28T07:00:01Z</updated>
		<published>2009-02-28T06:58:16Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="Object oriented programming" /><category scheme="http://realitydrivendeveloper.com" term="design patterns" /><category scheme="http://realitydrivendeveloper.com" term="ood" /><category scheme="http://realitydrivendeveloper.com" term="oop" />		<summary type="html"><![CDATA[I remember myself procrastinating in using of Design Pattern in production code, after reading the information about the GoF patterns.
On the paper everything looked very easy and understandable. But after you might fall in trap of fear of using this knowledge in production code, because:

You have a very limited time dedicated for the task. So [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2009/02/how-to-start-using-design-patterns/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zw7ZIJtGyYVRK1PKi_MomJ9Spjw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zw7ZIJtGyYVRK1PKi_MomJ9Spjw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zw7ZIJtGyYVRK1PKi_MomJ9Spjw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zw7ZIJtGyYVRK1PKi_MomJ9Spjw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I remember myself procrastinating in using of &lt;a href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)"&gt;Design Pattern&lt;/a&gt; in production code, after reading the information about the &lt;a href="http://en.wikipedia.org/wiki/Gang_of_Four"&gt;GoF&lt;/a&gt; patterns.&lt;/p&gt;
&lt;p&gt;On the paper everything looked very easy and understandable. But after you might fall in trap of fear of using this knowledge in production code, because:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You have a very limited time dedicated for the task. So you can&amp;#8217;t find the time to do the things &amp;#8220;in right way&amp;#8221;&lt;/li&gt;
&lt;li&gt;You haven&amp;#8217;t enough experience of some particular Design pattern, so you don&amp;#8217;t know how to exactly implement in real problem solving. So you spend more time and get out of time scope for task and schedule. So you decide to refuse &amp;#8220;the hard right way&amp;#8221;, and implement an easy and dirty &amp;#8220;temporary&amp;#8221; solution.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you refused to implement the pattern, you haven&amp;#8217;t improve your experience with this pattern. It is an infinity loop: you can&amp;#8217;t implement because you don&amp;#8217;t have a required experience. Time passes, and you will have the exact same problem in future, and the initial conditions(level of experience with particular pattern) are still low.&lt;/p&gt;
&lt;p&gt;I was in this loop for a couple months. And after I recognised this behaviour habit, I&amp;#8217;ve asked for help more my more experienced co-workers. The advice was simple and easy:&lt;/p&gt;
&lt;p&gt;You can&amp;#8217;t succeed without failure. If you want to become more experienced in Object Oriented design and Design patterns, you have to have a will in this trend, and still moving nonetheless the periodic temporary failures.&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2009/02/how-to-start-using-design-patterns/#comments" thr:count="46" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2009/02/how-to-start-using-design-patterns/feed/atom/" thr:count="46" />
		<thr:total>46</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[How to remember software design patterns]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2009/01/how-to-remember-software-design-patterns/" />
		<id>http://realitydrivendeveloper.com/?p=42</id>
		<updated>2009-03-05T17:51:12Z</updated>
		<published>2009-01-28T17:04:24Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="memory" /><category scheme="http://realitydrivendeveloper.com" term="design patterns" /><category scheme="http://realitydrivendeveloper.com" term="GoF" /><category scheme="http://realitydrivendeveloper.com" term="learning" /><category scheme="http://realitydrivendeveloper.com" term="mnemonics" />		<summary type="html"><![CDATA[Who likes to learn from the scratch the same issues over and over again. Assume, that nobody.
But sometimes we have to do so with design patterns, because that is not the case we have a close contact with every of 23 classic software design patterns.
I don&#8217;t remember, who wrote that:&#8221;we uses implementation patterns every hour, [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2009/01/how-to-remember-software-design-patterns/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DfQdm8Ona6YWdhsVfzW0cNP4TmE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DfQdm8Ona6YWdhsVfzW0cNP4TmE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DfQdm8Ona6YWdhsVfzW0cNP4TmE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DfQdm8Ona6YWdhsVfzW0cNP4TmE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Who likes to learn from the scratch the same issues over and over again. Assume, that nobody.&lt;/p&gt;
&lt;p&gt;But sometimes we have to do so with &lt;strong&gt;design patterns&lt;/strong&gt;, because that is not the case we have a close contact with every of 23 classic software design patterns.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t remember, who wrote that:&amp;#8221;we uses implementation patterns every hour, we uses design patterns much rarely, and we use architectural patterns mostly at the start of the project&amp;#8221;.&lt;/p&gt;
&lt;p&gt;And when we don&amp;#8217;t use some of our knowledge for quite a long period of time, we actually loose this knowledge, and will have to learn it again, when we need it.&lt;/p&gt;
&lt;p&gt;I think, that design patterns are worth remembering, because it is not the case, when you&amp;#8217;ll have to forget it later, because something new will appear. Software design patterns are core solutions for constantly appearing daily design tasks. And mostly, it doesn&amp;#8217;t attached to particular programming language, or framework(but every implementation has its own differences).&lt;/p&gt;
&lt;p&gt;&lt;span id="more-42"&gt;&lt;/span&gt;So, here I want to tell you about, the method for memorizing the lists of structured data.&lt;/p&gt;
&lt;p&gt;It is more like intro-to-method post. In next posts, I&amp;#8217;ll try to explain with examples, how you can learn the implementations of Software design patterns.&lt;/p&gt;
&lt;p&gt;So,&lt;strong&gt; Memory palace(method of loci/journey) method&lt;/strong&gt;:&lt;/p&gt;
&lt;p&gt;To use this technique, remember a room that you know good. There are many objects in room. You have to choose the path(sequence) of those objects(no matter in what direction, but I have to know the &amp;#8220;path&amp;#8221; well) and know that sequence.&lt;/p&gt;
&lt;p&gt;After that you have to associate images representing the information you want to remember with the objects on the path, &lt;strong&gt;one&lt;/strong&gt;-by-&lt;strong&gt;one&lt;/strong&gt;.&lt;/p&gt;
&lt;p class="bodytext"&gt;You may not limit yourself by just one room, you can go from one room to another, go out to street and so on as you like. The most important is that you have to know that path(significant point, associated with information unit you will associate with), and can walk it in your mind back and force.&lt;/p&gt;
&lt;p class="bodytext"&gt;To reminiscent all the information you have remembered, all you have to do is just to walk the path and &amp;#8220;look&amp;#8221; at those significant points, referenced somehow with information units.&lt;/p&gt;
&lt;p&gt;I also strongly recommend you to get familiar with wikipedia&amp;#8217;s article on &amp;#8220;&lt;a href="http://en.wikipedia.org/wiki/Method_of_loci"&gt;Method of loci&lt;/a&gt;&amp;#8220;.&lt;/p&gt;
&lt;p&gt;Here is the post describing the using of this method for &lt;a href="http://realitydrivendeveloper.com/2009/03/memory-palace-method-example-strategy-pattern/"&gt;Strategy Design Pattern memorization&lt;/a&gt;.&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2009/01/how-to-remember-software-design-patterns/#comments" thr:count="44" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2009/01/how-to-remember-software-design-patterns/feed/atom/" thr:count="44" />
		<thr:total>44</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[Session management after automated deployment best practices]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2009/01/session-management-after-automated-deployment-best-practices/" />
		<id>http://realitydrivendeveloper.com/?p=17</id>
		<updated>2009-01-09T19:17:58Z</updated>
		<published>2009-01-09T19:12:04Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="Deployment" /><category scheme="http://realitydrivendeveloper.com" term="sessions management" />		<summary type="html"><![CDATA[Now, I&#8217;m working on automated deployment platform for LAMP
environment, using Apache Ant.
Now it looks, something like that:
1. blocks all requests, and display &#8220;Website is under construction&#8221;
page.
2. implement database schema updates
3. update the application&#8217;s source code
4. unblock all the requests and hide &#8220;Website is under construction&#8221; page.
I thought, that we need the following:
after third, and before [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2009/01/session-management-after-automated-deployment-best-practices/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2l8r8d1lNY4J-okUSjUq7fXLk08/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2l8r8d1lNY4J-okUSjUq7fXLk08/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2l8r8d1lNY4J-okUSjUq7fXLk08/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2l8r8d1lNY4J-okUSjUq7fXLk08/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Now, I&amp;#8217;m working on automated deployment platform for &lt;a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)"&gt;LAMP&lt;/a&gt;&lt;br /&gt;
environment, using &lt;a href="http://en.wikipedia.org/wiki/Apache_Ant"&gt;Apache Ant&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now it looks, something like that:&lt;/p&gt;
&lt;p&gt;1. blocks all requests, and display &amp;#8220;&lt;a href="http://realitydrivendeveloper.com/2008/12/index-page-under-construction-while-deploying/"&gt;Website is under construction&lt;/a&gt;&amp;#8221;&lt;br /&gt;
page.&lt;br /&gt;
2. implement database schema updates&lt;br /&gt;
3. update the application&amp;#8217;s source code&lt;br /&gt;
4. unblock all the requests and hide &amp;#8220;Website is under construction&amp;#8221; page.&lt;/p&gt;
&lt;p&gt;I thought, that we need the following:&lt;br /&gt;
after third, and before fourth point I want the webserver to drop the sessions of already loggined users. I think, this practice is useful for automated deployment, because there might&lt;br /&gt;
be significant changes in sessions handling and in the application&lt;br /&gt;
core itself, so it is better to drop users&amp;#8217; sessions and force them to&lt;br /&gt;
login again.&lt;/p&gt;
&lt;p&gt;Because it is an automated deployment and usually take very small time, so we can&amp;#8217;t wait when loggined user&amp;#8217;s session will expired.&lt;/p&gt;
&lt;p&gt;&lt;span id="more-17"&gt;&lt;/span&gt;The solution for the problem depends on where does the application stores sessions &amp;#8211; files in system tmp folder, application tmp folder, database or some custom session-handling mechanism.&lt;/p&gt;
&lt;p&gt;We store our session in the database, in single table called `sessions`. So when we need to drop the sessions, all we have to do is to execute SQL command: &amp;#8220;TRUNCATE TABSE `sessions`;&amp;#8221;. This can be done automatically, from command line. For example, like that:&lt;/p&gt;
&lt;div class="codesnip-container" &gt;
&lt;div class="codesnip"&gt;mysql &amp;#8211;&lt;span class="re2"&gt;user=&lt;/span&gt;your_username &amp;#8211;&lt;span class="re2"&gt;password=&lt;/span&gt;your_password your_database_name -e &lt;span class="st0"&gt;&amp;#8216;TRUNCATE TABLE sessions&amp;#8217;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It is quite simple solution and most important &lt;strong&gt;working&lt;/strong&gt; solution, in most cases it is enough, BUT &lt;img src='http://realitydrivendeveloper.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /&gt;&lt;br /&gt;
it is not ideal, and can be improved.&lt;/p&gt;
&lt;p&gt;We decided to do it another way:&lt;br /&gt;
new build can have just minor updates, which don&amp;#8217;t refer with sessions in any way, so we should save user&amp;#8217;s session in that case. Build manager, or person responsible for deployment should to know such details, whether sessions must be dropped after deployment or not(just hide unnecessary details), because it is developer&amp;#8217;s responsibility to &amp;#8220;tag&amp;#8221; the build with &amp;#8220;drop the sessions&amp;#8221;, if it is necessary. This process, has to be automated too.&lt;/p&gt;
&lt;p&gt;Then we started to think, how we can make that. The solution was simple and straightforward &amp;#8211; give this responsibility to database SQL deltas automated updates mechanism.&lt;/p&gt;
&lt;p&gt;We use DBDeploy for the task, which handle plain SQL format for SQL updates.&lt;br /&gt;
So when developer sees the need of sessions drop after deployment, all he have to do is to add the &amp;#8220;&lt;em&gt;TRUNCATE TABLE `sessions`;&lt;/em&gt;&amp;#8221; SQL command to new SQL delta script.&lt;/p&gt;
&lt;p&gt;This solution, of course, becomes useless if sessions are stored in tmp folder, as default option in php.ini file. In that case, I wan&amp;#8217;t to recommend you to drop the session files manually from that folder, but better stop apache web server before, for avoidance of conflicts.&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2009/01/session-management-after-automated-deployment-best-practices/#comments" thr:count="44" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2009/01/session-management-after-automated-deployment-best-practices/feed/atom/" thr:count="44" />
		<thr:total>44</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[Index page &#8220;Under construction&#8221; while deploying]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2008/12/index-page-under-construction-while-deploying/" />
		<id>http://realitydrivendeveloper.com/?p=13</id>
		<updated>2008-12-27T20:50:50Z</updated>
		<published>2008-12-23T11:01:29Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="Deployment" /><category scheme="http://realitydrivendeveloper.com" term="apache ant" /><category scheme="http://realitydrivendeveloper.com" term="process" /><category scheme="http://realitydrivendeveloper.com" term="under contstuction" />		<summary type="html"><![CDATA[I have noticed a few times earlier on different sites an index pages with title &#8220;Please be patient, while we are deploying new software version. You&#8217;ll like it&#8221;. And one day, I decided that it is the time, to integrate the similar feature to our automated deployment process.
I think, that this page has to show [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2008/12/index-page-under-construction-while-deploying/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/S4IXUom9W1m6RaRtwZ3Lfc9CFnI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S4IXUom9W1m6RaRtwZ3Lfc9CFnI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/S4IXUom9W1m6RaRtwZ3Lfc9CFnI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/S4IXUom9W1m6RaRtwZ3Lfc9CFnI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;I have noticed a few times earlier on different sites an index pages with title &amp;#8220;Please be patient, while we are deploying new software version. You&amp;#8217;ll like it&amp;#8221;. And one day, I decided that it is the time, to integrate the similar feature to our automated deployment process.&lt;/p&gt;
&lt;p&gt;I think, that this page has to show user some indication of action progress(real or fictional), not just a static page, user has to refresh to see if it is finished or not. What user has to do &amp;#8211; is just open once the site, see the message, that it is &amp;#8220;Under construction&amp;#8221;, and stay the page for a while.&lt;/p&gt;
&lt;p&gt;It has to refresh itself until the time, deployment has finished. After that it has to load index page of new version&amp;#8217;s website.&lt;/p&gt;
&lt;p&gt;I wan&amp;#8217;t to tell you, how and when this new index page is setting up. Right, all the deployment processes can vary a lot depending on the software it deploys, environment it uses, deployment tools etc.&lt;/p&gt;
&lt;p&gt;&lt;img class="aligncenter size-full wp-image-27" title="under_construction1" src="http://realitydrivendeveloper.com/wp-content/uploads/2008/12/under_construction1.jpg" alt="under_construction1" width="701" height="220" /&gt;&lt;span id="more-13"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What is highly recommended in most cases:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Install new index page with &amp;#8220;Under construction&amp;#8221; message&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; block all the web site&amp;#8217;s pages, except index&lt;/p&gt;
&lt;p&gt;== different actions here(DB updates, server restart, caching refresh etc.) ==&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; unblock all the pages(except index)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; delete &amp;#8220;Under construction&amp;#8221; page&lt;/p&gt;
&lt;p&gt;That is how, I did it:&lt;/p&gt;
&lt;p&gt;It is an Apache Ant build file, with the following contents:&lt;/p&gt;
&lt;div class="codesnip-container" &gt;
&lt;div class="codesnip"&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;&lt;/span&gt;?xml &lt;span class="re0"&gt;version&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;1.0&amp;#8243;&lt;/span&gt; &lt;span class="re0"&gt;encoding&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;UTF-8&amp;#8243;&lt;/span&gt;?&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;project&lt;/span&gt; &lt;span class="re0"&gt;name&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;Under construction page&amp;#8221;&lt;/span&gt; &lt;span class="re0"&gt;basedir&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;.&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;target&lt;/span&gt; &lt;span class="re0"&gt;name&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;show-splash-screen-while-deployment&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;exec&lt;/span&gt; &lt;span class="re0"&gt;executable&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;cp&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;arg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;.htaccess&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;arg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;.htaccess-backup&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/exec&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;exec&lt;/span&gt; &lt;span class="re0"&gt;executable&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;cp&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;arg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;.htaccess-block-all-except-index&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;arg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;.htaccess&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/exec&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/target&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;target&lt;/span&gt; &lt;span class="re0"&gt;name&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;hide-splash-screen-while-deployment&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;exec&lt;/span&gt; &lt;span class="re0"&gt;executable&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;mv&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;arg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;.htaccess-backup&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;arg&lt;/span&gt; &lt;span class="re0"&gt;value&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;.htaccess&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/exec&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/target&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/project&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;To install our &amp;#8220;Under construction&amp;#8221; page &amp;#8211; just run:&lt;/p&gt;
&lt;div class="codesnip-container" &gt;
&lt;div class="codesnip"&gt;ant show-splash-screen-while-deployment&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It will backup your default .htaccess file, and replace it with new one, which catches all the queries and redirect it to the root of the web site.&lt;/p&gt;
&lt;p&gt;And when deployment will be finished, run:&lt;/p&gt;
&lt;div class="codesnip-container" &gt;
&lt;div class="codesnip"&gt;ant hide-splash-screen-while-deployment&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;It will restore your default .htaccess file.&lt;/p&gt;
&lt;p&gt;In attachment, you can find all those files you need to do the same.&lt;/p&gt;
&lt;p&gt;That solution is not the best, and is not for types of projects.If you like the idea, mostly you&amp;#8217;ll need to modify it to your demands and your environment.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://realitydrivendeveloper.com/wp-content/uploads/2008/12/under_construction_for_deployment.zip"&gt;Download an attachment&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Have fun! &lt;img src='http://realitydrivendeveloper.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /&gt; &lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2008/12/index-page-under-construction-while-deploying/#comments" thr:count="11" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2008/12/index-page-under-construction-while-deploying/feed/atom/" thr:count="11" />
		<thr:total>11</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[Versionable static content deployment]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2008/12/versionable-static-content-deployment/" />
		<id>http://realitydrivendeveloper.com/?p=8</id>
		<updated>2008-12-27T22:26:04Z</updated>
		<published>2008-12-23T10:30:43Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="Deployment" /><category scheme="http://realitydrivendeveloper.com" term="apache ant" /><category scheme="http://realitydrivendeveloper.com" term="build" /><category scheme="http://realitydrivendeveloper.com" term="css" /><category scheme="http://realitydrivendeveloper.com" term="javascript" /><category scheme="http://realitydrivendeveloper.com" term="packing" /><category scheme="http://realitydrivendeveloper.com" term="sed" />		<summary type="html"><![CDATA[Recently, at some project, we planned to dedicate some time to improve our deployment and build packing process, so we can use the solution in future projects.
What we decided to do:

make a pack of all the Java scripts and CSSes, to reduce the page load time
make a static content versionable

If first is quite a common [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2008/12/versionable-static-content-deployment/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Wo_5MbwegpJr28hnEYVDr5tC7ec/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wo_5MbwegpJr28hnEYVDr5tC7ec/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Wo_5MbwegpJr28hnEYVDr5tC7ec/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Wo_5MbwegpJr28hnEYVDr5tC7ec/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Recently, at some project, we planned to dedicate some time to improve our deployment and build packing process, so we can use the solution in future projects.&lt;/p&gt;
&lt;p&gt;What we decided to do:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;make a pack of all the Java scripts and CSSes, to reduce the page load time&lt;/li&gt;
&lt;li&gt;make a static content versionable&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If first is quite a common practise, I wan&amp;#8217;t to tell more about the second point, on example.&lt;br /&gt;
We use an automatic deployment system. So installing of new software version can be done easily and takes little time. So, for example, if we faced some serious bug with CSS, something is very bad with User Interface and the problem is with some external CSS directive.&lt;/p&gt;
&lt;p&gt;If we will just change solve the problem, locally in those CSS file, make a build and upload it to the server we&amp;#8217;ll have some users, with loggined sessions and cached CSS files in browser. We have uploaded the fixed version of CSS, but user still see the old one, with bugs.&lt;/p&gt;
&lt;p&gt;The same problems can arise with all the static content(java scripts, CSS files, images).  So we decided to make that content versionable too.  Main purpose is to force the browser to load new version of those content, when we deploy new version.&lt;/p&gt;
&lt;p&gt;That is how we decided to do that:&lt;/p&gt;
&lt;p&gt;&lt;span id="more-8"&gt;&lt;/span&gt;if we change all the paths in HTML, to static content with some unique postfix, such as, for example &amp;#8220;styles.css?ver1.2&amp;#8243; or &amp;#8220;logo.png?ver39&amp;#8243; or even &amp;#8220;logo.png?UUID-UUID-UUID-UUID-UUID&amp;#8221;, we&amp;#8217;ll force all the browsers to reload the files.  But, we have found that actual CI build number(not UUID or revision) works best for us, because it some bug arises we can know for sure, in what build is it, to make a bug fix and deploy new version.&lt;/p&gt;
&lt;p&gt;I automated the process making the unique URL postfixes for static content while packing build, ready for deployment, by using the Apache Ant and sed. Here is the example:&lt;/p&gt;
&lt;div class="codesnip-container" &gt;
&lt;div class="codesnip"&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;target&lt;/span&gt; &lt;span class="re0"&gt;name&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;tag-static-content&amp;#8221;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;exec&lt;/span&gt; &lt;span class="re0"&gt;command&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8220;find ${build.dir} -type f -exec sed -i &amp;#8217;s/BUILD_NUMBER/${build.number}/&amp;#8217; {} &lt;span class="es0"&gt;\;&lt;/span&gt;&amp;#8220;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/target&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;That command search for all the files recursively in the build.dir folder, and replaces all the matches &amp;#8220;BUILD_NUMBER&amp;#8221; to build.number value.&lt;/p&gt;
&lt;p&gt;To make this command run your view templates have to look like that:&lt;/p&gt;
&lt;div class="codesnip-container" &gt;
&lt;div class="codesnip"&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="re0"&gt;type&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8216;text/javascript&amp;#8217;&lt;/span&gt; &lt;span class="re0"&gt;src&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8216;http://realitydrivendeveloper.com/wp-includes/js/jquery/jquery.js?BUILD_NUMBER&amp;#8217;&lt;/span&gt;&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;/script&lt;span class="re2"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="sc3"&gt;&lt;span class="re1"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="re0"&gt;rel&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8217;stylesheet&amp;#8217;&lt;/span&gt; &lt;span class="re0"&gt;href&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8216;http://realitydrivendeveloper.com/wp-includes/js/thickbox/thickbox.css?ver=BUILD_NUMBER&amp;#8217;&lt;/span&gt; &lt;span class="re0"&gt;type&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8216;text/css&amp;#8217;&lt;/span&gt; &lt;span class="re0"&gt;media&lt;/span&gt;=&lt;span class="st0"&gt;&amp;#8216;all&amp;#8217;&lt;/span&gt; &lt;span class="re2"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;So it will still works in development environment.&lt;/p&gt;
&lt;p&gt;There are different ways of setting ${build.number} variable, depending on your repository vendor(if you want to tag it by revision number), continuous integration server(by using its build number), generate some unique string(&lt;a href="http://en.wikipedia.org/wiki/Universally_Unique_Identifier"&gt;UUID&lt;/a&gt;) and assign its value to the ${build.number} variable, or even to install ${build.number} value manually, but it is not desired.&lt;/p&gt;
&lt;p&gt;For, example, here are some ideas:&lt;/p&gt;
&lt;p&gt;http://www.zorched.net/2006/07/20/getting-the-revision-number-of-your-subversion-working-copy/&lt;/p&gt;
&lt;p&gt;http://code.google.com/p/bamboo-ant-tasks/&lt;/p&gt;
&lt;p&gt;You can reduce code duplication by using the wrappers for outputting the links for static content(images, javascripts and CSS).&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2008/12/versionable-static-content-deployment/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2008/12/versionable-static-content-deployment/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	</entry>
		<entry>
		<author>
			<name>admin</name>
						<uri>http://</uri>
					</author>
		<title type="html"><![CDATA[phpUnderControl]]></title>
		<link rel="alternate" type="text/html" href="http://realitydrivendeveloper.com/2008/12/phpundercontrol/" />
		<id>http://realitydrivendeveloper.com/?p=3</id>
		<updated>2008-12-27T18:53:10Z</updated>
		<published>2008-12-23T09:22:07Z</published>
		<category scheme="http://realitydrivendeveloper.com" term="Continuous initegration" /><category scheme="http://realitydrivendeveloper.com" term="CruiseControl" /><category scheme="http://realitydrivendeveloper.com" term="development" /><category scheme="http://realitydrivendeveloper.com" term="PHP" /><category scheme="http://realitydrivendeveloper.com" term="phpUnderControl" /><category scheme="http://realitydrivendeveloper.com" term="process" />		<summary type="html"><![CDATA[Recently, I had an invitation to participate to some project, which where in development for about a year. The product was quite successful, but stack holders decided to improve its performance, reduce bug-level, develop lots of new features, otherwise get a more loyal customers and make it more profitable. So, for the start, let me [...]]]></summary>
		<content type="html" xml:base="http://realitydrivendeveloper.com/2008/12/phpundercontrol/">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qWkok3MTpEnMrbTk294Dh_f5o9M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qWkok3MTpEnMrbTk294Dh_f5o9M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qWkok3MTpEnMrbTk294Dh_f5o9M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qWkok3MTpEnMrbTk294Dh_f5o9M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Recently, I had an invitation to participate to some project, which where in development for about a year. The product was quite successful, but stack holders decided to improve its performance, reduce bug-level, develop lots of new features, otherwise get a more loyal customers and make it more profitable. So, for the start, let me tell you about the environment. It was the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;absence of automated process of deployment&lt;/li&gt;
&lt;li&gt;zero unit-tests code coverage&lt;/li&gt;
&lt;li&gt;quite low skills of working with repository&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, the consequences are not unexpected:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; big amount of bugs, even in production&lt;/li&gt;
&lt;li&gt;deployment was quite rare, difficult and sometimes error prone(especially in the case, when there was need to rollback to previous version)&lt;/li&gt;
&lt;li&gt; software integration problems&lt;/li&gt;
&lt;li&gt;DB integration problems&lt;/li&gt;
&lt;li&gt;consequently, low motivation for producing lots of new code, because it is always scary and many unpredictable bugs arises in different places&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Significant part of those problems can be eliminated by improving the development and deployment process. That is what we decided to do, at first. So, after that I  decided to talk with the people, mostly involved in the planned switch – developers, QAs and the system administrators.&lt;br /&gt;
&lt;span id="more-3"&gt;&lt;/span&gt;&lt;br /&gt;
The most important fact, that I noticed at first was, that all the team members has performed a motivation and eager to make the switch.  So, we decided to start with CI server, first.&lt;/p&gt;
&lt;p&gt;After demands clarification and resources analyzing, we decided that our CI system looks like:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt; open source, free of charge CI server&lt;/li&gt;
&lt;li&gt;no need for advanced features, such as pre-tested commit, distributed testing. &lt;a href="http://en.wikipedia.org/wiki/You_Ain't_Gonna_Need_It"&gt;YAGNI&lt;/a&gt;, for the start.&lt;/li&gt;
&lt;li&gt;unit-test runner, functional tests runner(Selenium), code coverage analysis, code static analyzers(duplication, code convention format, &lt;a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity"&gt;cyclomatic complexity&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After some researching, we have found ourselves choosing between &lt;a href="http://code.google.com/p/xinc"&gt;Xinc&lt;/a&gt;(written in pure PHP) and &lt;a href="http://www.phpundercontrol.org/"&gt;phpUnderControl&lt;/a&gt;(as a plugin for &lt;a href="http://cruisecontrol.sourceforge.net/"&gt;CruiseControl&lt;/a&gt;) CI server.&lt;/p&gt;
&lt;p&gt;I don&amp;#8217;t like PHP language that much, to choice CI server, written on it &lt;img src='http://realitydrivendeveloper.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt;  So I decided to choose CC. Maturity of the product, its community and available plugins were the main arguments.&lt;/p&gt;
&lt;p&gt;phpUnderControl is a tool, giving us all the power of CruiseControl, and has almost everything, &amp;#8221; right from the box&amp;#8221; that usual PHP project CI server wants to have.&lt;/p&gt;
&lt;p&gt;After working for quite a long period with the &lt;a href="http://www.atlassian.com/software/bamboo"&gt;Bamboo&lt;/a&gt; CI server, I feel myself very comfortable with phpUnderControl. It has all the base benefits, Continuous Integration can give for a small-to-medium size project. And what I liked especially in phpUnderControl, is that it didn&amp;#8217;t take me much time to setup all the required features.&lt;/p&gt;
&lt;p&gt;As a consequences, a couple months later, working with that scheme, I can say that level of bugs has decremented in some scale. Mostly, because of those people who writes unit-tests for their code. No they runs all the time, developer commits its code to repository, and we can see the feedback from code very fast.&lt;/p&gt;
&lt;p&gt;One more interesting point, I&amp;#8217;ve noticed, that static code analyzer increases the code quality in some way &lt;img src='http://realitydrivendeveloper.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt;  For example, if some developer worked on the code, other may not see very often, so he can leave it in unrefactored form, and no one can notice that. But when code analyzer tells him, that, for example, cyclomatic complexity of some of the method is enormous, or the class length in LOC is too long, developer might feel ashamed of them, and will refactore the messy code.&lt;/p&gt;
</content>
		<link rel="replies" type="text/html" href="http://realitydrivendeveloper.com/2008/12/phpundercontrol/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://realitydrivendeveloper.com/2008/12/phpundercontrol/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	</entry>
	</feed>
