<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Über Software</title>
	
	<link>http://www.uebersoftware.com</link>
	<description>Opinions and thoughts on Software and Technology.</description>
	<lastBuildDate>Thu, 25 Feb 2010 22:15:37 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/uebersoftware" /><feedburner:info uri="uebersoftware" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>uebersoftware</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>UX and App Design at Google – Takeaways</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/NnJVIpOIDfo/</link>
		<comments>http://www.uebersoftware.com/2010/02/ux-and-app-design-at-google-takeaways/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:32:36 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web2.0]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=206</guid>
		<description><![CDATA[Yesterday I was at an interesting UX knowledgeshare event where Simon Raess spoke about user experience and application design at Google. Google being an engineering company at heart they arguably only put in the recent years more weight on Ux and Design. Also nowadays Google employs only 200 designers. Being an engineer myself, I expected [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was at an interesting <a href="http://internet-briefing.ch/index.cfm?page=119770&amp;cfid=39657541&amp;cftoken=82013183">UX knowledgeshare event</a> where <a href="http://www.google.co.uk/search?q=Simon+Raess">Simon Raess</a> spoke about user experience and application design at Google. Google being an engineering company at heart they arguably only put in the recent years more weight on Ux and Design. Also nowadays Google employs only 200 designers. Being an engineer myself, I expected to get some new insights from another perspective.</p>
<p>The talk was built around the first principle of Googles <a href="http://www.lgoogle.com/intl/en/corporate/tenthings.html">corporate philosophy</a> &#8220;Focus on the user and all else will follow&#8221;. Being the first principle it is the most important one, and prioritised in favor of other conflicting aspects when making a product. Among other things, this means that the first thougth when starting with a product is not how to make money but what do users want.</p>
<p>The execution of this philosophy was explained with an outline how the product process works.<br />
<a rel="attachment wp-att-208" href="http://www.uebersoftware.com/2010/02/ux-and-app-design-at-google-takeaways/dad/"><img class="alignnone size-medium wp-image-208" title="Focus on the user" src="http://www.uebersoftware.com/wp-content/uploads/2010/02/dad-300x207.png" alt="Focus on the user" width="300" height="207" /></a></p>
<p>Specifically for UX and design there are 4 interation phases Google follows:</p>
<p>1 Define                 4 Validate<br />
2 Research            3 Design</p>
<p>The first thing is the definition of the product, and gathering of ideas. This comes from various sources, like their 20% time, Market Needs, and others.</p>
<p>After there&#8217;s a clear product idea the research phase starts. Research here does most importantly mean: Going out to the user, talk to the user and get feedback. So very early in the process of creating a product Google already starts to gather feedback for a rough idea. It is important to get feedback from a representative group of users, the type of users that should use the product in the end. Later in the research phase they create abstract personas. Personas are a way to classify typical user groups with their interest, habits, jobs, daily activities, emotions etc.</p>
<p>The next phase is the Design phase, where the actual design happens in the following sequence: Information Architecture, Layout/Workflow, Interaction Model, Visual Design. The design and research phase is lead by a designer and a researcher which are in tight collaboration. The design and research goes over many interations until feedback from users start to get positive.</p>
<p>Only when the feedback from users is positive detail planning starts. Finally the Design is validated by users and Google employees when the product is first internally launched.</p>
<p>Some tools they use to gather user feedback are: eye tracking, Labs, before and after experience questions.</p>
<p>Quite interesting to me was: no single line of code is written until detail design is finished. However engineers are involved during the design process but it was not so clear to what level and for what tasks. For me it would have been interesting to get some more information on the collaboration between engineers and designers in the process. Other than that, great talk!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/gfapDdEQQ6SujSk6ZNzeGpZhrKs/0/da"><img src="http://feedads.g.doubleclick.net/~a/gfapDdEQQ6SujSk6ZNzeGpZhrKs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/gfapDdEQQ6SujSk6ZNzeGpZhrKs/1/da"><img src="http://feedads.g.doubleclick.net/~a/gfapDdEQQ6SujSk6ZNzeGpZhrKs/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2010/02/ux-and-app-design-at-google-takeaways/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2010/02/ux-and-app-design-at-google-takeaways/</feedburner:origLink></item>
		<item>
		<title>A Programmer’s New Year’s Resolution for 2010: Learning Scala</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/wZr0630wQ-g/</link>
		<comments>http://www.uebersoftware.com/2010/01/a-programmers-new-years-resolution-for-2010-learning-scala/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 00:23:15 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Distractions]]></category>
		<category><![CDATA[programming languages]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=198</guid>
		<description><![CDATA[In a world of constant change and ever increasing speed of innovation as a programmer, you might sit back and think about how to prepare for those changes and increase your career options. You might also look forward to a mental distraction from the daily Java/Ruby/PHP routine, or your inner geek is just looking for [...]]]></description>
			<content:encoded><![CDATA[<p>In a world of constant change and ever increasing speed of innovation as a programmer, you might sit back and think about how to prepare for those changes and increase your career options. You might also look forward to a mental distraction from the daily Java/Ruby/PHP routine, or your inner geek is just looking for the next big thing.</p>
<p>So without further ado and <a href="http://www.rubyinside.com/holiday-fun-how-programming-language-fanboys-see-each-others-languages-2911.html">fanboy-ing </a> here&#8217;s why I want to do it.</p>
<p><strong>Scala</strong><br />
I first heard of Scala about an year ago in an article in the German Java Magazin. What caught my attention was that it was designed by a) a Swiss researcher (awakening to my national pride <img src='http://www.uebersoftware.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) and b) that <a target="_top" href="http://lampwww.epfl.ch/~odersky/">Martin Odersky</a> wrote the reference compiler for Java 1.5, and c) that the Twitter (messaging) backend at that time had just moved to Scala. </p>
<p>Scala is a general purpose programming language, statically typed and integrates features of object-oriented and functional languages.</p>
<p>Some properties Scala offers: </p>
<ul>
<li>Runs on JVM: Scala is byte code compatible with Java and can therefore be used in combination with existing Java Libraries.</li>
<li>Combines functional with oo: Scala can take advantage of best of both worlds</li>
<li>Eases concurrency, scalablility: A certain amount of functional programming is inevitable, if multicore computers should be used efficiently.</li>
<li>Reduces code size by 2-4 compared to Java: Less code tends to require less work writing and maintaining it and also tends to have fewer defaults.</li>
<li>Particular use cases include Complex XML Processing, Concurrent programming, DSL</li>
</ul>
<p>Within the <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html">TIOBE index </a> Scala is at #33. There&#8217;s a lot of controversy if scala will be the next big thing. Some very well rounded arguments pro and contra. But as an old saying goes in German &#8220;Probieren geht über studieren&#8221;  I choose to set off trying it myself for a private project or two. Stay tuned for the learning scala series.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/mA9o_8k2M7ET4XXD5Qw0yP4DXcI/0/da"><img src="http://feedads.g.doubleclick.net/~a/mA9o_8k2M7ET4XXD5Qw0yP4DXcI/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/mA9o_8k2M7ET4XXD5Qw0yP4DXcI/1/da"><img src="http://feedads.g.doubleclick.net/~a/mA9o_8k2M7ET4XXD5Qw0yP4DXcI/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2010/01/a-programmers-new-years-resolution-for-2010-learning-scala/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2010/01/a-programmers-new-years-resolution-for-2010-learning-scala/</feedburner:origLink></item>
		<item>
		<title>Nuux – Launch of Location Aware Mobile Social Network – with focus on real-time</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/xQNbcIQo7XA/</link>
		<comments>http://www.uebersoftware.com/2009/12/nuux-launch-of-location-aware-mobile-social-network-with-focus-on-real-time/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 05:22:39 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Web2.0]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[mobile development]]></category>
		<category><![CDATA[mobile social network]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=192</guid>
		<description><![CDATA[Today, a main project of mine, Nuux is opening its doors officially for the public Beta! Nuux is a mobile social network dedicated to real-time social nightlife information. I would like to take the opportunity to let you know some details about this network and how it works. I will try not to make too [...]]]></description>
			<content:encoded><![CDATA[<p>Today, a main project of mine, <a title="Nuux.net" href="http://www.nuux.net">Nuux</a> is opening its doors officially for the public Beta! Nuux is a <strong>mobile</strong> social network dedicated to <strong>real-time social nightlife information</strong>. I would like to take the opportunity to let you know some details about this network and how it works. I will try not to make too much of a plug, but I am biased, since I&#8217;m the main person behind this, so reader beaware! <img src='http://www.uebersoftware.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Ok, so Nuux is about real-time nightlife information. You can checkout live where friends are partying, checkin to locations and events, message your friends for free, see what&#8217;s the hottest venues and generally get insider information about a particular town. To get my motivation behind this project maybe I can explain how it all began:</p>
<p>I was going out with some friends and ended up in a place where we had already paid some cover charge but it was not good at all. How would it be to have some network to check-out what other places and events are like, right now? An app to see where your friends are right now, how they like it, see pics, and recommendations from people just like me?</p>
<p>The idea developed into what has become Nuux right now. Currently you can checkout Nuux as a <a title="Nuux" href="http://www.nuux.net">web platform</a>, a <a title="Nuux Mobile Site" href="http://m.nuux.net">mobile site</a>, and the <a title="Nuux Youtube Site" href="http://www.youtube.com/user/nuuxmobile">mobile application</a>. Nuux is tightly integrated into Facebook (Single Sign On, Friend Connect, Publish, Pictures Sharing etc.).  This means that for example the there is no actual friend building process required you can just use your connections from Facebook if you like, which are sync&#8217;ed on a daily basis.</p>
<p>The Mobile App, which is actually the main part is a 2ME Client available for most of the phones from Nokia, Samsung, SE, LG, Moto (other clients are comming, Blackberry the soonest in about a months time, then iPhone, Android).  The website currently only shows a small part of the functionality which is available in Nuux. For example you can let your friends know of your <a href="http://www.nuux.net/plans/myplans">Weekend Plans</a> by linking directly to a <a href="http://www.nuux.net/venues">venue </a>of your city. Venues can all be filled with user generated content &#8211; ratings, tags, comments, pics, and weekend plans. So you can find out what is going to be a popular venue in a particular city on all those attributes.</p>
<p>In the near future we will also offer an API, to enable fellow developers developing their own applications on the Nuux network. If you would like to be notified for an early access, please contact us on developers@nuux.net.</p>
<p>If you would like to get more info please check out the <a href="http://http://nuux.tumblr.com/">Nuux Blog</a>, or follow Nuux on <a href="http://www.twitter.com/nuuxlive">Twitter </a>. </p>
<p>And yes, please let me know what you think about it either in the comments or on <a href="http://nuux.uservoice.com/">uservoice</a>. </p>
<p>Thanks &#8211; and I promise this will be the first and only plug for Nuux, really!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/LKKnNBMCoY9Ysem4UXhLUn5icrQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/LKKnNBMCoY9Ysem4UXhLUn5icrQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/LKKnNBMCoY9Ysem4UXhLUn5icrQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/LKKnNBMCoY9Ysem4UXhLUn5icrQ/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/12/nuux-launch-of-location-aware-mobile-social-network-with-focus-on-real-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/12/nuux-launch-of-location-aware-mobile-social-network-with-focus-on-real-time/</feedburner:origLink></item>
		<item>
		<title>The old-school Objective C is approaching top 10</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/MLgcVZKgXzI/</link>
		<comments>http://www.uebersoftware.com/2009/12/the-old-school-objective-c-is-approaching-top-10/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 23:22:41 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[mobile development]]></category>
		<category><![CDATA[programming languages]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=188</guid>
		<description><![CDATA[From time to time I check the index of the most popular programming languages by tiobe, check out how popular the old-school Objective-C is becoming!
Given that this language is very old school, it makes me wonder what would have happended to the Appshop and Apple if they opened the Shop for Java, PHP or Python?
]]></description>
			<content:encoded><![CDATA[<p>From time to time I check the <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" target="_blank">index of the most popular programming languages</a> by tiobe, check out how popular the old-school Objective-C is becoming!</p>
<p>Given that this language is very old school, it makes me wonder what would have happended to the Appshop and Apple if they opened the Shop for Java, PHP or Python?</p>

<p><a href="http://feedads.g.doubleclick.net/~a/8GN5ARVqk0p5iCDHvaktHrMLeTg/0/da"><img src="http://feedads.g.doubleclick.net/~a/8GN5ARVqk0p5iCDHvaktHrMLeTg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8GN5ARVqk0p5iCDHvaktHrMLeTg/1/da"><img src="http://feedads.g.doubleclick.net/~a/8GN5ARVqk0p5iCDHvaktHrMLeTg/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/12/the-old-school-objective-c-is-approaching-top-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/12/the-old-school-objective-c-is-approaching-top-10/</feedburner:origLink></item>
		<item>
		<title>MegaTrend #9: Cross-platform Mobile Development</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/qXvb-Hjv5Pw/</link>
		<comments>http://www.uebersoftware.com/2009/11/megatrend-9-cross-platform-mobile-development/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 22:59:05 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[mobile development]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=175</guid>
		<description><![CDATA[In a recent article by InfoWorld Cross Platform mobile development was mentioned as one of the top 10 emerging enterprise technologies.
Until about 1 years ago the options for cross-platform mobile development were

doing platform specific native builds for Symbian, WinMo, Blackberry, UIQ, etc. or
Java development with specific twists per handset / handset group or
WAP/XHTML Mobile Web [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a href="http://tech.yahoo.com/news/infoworld/20091116/tc_infoworld/100378_1">recent article</a> by InfoWorld Cross Platform mobile development was mentioned as one of the top 10 emerging enterprise technologies.</p>
<p>Until about 1 years ago the options for cross-platform mobile development were</p>
<ul>
<li>doing platform specific native builds for Symbian, WinMo, Blackberry, UIQ, etc. or</li>
<li>Java development with specific twists per handset / handset group or</li>
<li>WAP/XHTML Mobile Web Site</li>
</ul>
<p>One of the biggest pains faced by mobile developers was &#8211; and still is &#8211; device fragmentation. However, with the iPhone a lot of developers turned to develop natively for just one platform because of the tremendous ease and improvements it brought to about every aspect of mobile development:<br />
distribution, ui &#8211; experience, not treating apps as third class citicents, monetarization options and needed targeting of devices to reach a critical mass. Now, Apple succeed to generate more than 2 billion downloads with less than 2% market share, truly amazing.</p>
<p>In the same year, autom 2007 Android came out with a SDK which promised even a better world for mobile developers. Due to its nature Android had a slower start, but is definitely emerging as one of the big platforms for the future.</p>
<p>Also in the same year Sun open-source released their LWUIT framework for J2ME development. LWUIT is a GUI framework to target not only Smartphones but also Featurephones of the last few years that support J2Me.</p>
<p>And with the iPhone being such a success of course the other players started to move as well and brought along their own SDK to develop compelling UI&#8217;s: Flash Lite (Adobe), WebOS (RIM), Bada (Samsung), Memo (Nokia), Widgets (many), JavaFX (Sun). Last but not least the J2ME spec leads finally settled on a <a href="http://jcp.org/en/jsr/detail?id=271">MIDP 3.0 spec</a> and  the <a href="http://java.sun.com/javame/technology/msa/">MSA </a>standard which is pretty cool if it would be adapted by many players.</p>
<p>So instead of fragmentation being reduced, over the years, it has actually being increased. What has changed to the good are that some platforms like the iPhone, Android and maybe others offer now a fairly consistent set of handsets that are fairly wide distributed, so that selecting / specializing on one/two platform became an option for the mobile developer.</p>
<p>However also in the last few years mobile browsers have greatly improved and WebKit became a quasi browser standard. Also manufactures are starting to build javascript extensions to expose phone features like location, multimedia etc. One could argue that given this trend and the forces behind (Google, HTML 5, &#8230; ) should give the mobile web sites a good chance of a revival pretty soon. The problem however is, that even though with modern browsers those sites will not be that ugly anymore, users expectations for UI&#8217;s have increased as well. Another problem is discovery of mobile web sites. Even though there are 100&#8242;000 apps in the app shop, this numer is nothing in compare to the number of possible websites out there.</p>
<p>So what are the new possibilites for cross platform development now, 1 year later?</p>
<ul>
<li><strong>Widgets</strong>. W3C standard (no handsets yet though), or <a href="http://www.jil.org">JIL </a>(by Vodafone, Verizon, SoftBank and China Mobile):  JIL defines a widget standard and more that 350 APIs to access to phone features, and this will be implemented on a lot of handsets in 2010/2011 (already in the oPhone from China Mobile or in the H1 from Samsung for instance).</li>
<li><strong>CrossPlatform SDK Frameworks</strong>, players include PhoneGap, Rhomobile, and Appcelerator Titanium</li>
</ul>
<p>The interesting thing about the cross platform SDK&#8217;s is that they supposly allow you to create real native looking apps with a uniform technology which is HTML/CSS/JS or Ruby in the case of Rhomobile. So instead of going the long curve of learing Objective-C and then porting the thing to Java for Android you can a) work with a well known web technology and b) have a single code base. Very promising, if they all will live up the promisses the future will show. If anybody has experience  using those SDK&#8217;s I would be very interested in opinions and comparisons.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/Qf87U5RvTVErXFbNtR1jp7BEhFU/0/da"><img src="http://feedads.g.doubleclick.net/~a/Qf87U5RvTVErXFbNtR1jp7BEhFU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Qf87U5RvTVErXFbNtR1jp7BEhFU/1/da"><img src="http://feedads.g.doubleclick.net/~a/Qf87U5RvTVErXFbNtR1jp7BEhFU/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/11/megatrend-9-cross-platform-mobile-development/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/11/megatrend-9-cross-platform-mobile-development/</feedburner:origLink></item>
		<item>
		<title>Obfuscation Bugs in J2ME Apps</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/IxyzYOLq_eQ/</link>
		<comments>http://www.uebersoftware.com/2009/11/obfuscation-bugs-in-j2me-apps/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 23:04:48 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[mobile development]]></category>
		<category><![CDATA[j2me]]></category>
		<category><![CDATA[obfuscating]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=170</guid>
		<description><![CDATA[Does this sound familiar to you?
It really did drive me crazy. Bug only appeared in a certain phone model with a certain version of the app. Not in emulator, not in other phones, not with other version of the app and just 2 weeks ago &#8211; without major change in the app &#8211; all was [...]]]></description>
			<content:encoded><![CDATA[<p>Does this sound familiar to you?</p>
<p>It really did drive me crazy. Bug only appeared in a certain phone model with a certain version of the app. Not in emulator, not in other phones, not with other version of the app and just 2 weeks ago &#8211; without major change in the app &#8211; all was running good in this certain phone. Of course I did not remember one crucial thing that happended in these 2 weeks: I upgraded my IDE NB from 6.1 to 6.7.1.</p>
<p>Shouldn&#8217;t matter you say? Not in J2ME development. In J2ME developmpent as a rule everything matters, I mean every little tiny seemingly irrelevant thingy you can imagine. So also an IDE change *did* matter.</p>
<p>The reason I found after about 2 hours of WTF&#8217;s: with 6.7.1 the proguard obfuscator changed and apparently introduced some bugs. Without obfuscating the app was running all smooth on this partucular phone. Fun thing is that I actually already had this problem once with an earier version of proguard, made a note and forgot about it. </p>
<p>I know about the location where the errors occured and am guessing its one of the errors that has been fixed in <a href="http://proguard.sourceforge.net/">version 4.4</a>. After I upgraded from proguard 4.2 to 4.4 all good again. I really want to remember this the next time I encounter such a nasty bug. I hope this post helps me with it, and hopefully it is also useful for some of you guys.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/rDsgPOq2kXgJ_XEjcqP1Ko3zxMU/0/da"><img src="http://feedads.g.doubleclick.net/~a/rDsgPOq2kXgJ_XEjcqP1Ko3zxMU/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rDsgPOq2kXgJ_XEjcqP1Ko3zxMU/1/da"><img src="http://feedads.g.doubleclick.net/~a/rDsgPOq2kXgJ_XEjcqP1Ko3zxMU/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/11/obfuscation-bugs-in-j2me-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/11/obfuscation-bugs-in-j2me-apps/</feedburner:origLink></item>
		<item>
		<title>FB Series: Difference between IFrame and Connect Apps</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/MOs58x0bM5s/</link>
		<comments>http://www.uebersoftware.com/2009/11/fbseries-difference-iframe-connect-apps/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 12:51:13 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=167</guid>
		<description><![CDATA[Writing about specifics on iFrame apps in Facebook development was on my list for quite some time. So now despite a lack of time, let&#8217;s just get out with the essential message:
When writing iFrame Apps, think of it like a Connect App. It is essentially the same.
I made  the long way round trying to [...]]]></description>
			<content:encoded><![CDATA[<p>Writing about specifics on iFrame apps in Facebook development was on my list for quite some time. So now despite a lack of time, let&#8217;s just get out with the essential message:</p>
<p>When writing iFrame Apps, think of it like a Connect App. <strong>It is essentially the same</strong>.</p>
<p>I made  the long way round trying to find out what are the specifics of a iFrame app in the Facebook Wiki, Forums, and Google. The Facebook Docs is very unclear about the concrete iFrame functionalities from my point of view. Start reading the Facebook docs substituting Connect with IFrame and you find it way easiert to get along, I found.</p>
<p>The only difference between a iFrame and a Facebook app are the size restrictments of 760px and some friend exchange functions, you probably will not be able to use as an app living inside FB. The other things are the same, since as an iFrame app you are technically another site living on a different server so all the cross-channel communication techniques and security models apply just like for an Connect app.</p>
<p>Also I would <strong>stay away from </strong>using <strong>XFBML </strong>whenever possible. XFBML works by parsing your HTML at runtime via Javascript and injecting iframes <em>within </em> your iframe when encountering a XFBML tag. When trying to use the XFBML language for display of Friend Selector, Permission dialogs etc. it tore my site apart and was generally unacceptable slow. I found that this architecture is probably not ready yet for production and it makes your site really slow at times.  </p>

<p><a href="http://feedads.g.doubleclick.net/~a/Qds5ellVLE2LkutH08FuVPXI9iw/0/da"><img src="http://feedads.g.doubleclick.net/~a/Qds5ellVLE2LkutH08FuVPXI9iw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/Qds5ellVLE2LkutH08FuVPXI9iw/1/da"><img src="http://feedads.g.doubleclick.net/~a/Qds5ellVLE2LkutH08FuVPXI9iw/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/11/fbseries-difference-iframe-connect-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/11/fbseries-difference-iframe-connect-apps/</feedburner:origLink></item>
		<item>
		<title>Lessons learned trusting Code Generators</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/H40v3bqlLlc/</link>
		<comments>http://www.uebersoftware.com/2009/10/lessons-learned-trusting-code-generators/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 22:42:10 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[Code Generators]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=155</guid>
		<description><![CDATA[To give you a short answer beforehand: Do not do it! But let me tell you my experience:
I started using Jersey back in 2007 when it was at version 0.4. Netbeans however already had a plugin to get you started on the fast track by generating REST Webservices out of Entity Classes, which you can [...]]]></description>
			<content:encoded><![CDATA[<p>To give you a short answer beforehand: Do not do it! But let me tell you my experience:</p>
<p>I started using <a href="https://jersey.dev.java.net/">Jersey </a>back in 2007 when it was at version 0.4. Netbeans however already had a plugin to get you started on the fast track by generating REST Webservices out of Entity Classes, which you can also generate out of an existing db schema. At that time I was only starting learning JPA and was happy that the Netbeans Code Generators took care of most of my Entity Access Code. In retrospective I should have made the effort of learning everything JPA beforehand and not gradually as I worked along. Usually I actually would have done that, but the Code Generators tricked me into not doing it: It just seemed too simple to bother. </p>
<p>Here is what Netbeans generated to get an object by primary key:</p>
<p><code><br />
Foo result = (Foo )service.createQuery("Select e from Foo e where e.id = :id").setParameter("id", id).getSingleResult();<br />
</code><br />
Compared to:<br />
<code><br />
Foo result = (Foo )service.find(Foo.class, id);<br />
</code></p>
<p>Problem with first approach besides being the obvious bloathed version: this will likely not be an easy cache hit wheras the second method, depending on your persistence provider will likely go a direct way to find the object within an identity map in the second level cache. </p>
<p>No big deal you might say just change the Query to a Finder method. Unfortunately its not just done with this because the getSingleResult also throws an unchecked NotFoundException when the Entity was not found, opposed to returning null in the finder method. In the generated code this exception was catched, wrapped and rethrown as a checked one. Nice so in some parts of my code was building logic upon those rethrown Exceptions when an entity was not found. So changing the way to retrieve an object had a long tail unfortunately.</p>
<p>Besides that the bigger problem is the design of an efficient and effective object domain model. I am speaking about fetch definitions, caching strategies, lazy / eager loading, and all that. At that time I was frankly just overloaded with a lot of other work beside the JPA stuff so I basically thought that the defaults that Netbeans generated might just work out well. Well no no no.</p>
<p>Another example are the Web Services Generators in Netbeans 6.7. As it turned out, the plugin developers have sometimes simplified-out methods as with the Facebook Service: There is no batching. You probably won&#8217;t write a Facebook application without using the batching support. </p>
<p>It feels to me that nowadays many IDE&#8217;s and tools come out with the message that they will do all the work for you. What you have to do is just some simple plumbing: enter an API key here, connect to your datebase there and you are done. My experience however is, even for a quick learning curve (and not learning by a bad example), it is better not to trust those generators in the first place and only use them if you can easily spot wrong code and correct such pieces yourself.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/cuB244LAAaGfzZ-ZYbaSOqlGj74/0/da"><img src="http://feedads.g.doubleclick.net/~a/cuB244LAAaGfzZ-ZYbaSOqlGj74/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/cuB244LAAaGfzZ-ZYbaSOqlGj74/1/da"><img src="http://feedads.g.doubleclick.net/~a/cuB244LAAaGfzZ-ZYbaSOqlGj74/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/10/lessons-learned-trusting-code-generators/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/10/lessons-learned-trusting-code-generators/</feedburner:origLink></item>
		<item>
		<title>Website deployments: Plain old Ant</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/OSmCw3PBPyU/</link>
		<comments>http://www.uebersoftware.com/2009/10/website-deployments-plain-old-ant/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 20:26:29 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Web2.0]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=150</guid>
		<description><![CDATA[In the last entry I was mentioning several solutions for managing web site deployments and packaging for php webapps. Since with PHP there is usually no build process already at development time this has often to be established especially for test &#038; production &#8211; and yes there needs to be a build process if you [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.uebersoftware.com/2009/10/initialise-external-javascript-in-page-fragments/">last entry</a> I was mentioning several solutions for managing web site deployments and packaging for php webapps. Since with PHP there is usually no build process already at development time this has often to be established especially for test &#038; production &#8211; and yes there needs to be a build process if you do serious php web development.</p>
<p>Despite Sprocket or similar tools I decided to go for the plain old ANT approach. Why? It was the most practical tool, you have full control of what you are doing and the other tools did not quite what I wanted.</p>
<p>One part of this ant solution was to configure production setting in several source files. I rediscovered just how powerful and really simple this great tool is. Once you get used to is configure,combine,pack and deploy your php/js/html/css is a piece of cake:</p>
<p>Here some excerpts<br />
In order to have just one source file I defined some custom preprocessor variables in my various files:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//@@prod@@ $config['base_dir']=&quot;&quot;;</span>
<span style="color: #666666; font-style: italic;">/*@@dev@@*/</span> <span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'base_dir'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Foo/&quot;</span><span style="color: #339933;">;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;!--@@js-dev-start@@ --&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;assets/js/jquery.plugin1.js&quot;&gt;&lt;/script&gt;
&lt;script type='text/javascript' src='assets/js/jquery.plugin2.js'&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;assets/js/jquery.plugin3.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;assets/js/jquery.plugin4.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;assets/js/jquery.plugin5.js&quot;&gt;&lt;/script&gt;
&lt;!-- @@js-dev-end@@ --&gt;
&lt;!-- @@js-prod-start@@ &lt;script type=&quot;text/javascript&quot; src=&quot;assets/js/jsbuild.js&quot;&gt;&lt;/script&gt; @@js-prod-end@@ --&gt;</pre></div></div>

<p>then in ant this looks as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Configuring PHP config for production&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;replaceregexp</span> <span style="color: #000066;">byline</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">flags</span>=<span style="color: #ff0000;">&quot;m&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;regexp</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^.*@@dev@@.*$&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;substitution</span> <span style="color: #000066;">expression</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;php/config/*.php&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/replaceregexp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;replaceregexp</span> <span style="color: #000066;">byline</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">flags</span>=<span style="color: #ff0000;">&quot;m&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;regexp</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^.*@@prod@@(.*)$&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;substitution</span> <span style="color: #000066;">expression</span>=<span style="color: #ff0000;">&quot;\1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;php/config/*.php&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/replaceregexp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>And for the javascript in my php &#8211; view files</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Configuring referenced Javascript for production&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;replaceregexp</span> <span style="color: #000066;">flags</span>=<span style="color: #ff0000;">&quot;sg&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;regexp</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;@@js-dev-start@@[^\@]*@@js-dev-end@@&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;substitution</span> <span style="color: #000066;">expression</span>=<span style="color: #ff0000;">&quot;&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}/php/view&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.php&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/replaceregexp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;replaceregexp</span> <span style="color: #000066;">byline</span>=<span style="color: #ff0000;">&quot;true&quot;</span>  <span style="color: #000066;">flags</span>=<span style="color: #ff0000;">&quot;m&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;regexp</span> <span style="color: #000066;">pattern</span>=<span style="color: #ff0000;">&quot;^.*@@js-prod-start@@(.*)@@js-prod-end@@.*$&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;substitution</span> <span style="color: #000066;">expression</span>=<span style="color: #ff0000;">&quot;\1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${build.dir}/php/view&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;**/*.php&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/replaceregexp<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Applying the concat task for js and css concatenation and apply java to invoke the yuicompressor and you&#8217;re done.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/8quR7Hn9tGcukadb-8OQV_Ugv5I/0/da"><img src="http://feedads.g.doubleclick.net/~a/8quR7Hn9tGcukadb-8OQV_Ugv5I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/8quR7Hn9tGcukadb-8OQV_Ugv5I/1/da"><img src="http://feedads.g.doubleclick.net/~a/8quR7Hn9tGcukadb-8OQV_Ugv5I/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/10/website-deployments-plain-old-ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/10/website-deployments-plain-old-ant/</feedburner:origLink></item>
		<item>
		<title>Initialise External Javascript in Page Fragments</title>
		<link>http://feedproxy.google.com/~r/uebersoftware/~3/8q7qjyCbI6Q/</link>
		<comments>http://www.uebersoftware.com/2009/10/initialise-external-javascript-in-page-fragments/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 19:03:27 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.uebersoftware.com/?p=136</guid>
		<description><![CDATA[In the last couple of hours I was contemplating around maintainable, performant and non-obstrusive Javascript on a project I am working on.
Following situation:
- Much Inline Javascript
- Many JS and CSS files referenced
- No Frontend Deployment/Build Process in place
- Some Javascript values are set at page generation time by Server Side code
- Webserver is not configured [...]]]></description>
			<content:encoded><![CDATA[<p>In the last couple of hours I was contemplating around maintainable, performant and non-obstrusive Javascript on a project I am working on.</p>
<p><strong>Following situation:</strong><br />
- Much Inline Javascript<br />
- Many JS and CSS files referenced<br />
- No Frontend Deployment/Build Process in place<br />
- Some Javascript values are set at page generation time by Server Side code<br />
- Webserver is not configured yet correctly for setting expires &amp; compression headers</p>
<p><strong>Problems with this:</strong><br />
- Maintainability and separation of concerns is an issue with lots of inline JS<br />
- Long Pageload because of many HTTP request<br />
- Webserver takes big hit for all the static content loading<br />
- Network is being stressed as well<br />
- Javascript Logic is unobfuscated/not minimised and visible to the world</p>
<p><strong>Tasks:</strong></p>
<ul>
<li>Externalize JS</li>
<li>Modularisation of JS Dependency Loading vs. all in one</li>
<li>Configuration of HTTP headers in Webserver</li>
<li>Identify Scripts / static content for CDN</li>
<li>Seamless Deployment/Build process from comfortable JS dev to the production code</li>
</ul>
<p>The &#8220;challenge&#8221; was to externalise the inline Javascript.</p>
<p>For modularisation there are <a href="http://getsprockets.org" target="_blank">several</a> <a href="http://www.nczonline.net/blog/2009/09/22/introducing-combiner-a-javascriptcss-concatenation-tool/" target="_blank">tools </a>to handle the dependency combination of Javascript files. Depending on the amount of Javascript and the usage metrics  you can as well just pack all in one. Of course there are <a href="http://www.hunlock.com/blogs/Supercharged_Javascript" target="_blank">many</a> <a href="http://carsonified.com/blog/features/webapps/serving-javascript-fast/" target="_blank">other</a> methods for combination and modularisation and you can as well just run your own method. So this is bascially just a matter of choosing the right tool / method and not that difficult. For compressing / minimisation the <a href="http://developer.yahoo.com/yui/compressor">YUI compressor</a> seems like state of the art.</p>
<p>Configuration of the correct headers is also just a &#8211; well &#8211; configuration task of setting meanigful caching control and expires headers and deflate compression for Apache2, so that the documents get compressed over the network. As for deploment and build process sprockets, ant or others are a valiable solution.</p>
<p>What I would like to share here is the solution for externalize Javascript that was initialised by server side code.</p>
<p>The basic idea builds upon<a href="http://www.dustindiaz.com/namespace-your-javascript/" target="_blank"> this post</a> by dustin diaz. So I am not gonna repeat his content instead if you are not familiar with private, public and privileged Objects in Javascript you might read his post first. As a starting point when combining multiple inline Javascript files we have to take care about namespaces.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//just namespacing</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> registerNS<span style="color: #009900;">&#40;</span>ns<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
 <span style="color: #003366; font-weight: bold;">var</span> nsParts <span style="color: #339933;">=</span> ns.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
 <span style="color: #003366; font-weight: bold;">var</span> root <span style="color: #339933;">=</span> window<span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i</pre></div></div>

<p>Ok so far so good, now we need to have a way initialise those external Javascript files with dynamic server-side variables:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//initialise a namespaced object</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> MY <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> private_var<span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">function</span> private_method<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// do stuff here</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
                init <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>var1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    private_var<span style="color: #339933;">=</span>var1<span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		method_1 <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;method 1&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		method_2 <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>private_var<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
MY.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;hey you!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
MY.<span style="color: #660066;">method_1</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
MY.<span style="color: #660066;">method_2</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>That worked out as well. But there&#8217;s a but. Our javascript will be referenced externally and along with the <a href="http://developer.yahoo.com/performance/rules.html#external" target="_blank">YUI Performance rules</a> the script include tags will be at the bottom of the page. The initialisation code on the other hand is at the top of every page fragment/widget and might be executed at rendering time. To prevent timing problems the initialisation code therfore needs to configure an object that is already live:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">//global js config obj</span>
<span style="color: #003366; font-weight: bold;">var</span> runcfg <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//within html</span>
<span style="color: #003366; font-weight: bold;">var</span> a <span style="color: #339933;">=</span> runcfg<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;details&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
a<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://uebersoftware.com&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">//external js</span>
<span style="color: #003366; font-weight: bold;">var</span> MY <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> private_var<span style="color: #339933;">;</span>
        <span style="color: #003366; font-weight: bold;">var</span> myconfig <span style="color: #339933;">=</span> runcfg<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;details&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #003366; font-weight: bold;">function</span> private_method<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// do stuff here</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000066; font-weight: bold;">return</span> <span style="color: #009900;">&#123;</span>
                init <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>var1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    private_var<span style="color: #339933;">=</span>var1<span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
		method_1 <span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>myconfig <span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;url&quot;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// usage</span>
MY.<span style="color: #660066;">method_1</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This method allows us easy externalized the Javascript without much refactoring. The script code is namespaced and is still dynamically configurable.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/1tkNAOLipV7MX7Q4Y_JdssaV7Cg/0/da"><img src="http://feedads.g.doubleclick.net/~a/1tkNAOLipV7MX7Q4Y_JdssaV7Cg/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/1tkNAOLipV7MX7Q4Y_JdssaV7Cg/1/da"><img src="http://feedads.g.doubleclick.net/~a/1tkNAOLipV7MX7Q4Y_JdssaV7Cg/1/di" border="0" ismap="true"></img></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.uebersoftware.com/2009/10/initialise-external-javascript-in-page-fragments/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.uebersoftware.com/2009/10/initialise-external-javascript-in-page-fragments/</feedburner:origLink></item>
	</channel>
</rss>
