<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>z the world</title>
	<atom:link href="http://www.z2-environment.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.z2-environment.net/blog</link>
	<description>all things &#34;z&#34;</description>
	<lastBuildDate>Sat, 19 May 2012 08:07:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why Change Management is Hard</title>
		<link>http://www.z2-environment.net/blog/2012/05/why-is-change-management-so-hard/</link>
		<comments>http://www.z2-environment.net/blog/2012/05/why-is-change-management-so-hard/#comments</comments>
		<pubDate>Wed, 16 May 2012 22:00:40 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=244</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
This post is about software change management, the problem and procedures involved with maintaining progress and quality of a team-developed software solution over time. As Alex puts it in his unusual DailyWTF post this is a discipline that is neither &#8230; <a href="http://www.z2-environment.net/blog/2012/05/why-is-change-management-so-hard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>This post is about software change management, the problem and procedures involved with maintaining progress and quality of a team-developed software solution over time.</p>
<p>As Alex puts it in his <a href="http://thedailywtf.com/Articles/Release-Management-Done-Right.aspx">unusual DailyWTF post</a> this is a discipline that is neither part of software development nor software engineering. And more so, the inherent problems are hardly recognized by most developers nor architects. For most IT people this is located somewhere in the Q-Space, something somebody has to take care of and usually only gets on your nerves. I am no exception to that. It took me years to realize that this is the spine of the software development process. Initially almost any approach will do, but when team and solutions grow, a weak spine will bend and finally break.</p>
<p>When asked about software change management most developers will think of SCM systems like Suversion, Git, or Perfore – the tools that we are faced with when generating change in the first place.</p>
<p>The frustrating part of change management starts when selectively moving changes from one &#8220;solution version&#8221;, say a branch, to another: Most everybody will have had these super frustrating moments when merging changes has turned into an endless, painful double maintenance experience.</p>
<p>Here is a simplified view of places that receive changes (typically a branch in some SCM, at the far right end in many cases a runtime):</p>
<p><a href="http://www.z2-environment.net/blog/wp-content/uploads/2012/05/text4892-4-9-2.png"><img class="alignnone  wp-image-283" title="text4892-4-9-2" src="http://www.z2-environment.net/blog/wp-content/uploads/2012/05/text4892-4-9-2.png" alt="" width="736" height="324" /></a></p>
<p>The problem does not lie in re-merging of feature branches – illustrated on the left side of the flow diagram. Those flows are rather well addressed by standard SCM workflows (more true for Git than Subversion though).</p>
<p>Neither does the final push of changes to the execution environment pose a problem – typically a straightforward forward-merge.</p>
<p>The merge approach breaks down when managing the conflicting interest of feature integration and selective feature release into pre-production stabilization. I.e. when crossing the “divide” in the diagram:</p>
<ul>
<li>Without seeing features work in integration, all talk about feature readiness is moot. This is particularly true for solution/application development. There is a need to have changes enter into integration as soon as possible. On the other hand:</li>
<li>You do not want to stall development. There is no pause. In order to qualify for production a subset of all change history must be isolated from receiving further changes to be tested (and usually fixed) to qualify for production.</li>
</ul>
<p>The reason the second issue is hard lies in the nature of solution development. Technologists suggest to approach integration problems by reducing the size of components and attempts to define slowly changing component interfaces, so that you can version and release on disjoint parts of the code base. In application development however complexity has a tendency to spread out: End-user requirements typically do not map well to module boundaries so that there is constant overlap between completed developments and half-done features.</p>
<p>The selective push of features from integration to stabilization has a number of technical problems and some more interesting process problems. The decision to release a set of changes that make a feature should be with the ones being ultimately responsible to also fix problems later on: The development team, or preferably the individual developer who introduced the changes. Technically changes made by different developers may interfere with each other so that management of a change release queue is necessary.</p>
<p>There is other approaches out there. For example the Facebook style “release everything from trunk every week” (and hence avoiding selective integration at all, see <a href="http://www.facebook.com/video/video.php?v=10100259101684977">here</a>). But that applies “only” to the Facebook frontend where features can even be turned on and off selectively, and where the backend takes the burden of maintaining consistency (plus it&#8217;s functionally a rather simple application anyway). I doubt that that would work well for Facebook backend development.</p>
<p>So much for the problem description.</p>
<p>Coincidentally I know from my past experience that this is one of the problems that traditional SAP software logistics solves quite nicely. Unfortunately I was not able to identify a publicly available tool that addresses these problems.</p>
<p>How are we doing this today? We muddle through, try to identify complete snapshots, stall development&#8230;. it sucks.</p>
<p>It would be extremely cool to have a tool that</p>
<ol>
<li>allows developers to group changes into “feature change sets” and release them for integration into another code line</li>
<li>manages a change set queue and implements workflows to resolve dependencies on the queue of change sets</li>
</ol>
<p>Know something? Please let me know as well.</p>
<h2>References</h2>
<ul>
<li><a href="http://thedailywtf.com/Articles/Release-Management-Done-Right.aspx">http://thedailywtf.com/Articles/Release-Management-Done-Right.aspx</a></li>
<li><a href="http://www.facebook.com/video/video.php?v=10100259101684977">http://www.facebook.com/video/video.php?v=10100259101684977</a></li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2012/05/why-is-change-management-so-hard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Work Done Asynchronously</title>
		<link>http://www.z2-environment.net/blog/2012/04/getting-work-done-asynchronously/</link>
		<comments>http://www.z2-environment.net/blog/2012/04/getting-work-done-asynchronously/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 07:00:20 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=163</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
This post is about asynchronous work in back end software. It is part one of a series of two posts. This part looks at use cases and motivations for server-side background work &#8211; some of which most developers will have &#8230; <a href="http://www.z2-environment.net/blog/2012/04/getting-work-done-asynchronously/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>This post is about asynchronous work in back end software. It is part one of a series of two posts.</p>
<p>This part looks at use cases and motivations for server-side background work &#8211; some of which most developers will have run into &#8211; and we prepare the stage for the implementation described in the second post: Getting Work Done with Quartz and Z2.</p>
<p>With background work or asynchronous work we denote activities that happen outside the scope of user interactions &#8211; but within the user&#8217;s business scope of course.</p>
<p>In essentially any not completely trivial business software, there is some work that is best offloaded to a later point in time or to different computing resources. Some typical use cases are</p>
<ul>
<li>Updating a search index or some analytical data (can be expensive and time consuming)</li>
<li>Following up on some state change of a business entity, e.g. by sending emails</li>
<li>Producing a state change of a business entity due to an expiration condition</li>
</ul>
<p>These examples already give a good clue about the main motivation for background work:</p>
<ol>
<li>It has to be done once in while &#8211; but cannot be done on-demand as it is too expensive (either in time or space)</li>
<li>It has to be done, but it is not necessary to have the user wait for it (and hence impact the user experience)</li>
<li>It has to be done at some defined later point in time (e.g. order to be revisited two weeks after creation).</li>
</ol>
<p>Another, great motivation to put work into the background is &#8230;</p>
<ol>
<li value="4">&#8230; that the operation is not reliable and may need to be tried again at some later point in time (e.g. mail server problems, overload, etc.) and finally that</li>
<li>&#8230; that resources may be used more efficiently, if work can be queued up and processed when resources are available rather when there is peaks of user load</li>
<li>&#8230; to move the work elsewhere so that e.g. front end resource are not impacted and so that user experience is not harmed</li>
</ol>
<p>All of these cases fall into one of the following two categories:</p>
<p><strong><strong>Asynchronous</strong> GET (AGET):</strong> The operation is idempotent. The operation generates some information, that &#8211; if nothing else is changed &#8211; stays unchanged. Computing analytical insight is an example for this case. This kind of work can be postponed, or repeated as convenient. The reason for an &#8220;Async GET&#8221; is an optimization.</p>
<p><strong>Asynchronous POST (APOST):</strong> The operation implies a state change. It should be performed either as soon as possible or at some given point in time. An APOST corresponds to a user interaction. An APOST typically needs to some input data for processing. Once done, the operation may not be repeated. The reason for an APOST is an optimization of user experience or some intended deferment.</p>
<p>The analogy with the HTTP method GET and POST is intended and complete. In fact, all the sample use cases above, any use case I have encountered, can be modeled as scheduled GET or a deferred POST request. The analogy carries further: A scheduling system should indeed allow to trigger an AGET or retrigger an APOST at any time in a way that an administrator can completely infer the meaning and target of the &#8220;request&#8221;.</p>
<p>The analogy reduces the scheduling system to where it belongs: Managing activity triggers in time. This includes:</p>
<ul>
<li>Some concurrency control: In many cases it is more efficient that the scheduling system doesn&#8217;t even try is some other activity is still ongoing rather than blocking on the application layer.</li>
<li>Ability to re-attempt some activity for some number of times and with some delay</li>
<li>Some visual management of pending or failed activities</li>
</ul>
<p>More on that in &#8220;Getting Work Done with Quartz and Z2.&#8221;. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2012/04/getting-work-done-asynchronously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven may not solve the problem you thought it solves&#8230;.</title>
		<link>http://www.z2-environment.net/blog/2012/03/maven-may-not-solve-the-problem-you-thought-it-solves/</link>
		<comments>http://www.z2-environment.net/blog/2012/03/maven-may-not-solve-the-problem-you-thought-it-solves/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 08:31:43 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=198</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
This post is about Apache Maven and why I think it does not deliver what many developers hope to get from it. Maven is a build and dependency management tool. Maven claims to be something more general, but I think &#8230; <a href="http://www.z2-environment.net/blog/2012/03/maven-may-not-solve-the-problem-you-thought-it-solves/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>This post is about Apache Maven and why I think it does not deliver what many developers hope to get from it.</p>
<p>Maven is a build and dependency management tool. Maven claims to be something more general, but I think that is misleading:</p>
<p>&lt;quote from=&#8221;<a href="http://maven.apache.org/guides/getting-started/index.html">Maven Getting Started Guide</a>&#8220;&gt;<br />
At first glance Maven can appear to be many things, but in a nutshell Maven is an attempt <em>to apply patterns to a project&#8217;s build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices</em>. Maven is essentially a project management and comprehension tool&#8230; .<br />
&lt;/quote&gt;</p>
<p>Whatever&#8230; let&#8217;s call it a build tool for the moment. When people start looking into Maven, that&#8217;s is the problem they are trying to solve. All the other aspects of Maven, i.e. all the other stuff it does, I&#8217;d call a consequence of the environment it was initially developed for and where it grew up.</p>
<p>Beyond general curiosity that is also why I looked into Maven. I even recommended Maven to address software production issues for a non-trivial software system. I would not do that anymore. Here is why.</p>
<p>When I started looking into Maven I wanted to solve the problem of &#8220;maintaining a solution consisting of several interrelated modules without caring much about build problems&#8221;. As it turned out, that&#8217;s not what Maven is built for.</p>
<h2>How Does It Work?</h2>
<p>Let&#8217;s not look into how Maven invokes a compiler or build plugins and such. The more significant aspect is that Maven relies on repositories that hold artifacts, by name and version, typically produced by other Maven builds. In fact, you have one locally. When Maven cannot find what it needs, it will go to remote repositories and fill your local repository that then serves as a cache. Also Maven plugins, the code that actually implements the very thing you wanted it to do in the first place comes from there (which is consistent). That&#8217;s why Maven, on first call for anything, seems to virtually &#8220;download half the internet&#8221; (which, no, I am not complaining about. That is just bootstrapping).</p>
<p>Maven projects are described in a Project Object Model (POM). Ignoring the details, the POM describes project type, some version numbering and dependencies (by name and version). Dependencies are resolved using the repositories.</p>
<p>You put stuff into a local repository by <strong>install</strong>ing it. You put it into remote repositories by <strong>deploy</strong>ing it (see references below).</p>
<p>So in short, apart from actually invoking plugins that transform some source code artifact into something better process- or  machine-processable, Maven is all about managing artifacts between your local development environment and some remote storage that provides missing dependencies to you and others.</p>
<h2>What Problem Does It Solve?</h2>
<p>Maven was built for Apache. And that&#8217;s where the approach makes most sense. Many  projects are single-project really with dependencies to stuff that is out of individual reach, so that Maven&#8217;s repository approach provides an automated, defined interface to getting a hands on some other project, in the form of its (binary) output, it&#8217;s released artefacts.</p>
<p>So, Maven is great, if you want to integrate into the Apache Eco-System as you are right in it &#8211; from the start &#8211; and you have well-defined interface to express your dependency onto other people&#8217;s projects.</p>
<h2>Maven for Solution Development?</h2>
<p>When developing and maintaining a software system that comprises of any non-trivial number of modules however, you will want:</p>
<ul>
<li><strong>Integrity:</strong> You do not want to fiddle around and dive deeply into your dependency version vector. There should be one place to look for what is being used in your system, and their should be no doubt whatsoever where that comes from.</li>
<li><strong>Modifiability:</strong> Sooner or later you will need to fix something that initially was taken from elsewhere and is now part of your system.</li>
<li><strong>Repeatability:</strong> Whether you look at your system code now or in two years. If and when you need to build it, the result should be guaranteed to be identical.</li>
</ul>
<p>So&#8230; thinking about it, what this means is that you &#8211; at least &#8211; need to take ownership of the surrounding infrastructure. I. e. you need implement/set up your own shared repositories to guarantee availability and repeatability. You may need to take over local versions of other projects to make sure you can patch. So that&#8217;s a principle problem that may not be obvious in the beginning: You are now in charge of operating a non-trivial distributed infrastructure.</p>
<p>Secondly, you buy into the complexity of managing non-trivial version vectors although you really didn&#8217;t mean to build a network of independent components that somehow get intelligently integrated into a solution. You just wanted to work on your solution. Maybe even in a Product Line Engineering style. But you definitely didn&#8217;t want fine-grained module level versioning.</p>
<p>So in short, something that is useful for a large number of relatively small and independent groups of interest does not apply well to highly interdependent groups that work on a large, modular software system.</p>
<h2>Conclusion</h2>
<p>Well&#8230; you can guess where this is going. I am convinced that solution development and maintenance demands a system-centric approach &#8211; and I have seen that successfully implemented. Solving it by adding secondary tools and configuration from the “outside” that eventually has a similar complexity as the actual solution simply doesn&#8217;t cut it.</p>
<h2>References</h2>
<ul>
<li>History of Maven: <a href="http://maven.apache.org/background/history-of-maven.html">http://maven.apache.org/background/history-of-maven.html</a></li>
<li>Funny rant: <a href="http://tech.puredanger.com/2009/01/28/maven-adoption-curve/">http://tech.puredanger.com/2009/01/28/maven-adoption-curve/</a></li>
<li>Maven vs. Ant: <a href="http://www.iternum.com/knowhow/guidelines/maven-vs-ant/document.pdf">http://www.iternum.com/knowhow/guidelines/maven-vs-ant/document.pdf</a></li>
<li>Plugin reference: <a href="http://maven.apache.org/plugins/index.html">http://maven.apache.org/plugins/index.html</a></li>
<li><a title="System Centric Development" href="http://www.z2-environment.net/blog/2011/12/system-centric-development/">System Centric Development</a></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2012/03/maven-may-not-solve-the-problem-you-thought-it-solves/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ERP People get it</title>
		<link>http://www.z2-environment.net/blog/2012/02/erp-people-get-it/</link>
		<comments>http://www.z2-environment.net/blog/2012/02/erp-people-get-it/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 07:00:27 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[z2]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=38</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
Lately we have been visiting a potential customer of ours that is interested in learning more about z2 and eventually using it to increase development productivity, maintainability as well as customizability of customer installations. The approach behind z2, i.e. what &#8230; <a href="http://www.z2-environment.net/blog/2012/02/erp-people-get-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>Lately we have been visiting a potential customer of ours that is interested in learning more about z2 and eventually using it to increase development productivity, maintainability as well as customizability of customer installations.</p>
<p>The approach behind z2, i.e. what we like to call <a title="System Centric Development" href="http://www.z2-environment.net/blog/2011/12/system-centric-development/"><em>System Centric</em></a>, to a large extent and regardless of the implementation implies or at least fosters these attributes. As there is little to no development setup, no build fixing, and integration happens essentially as soon as meaningfully possible, productivity naturally goes up. As sources and customization is always at hand, maintaining and customizing further works just as well as the solution at hand intrinsically allows.</p>
<p>What is strikes me is that developers and operations professionals with an ERP background (disclaimer: not even SAP in this case) typically get this right away.</p>
<p>That is strangely contrasted by the observation that Java developers have a much harder time to notice the waste of time and the added complexity that  gets dragged along. That may be due to being so deeply used to the working mode  that it has become close to a natural law &#8211; nothing to question anymore.</p>
<p>Another reason could be that every now and then some toolset manages to creates a level of hype and a so deeply convinced following that tools expand beyond their space of usefulness. In other words, there is a lot of &#8220;golden hammers&#8221; out there. One now historical example is the Enterprise Java Beans (EJB) technology, that actually started out as Remote Objects &#8211; which makes sense &#8211; and then got perverted into some sort of locked away, XML polluted, and finally slowly starved &#8220;Java Objects Deluxe&#8221;.</p>
<p>One more recent example is the Maven toolset. Not saying that it doesn&#8217;t have it&#8217;s place and problem to solve. It does. Development and maintenance for business solutions is however not part of the Maven problem space. More on that in another post.</p>
<p>In the specific case, the development team had lost a lot of time fiddling with OSGi dependencies, building and deploying bundles, keeping installations in sync, keeping version vectors straight and more technical aspects of solution assembly &#8211; none of which added value to the solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2012/02/erp-people-get-it/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Map Reduce Applications with z2 &#8211; Part 1</title>
		<link>http://www.z2-environment.net/blog/2012/01/map-reduce-applications-w-z2-part-1/</link>
		<comments>http://www.z2-environment.net/blog/2012/01/map-reduce-applications-w-z2-part-1/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 07:00:14 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[software engineering]]></category>
		<category><![CDATA[z2]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=32</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
When storing massive amounts of data in a distributed storage the Map/Reduce (M/R) algorithm provides a generic and effective means to compute data transformations spanning large datasets. The underlying assumption is that each storage node (think: machine) provides computing power &#8230; <a href="http://www.z2-environment.net/blog/2012/01/map-reduce-applications-w-z2-part-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>When storing massive amounts of data in a distributed storage the <a href="http://en.wikipedia.org/wiki/MapReduce">Map/Reduce</a> (M/R) algorithm provides a generic and effective means to compute data transformations spanning large datasets. The underlying assumption is that each storage node (think: machine) provides computing power that can be used for custom, parallelized data processing and benefits strongly from data locality.</p>
<p>At Original1 we use <a href="http://hadoop.apache.org/">Apache Hadoop</a>, a popular open source implemention of a distributed file system (HDFS) and of an M/R runtime in conjunction with <a href="http://hbase.apache.org/">Apache HBase</a>, a NoSQL database, to store large numbers of rather simply structured, versioned data records.</p>
<p>In order to provide analytical insight across all data records, we use Map/Reduce jobs that compute aggregations, look at anormalities in record history and more.</p>
<p>One of the attractive aspects of Map/Reduce jobs is that it is your code that is executed directly where the data is stored. Not some restricted query language. That is, on the other hand, also one of the biggest weaknesses: The M/R implementation is a very weak and limiting application container.</p>
<p>This post is about how the <a href="http://www.z2-environment.eu/home">z2-Environment</a> can be used to overcome this limitation and how to integrate M/R seamlessly into your solution.</p>
<h2>What&#8217;s the Problem?</h2>
<p>In order to run your M/R implementation you need to package the job&#8217;s code into a JAR archive and schedule the job with Hadoop&#8217;s Job Tracker. Your JAR gets eventually downloaded to all data nodes and executed locally. This is no unreasonable limitation, if that&#8217;s all you want to do: Run M/R jobs. Typically however, data analysis is just one part of the overall solution and in order to make sense out of the data, you will want to reuse a lot of the code that you used elsewhere, e.g. domain types, service implementations, utilities.</p>
<p>Also, whatever is the result your job delivers, frequently it will need RDBMS stored data to be completed and/or stored. And no, contrary to some enthusiasts, HBase/Hadoop or other NoSQL storage engines will put no end to relational databases.</p>
<p>So, in short, while the technology is an interesting addition, it is poorly integrated.</p>
<h2>How Z2 Fixes This</h2>
<p>The integration of z2 with Hadoop is an example of using the embedded mode of z2 (see <a href="http://www.z2-environment.eu/v20doc#embedded">embedded</a>). When scheduling an M/R job, below is an example of how that happens, z2 will actually upload a JAR with Hadoop for execution. That JAR however is completely generic and all it does is to start the z2 runtime, retrieve the actual Job component and delegate the actual Hadoop interface calls (Mapper, Combiner, Reducer) to the z2 hosted implementation.</p>
<p><a href="http://www.z2-environment.net/blog/wp-content/uploads/2011/12/z2_hadoop.png"><img class="alignnone size-full wp-image-166" title="z2_hadoop" src="http://www.z2-environment.net/blog/wp-content/uploads/2011/12/z2_hadoop.png" alt="" width="800" height="330" /></a></p>
<p>The embedded z2 works as always: It checks whether local updates from the connected SCM are required and updates (and compiles if applicable) on demand. Your Job component can do what any other component of your solution can do, e.g. re-use code, connect with a database etc. It is defined where all the rest is defined, in the very same module/component structure.</p>
<h2>Anatomy of an M/R Job</h2>
<p>As part of the integration, the Hadoop module provides a component type <strong>com.zfabrik.hadoop.job</strong>. A component of this type is supposed to provide an implementation of the interface <strong>IMapReduceJob</strong> that describes everything a Job implementation has to say about its execution:</p>
<pre>public interface IMapReduceJob&lt;MKEYIN,MVALUEIN,MKEYOUT,MVALUEOUT,RKEYOUT,RVALUEOUT&gt; {
    String TYPE = "com.zfabrik.hadoop.job";
    void init(String name);

    boolean hasMapper();
    boolean hasCombiner();
    boolean hasReducer();

    Mapper&lt;MKEYIN,MVALUEIN,MKEYOUT,MVALUEOUT&gt; getMapper(Configuration configuration);
    Reducer&lt;MKEYOUT,MVALUEOUT,MKEYOUT,MVALUEOUT&gt; getCombiner(Configuration configuration);
    Reducer&lt;MKEYOUT,MVALUEOUT,RKEYOUT,RVALUEOUT&gt; getReducer(Configuration configuration);

    Job configure(Configuration configuration) throws Exception;
}</pre>
<p>The methods are relevant at different parts in the life cycle of an M/R job. In order to schedule, the <strong>configure</strong> method will be called. Also, at the time of configuration, the job will be asked about what M/R phases it supports (<strong>hasMapper</strong>, <strong>hasCombiner</strong>, <strong>hasReducer</strong>).</p>
<p>At execution time, on the data nodes, the same implementation will be asked to provide concrete implementations (<strong>getMapper</strong>, <strong>getCombiner</strong>, <strong>getReducer</strong>). Hence, the interface is really just a simple abstraction of a job definition.</p>
<p>For example, the <strong>configure</strong> method for the Word Count example (Hadoop&#8217;s Hello World program, see <a href="http://wiki.apache.org/hadoop/WordCount">http://wiki.apache.org/hadoop/WordCount</a>), would look like this:</p>
<pre> public Job configure(Configuration conf) throws Exception {
    Job job = new Job(conf);
    job.setOutputKeyClass(Text.class);
    job.setOutputValueClass(IntWritable.class);
    job.setInputFormatClass(TextInputFormat.class);
    job.setOutputFormatClass(TextOutputFormat.class);
    FileInputFormat.addInputPath(job, new Path(this.inPath));
    FileOutputFormat.setOutputPath(job, new Path(this.outPath));
    return job;
}</pre>
<p>Very much like the original &#8211; if not simpler. The difference is that the configuration is preset by z2, in order to abstract the actual connectivity information (which should of course not be part of the component), and that the actual job submission, for similar reasons, is not in the job component implementation.</p>
<p>Jobs can be scheduled programmatically or from a simple web interface for execution on any configured hadoop cluster or locally (for debugging).</p>
<p>Programmatic scheduling looks like this:</p>
<pre>IJobConfigurator jc = IComponentsLookup.INSTANCE.lookup(jobComponentName,IJobConfigurator.class);
Configuration c = IComponentsLookup.INSTANCE.lookup(hadoopConfigurationComponentName,Configuration.class);
jc.configure(c);
jc.submit();</pre>
<p>The first lookup is for the Job Component. E.g. the Word Count job implementation. The second lookup is for the Hadoop client configuration component. Another component type that simply holds a <strong>core-site.xml</strong> file (Hadoop&#8217;s properties in XML file format) that defines how to connect to Hadoop (and possibly HBase) and more.</p>
<p>Be aware that programmatic scheduling is a common, although not completely trivial use-case: In most cases M/R jobs will be scheduled either on a by-time basis (i.e. via some cron-type scheduling) or as the result of some data change that invalidates some previous computation. Smart scheduling of jobs is a worthy subject on its own (i.e. a related post just got scheduled).</p>
<h2>Where Can I Get That?</h2>
<p>This technology is used by Original1. We are planning to release it in a new distribution (working title z2@hadoop) anytime soon (i.e. as soon as we get to it). That&#8217;s why this post is called &#8220;Part 1&#8243; &#8211; Part 2 will point to the actual distribution and documentation. If you want it earlier &#8211; talk to us.</p>
<h2>Summary</h2>
<p>The integration of z2 with Hadoop is another strong case of the <a title="System Centric Development" href="http://www.z2-environment.net/blog/2011/12/system-centric-development/">System Centric</a> approach. Via a seamless integration, Hadoop can be added to your solution space without the need to change the structure of other parts and with full re-use capabilities.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2012/01/map-reduce-applications-w-z2-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Agony Cycle of Solution Development</title>
		<link>http://www.z2-environment.net/blog/2012/01/the-agony-cycle-of-solution-development/</link>
		<comments>http://www.z2-environment.net/blog/2012/01/the-agony-cycle-of-solution-development/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 07:00:46 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=95</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
Software projects, eventually, go through one or more &#8220;Cycles of Agony&#8221;. At the start of a software project, opportunities look promising, productivity and motivation is high. It takes experience and sweat to come up with a somewhat stable initial structure &#8230; <a href="http://www.z2-environment.net/blog/2012/01/the-agony-cycle-of-solution-development/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p><em>Software projects, eventually, go through one or more &#8220;Cycles of Agony&#8221;.</em></p>
<p>At the start of a software project, opportunities look promising, productivity and motivation is high. It takes experience and sweat to come up with a somewhat stable initial structure that is instructive, scales with the problem space, is sufficiently modular (i.e. keeps complexity manageable).</p>
<p>Regardless how well you manage all necessary compromises (e.g. productivity vs. process), how well you were able to foresee required tools and technologies, how well the business case was understood: Projects (if not abandoned) eventually run into a state of unproductivity that shows one or more of the following symptoms:</p>
<ul>
<li>Developers are unsure on how things are supposed to be done,</li>
<li>The architecture tends to show unneeded abstractions of previous abstractions,</li>
<li>Conceptual integrity breaks down,</li>
<li>a general fear of touching things that &#8220;worked before&#8221; (no daring)</li>
</ul>
<p>It&#8217;s unavoidable. Inherently, the business scenario at hand is only partially understood and will most likely change over time, inherently new use-cases, new technologies to integrate with, new customer requirements will show up (why spend money on developing a new software otherwise at all?). Hence the probability to make only the right far-reaching decisions is essentially zero.</p>
<p>The Agony Cycle looks somewhat like this:</p>
<p><a href="http://www.z2-environment.net/blog/wp-content/uploads/2011/12/software_agony_cycle.png"><img class="alignnone size-full wp-image-154" title="software_agony_cycle" src="http://www.z2-environment.net/blog/wp-content/uploads/2011/12/software_agony_cycle.png" alt="" width="812" height="614" /></a></p>
<p>What to do, when you are in the &#8220;agony&#8221; part of the chart? Well, it depends!</p>
<p>If the solution at hand is a &#8220;<a href="http://en.wikipedia.org/wiki/Growth-share_matrix">cash cow</a>&#8221; (rather than a <a href="http://en.wikipedia.org/wiki/Growth-share_matrix">star</a>), it may well make sense to not dare big change and consciously  move on into indefinite maintenance (and for developers to leave). Otherwise though, tough decisions are required to get you back on track. Previous decisions have to be reverted, possibly requiring non-trivial refactorings that do not result in immediate benefits. Although you (hopefully) have a product already, you need to pay a price that doesn&#8217;t linearly add obvious value (a concept that looked much more acceptable in the beginning). Whereas in the beginning of the cycle craftmanship was essential, now the willingness for change is key to further success.</p>
<p>In larger organizations, the risk of change may be considered too high and the need of change is politically undesired. That&#8217;s one reason why we see seemingly inexplicable failure to innovate on existing products by big players in the market.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2012/01/the-agony-cycle-of-solution-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting along&#8230;</title>
		<link>http://www.z2-environment.net/blog/2011/12/scripting-along/</link>
		<comments>http://www.z2-environment.net/blog/2011/12/scripting-along/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 09:05:22 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=82</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
This post is inspired by a discussion with a development lead of a company nearby and by the blog post &#8220;What about complexity in software&#8220;. The specific discussion was about the idea of using a scripting language (think PHP, Python, &#8230; <a href="http://www.z2-environment.net/blog/2011/12/scripting-along/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>This post is inspired by a discussion with a development lead of a company nearby and by the blog post &#8220;<a href="http://expectrain.com/2011/11/14/what-about-complexity-in-software/">What about complexity in software</a>&#8220;.</p>
<p>The specific discussion was about the idea of using a scripting language (think PHP, Python, Ruby, Groovy et al) for developing business applications and integration features.</p>
<p>A perfectly reasonable approach. Everything inside me rejected it.</p>
<h2>But:</h2>
<p>There is more context to the discussion of course &#8211; which is why the formulation above is slightly unfair to the reader. But before going into any detail, let&#8217;s disect the situation a little bit.</p>
<p>For simplicity let&#8217;s assume you already have some software asset that you need to develop further in some specified but rather broad direction (i.e. expectations unclear as so often &#8211; but there is a distinct feeling of necessity).</p>
<p>Now, every time you make a decision about adding some tool (or technology, or team split, or&#8230;) into the big picture  you do not only make a step in some direction but you do also <em>add complexity and limit further possibilities</em>. While you can achieve more short term, it will typically be hard to revert that other decision or to make a competing, challenging, similar decision later on.</p>
<p>How hard changing a decision is, depends on how easily the change can be implemented. When changes can be implemented more or less atomically and others involved are not confronted with the unexpected, we tend to call that a refactoring**. All other cases are revolutions, causing significant pain before showing tangible improvements. If the pain and risk factor is large and your organization is sufficiently political, decisions will probably not be taken at all (or late, or for political reasons) and you should generally consider yourself screwed (bye bye progress!).</p>
<p>That said you should naturally strive to delay the unavoidable and:</p>
<ol>
<li>Make sure you really need to pick a tool at all.</li>
<li>Make sure to pick a tool that carries as far as possible &#8211; albeit possibly not the most sexy one short term (so that you can live with it longer &#8211; even if you do not love it).</li>
<li>Make sure to pick a tool that can scale with your problem space.</li>
</ol>
<h2>Back to the Point</h2>
<p>Enough of that and back to the beginning of the post and the specific question of whether to use a scripting language for application development is a smart thing to do.</p>
<p>Scripting languages (at least the ones named above) are tuned for productivity. The general idea is provide for productivity by requiring little declarative &#8220;overhead&#8221;, provide simple and versatile data structures, high-level rich operations, and be relaxed about type safety and sometimes syntax.</p>
<p>Scripting languages are great for <em>&#8220;wide but thin&#8221;</em>: Shallow layering of code, mostly local data structure, many variations of the same pattern. Heavy re-use of non-trivial data structures and interfaces, deeply designed call hierarchies, performance-critical code are not what you should bring to the party.</p>
<p>Considering bullet point two above, if you know you are in for &#8220;wide but thin&#8221; and you can handle other known implications (e.g. deployment and distribution), go for the lightness and productivity of your favorite scripting tool. If you don&#8217;t know what you are in for, pick a tool that carries further &#8211; i.e. Java (it was about time I&#8217;d say that!), or C#, or C/C++ even (depending on your problem domain again &#8211; of course) &#8211; although that may be perceived as harder.</p>
<p>&#8212;</p>
<p>**) The ability to refactor instead of &#8220;throw away and redo&#8221; or &#8220;live with the pain eternally&#8221; cannot be praised enough.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2011/12/scripting-along/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System Centric Development</title>
		<link>http://www.z2-environment.net/blog/2011/12/system-centric-development/</link>
		<comments>http://www.z2-environment.net/blog/2011/12/system-centric-development/#comments</comments>
		<pubDate>Sun, 18 Dec 2011 21:00:00 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[software engineering]]></category>
		<category><![CDATA[z2]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=57</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
In my previous life at SAP, I was first part of the team designing and developing the runtime of the Enterprise Portal product and later I was part of the Java EE Engine (a.k.a. SAP Netweaver/Java) team. Both systems were &#8230; <a href="http://www.z2-environment.net/blog/2011/12/system-centric-development/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>In my previous life at SAP, I was first part of the team designing and developing the runtime of the Enterprise Portal product and later I was part of the Java EE Engine (a.k.a. SAP Netweaver/Java) team.</p>
<p>Both systems were initially really simple. Simple in the sense that a runtime developer could typically work on the whole system at once &#8211; as far as he or she was concerned at least. It would all fit into one development workspace. If you wanted to test or debug something: No problem. Just check out the whole thing, build it on your machine, and run it.</p>
<p>Life was good.</p>
<p>That changed. Bug reports were coming in for some already (internally) released version. How to find out what was really running on the other side? How to reproduce the bug in your environment? Still you could stretch things somehow. People might allow you to deploy patches and try again. Still somehow manageable. We got used to it.</p>
<p>But then things got more complex. And all the sudden you found yourself not anymore at the more comfortable lower layers but rather sandwiched between some framework you used (that library over here) and users of your code (this complex HR application over there). Add the versioning problem and the mess is complete.</p>
<p>At some point in time setting up a complete environment required some non-trivial installation and tweaking that could easily stop you for half a day. Potentially leading to the devastating outcome that the weekly build of service pack x actually didn&#8217;t really have the fix you expected because change list 52304 did not make it into that week&#8217;s build. Needless to say that developers rather stayed longer with what they had. Longer than healthy: Integration problems eradicated all deadline fantasies out there.</p>
<p>Was that just lack of discipline? Not really&#8230; it was a mix of non-human-manageable complexity and the superhuman forensic instinct required to identify exactly that source code revision made your environment and whose fault it was (in a system of hundreds of components that were last updated at various points in time in various source code repositories with a deep dependency graph). I guess there is a way to set things up so that everything is easily trackable in such complex environments. I doubt that anybody has managed. Not over any significant time. Not with more than a handful of interdependent components that are developed at the same time.</p>
<p>Life was not good anymore.</p>
<p>One day I was working on a Web Service interop and performance test. One side implemented in an ABAP system, the other side implemented on Netweaver/Java.</p>
<p>Something was broken on the ABAP side. Couldn&#8217;t get it to work. Called a developer: „Hey, ABC is not working in BYX, any idea why?“, „Hmm.. let&#8217;s see&#8230; (click, click,&#8230;) ah yes, there is that bug XYZ. It&#8217;s a trivial fix. Ok. fixed. Can you try again?“. Wow&#8230; works!</p>
<p>Something was broken on the Java side. Couldn&#8217;t get it to work. Called a developer. „Hey, DEF is not working on my installation. Any idea why?“. „What version do you have?“. „Should be DWI CW34“, „Let&#8217;s see&#8230; (wait)&#8230; I think that bug TFB was fixed in CW42“. „Can you send me a patch?“. „Hmmm&#8230;(wait)&#8230; you should deploy the latest SDAs (deployables) from here,&#8230; but let&#8217;s see&#8230; they require this and that.. you could try?!“. Well&#8230; ok,.. maybe&#8230; maybe better not.</p>
<h2>That is what System Centric is all about:</h2>
<p>Know what is in the system. Be able to modify anything in the system down to the single line level. Allow system-local modification. Be self-contained: Always keep the overall consistency by definition and without dependency on external infrastructure.</p>
<p>In a system centric approach the difference between the source and configuration store vs. the executing runtime is the same as the difference between a blueprint of a house and an actual house. The runtime is nothing more than an actual instance of the system exactly as described and configured in the system&#8217;s repository. When looking at the repository you would say &#8220;this is the system&#8221;, just as when looking at the blueprint of a house you would say &#8220;this is the house&#8221;. We like to say <em>&#8220;<a href="http://www.z2-environment.eu/anatomy">The source is the system</a>&#8220;</em>.</p>
<p>Contrast that with a server that is build of a mix of binary components pulled from many different places cobbled together with a number of deployed applications from even more indefinite sources. Phew&#8230;</p>
<p>Want more? Go here: <a href="http://www.z2-environment.eu/v20doc">http://www.z2-environment.eu/v20doc</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2011/12/system-centric-development/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Set them free: Using Lombok in z2</title>
		<link>http://www.z2-environment.net/blog/2011/12/set-them-free-using-lombok-in-z2/</link>
		<comments>http://www.z2-environment.net/blog/2011/12/set-them-free-using-lombok-in-z2/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 06:39:56 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[z2]]></category>

		<guid isPermaLink="false">http://www.z2-environment.net/blog/?p=44</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
As you have undoubtedly learned by now, z2 compiles on its own, on-demand. It uses the Eclipse Compiler for Java (ECJ) for that. It used to use the build it Javac from the JDK more on that in some other &#8230; <a href="http://www.z2-environment.net/blog/2011/12/set-them-free-using-lombok-in-z2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>As you have undoubtedly learned by now, z2 compiles on its own, on-demand. It uses the Eclipse Compiler for Java (ECJ) for that. It used to use the build it Javac from the JDK more on that in some other post.</p>
<p><a href="http://projectlombok.org/">Lombok</a> is a rather cool (although maybe slightly disturbing) approach to add getters and setters and more to pretty plain Java objects w/o typing them. A minor feature in a way &#8211; and maybe not really important &#8211; but definitely a noise remover. And a cool example to show off how well z2 holds things together even when enhancing the compilation step.</p>
<p>Using Lombok, you can use POJOs w/o the need to declare setters and getters before you actually have a good reason to do so:</p>
<pre>package test;

import lombok.Getter;
import lombok.Setter;

public class MyBean {

    @Getter
    @Setter
    private String text;
}</pre>
<p>Lombok, under the hood makes sure that methods setText, getText are available.</p>
<p>Compiling Java source code to Java byte code is  just one of the things that need to be happening before code can be executed &#8211; in some cases. To give extensions a chance to be able to enhance what happens during compilation, z2 offers a compiler API.</p>
<p>Both use-cases apply:</p>
<p><strong>Modifying source code before compilation:</strong> In some cases it is most handy to prepare source code before compilation already &#8211; like a preprocessor. This is what we use for Lombok below. If you know Lombok, that may come as a surprise. Read on.</p>
<p><strong>Modifying byte code after compilation:</strong> Other tools understand byte code already and better than source code. So you can do that as well. This method was used in the z2@Spring distribution supporting weaving of the AspectJ aspect of the spring framework. No idea what that means? Read on here: <a href="http://www.z2-environment.eu/z2spring_spring_features">Spring features in Z2</a>, <a href="http://static.springsource.org/spring/docs/1.2.9/reference/aspectj.html">Spring AspectJ</a>.</p>
<p>But back to Lombok: Here is a short descriptions how it&#8217;s done. More links below.</p>
<p>The compiler API is very simple. There is only one interface: <a href="http://www.z2-environment.net/javadoc/com.zfabrik.core.api!2Fjava/api/com/zfabrik/components/java/build/ICompiler.html">ICompiler</a>, that has one method:</p>
<pre>boolean compile(String compName, File[] src, File dest, ClassLoader cl);</pre>
<p>Whenever called, the job of a compiler is to transform source files in the folders passed in src or compilation results of other compiler invocations in the folder passed as dest as desired.</p>
<p>The set of compilers to be used is a Java component specific configuration. I.e. on a Java component descriptor (the z.properties file) you specify the set of compilers to apply as well as their invocation order. E.g. like this:</p>
<pre>java.compile.order=lombok,java</pre>
<p>The default setting is &#8220;java.compile.order=java&#8221;.</p>
<p>Now to the construction of the actual extension:</p>
<p>A compiler extensions is declared as a z2 component (of course). In its component descriptor it declares its type, its unique id as a compiler, as well as its implementation class:</p>
<pre>com.zfabrik.component.type=com.zfabrik.compiler
compiler.id=lombok
component.className=com.zfabrik.impl.LombokCompiler</pre>
<p>The implementation class uses the <a href="http://projectlombok.org/features/delombok.html">Delombok</a> source converter tool as follows:</p>
<ol>
<li>Create a temp folder at &lt;component root&gt;/gen/lombok</li>
<li>Compute a class path based on the class path class loader (see above). Delombok requires a class path.</li>
<li>Process all source files in the src folders using Delombok</li>
<li>Copy the processed source files back to where they were found originally</li>
</ol>
<p>View the source code at: <a href="http://www.z2-environment.net/svn/z2_base/trunk/offline/lombok/lombok/java/src.impl/com/zfabrik/impl/LombokCompiler.java">LombokCompiler.java</a> (use z2_base/z2_base)</p>
<p>If you have a running z2 setup (see <a href="http://www.z2-environment.eu/check_it_out">Check it out</a>), you can play around with this by simply checking out the projects at</p>
<pre>http://www.z2-environment.net/svn/z2_base/trunk/offline/lombok</pre>
<p>(again: use z2_base/z2_base when asked)</p>
<p>into your eclipse workspace and sync&#8217;ing your runtime. The simple web app at /lombok demos a simple Lombok processed Bean in a JSP.</p>
<p>There is one pre-requisite however: You need to have the tools.jar from your JDK on your classpath. The simplest way to do so is to copy tools.jar from JAVA_HOME/lib to JAVA_HOME/jre/lib/ext.</p>
<p>Why is this cool?</p>
<ol>
<li>We reduced the application of lombok to your Java code to a mere one-liner</li>
<li>From the outside, e.g. when using the <a href="http://www.z2-environment.eu/develop_1">Eclipsoid</a> plugin to fullfill project dependencies, it&#8217;s as if the Java Beans were indeed normal Java Beans in the first Place.</li>
<li>On the downside you need a JDK rather just a JRE and need to provide the tools.jar (that contains the Javac that Delombok requires).</li>
</ol>
<p>Links:</p>
<ul>
<li><a href="http://projectlombok.org/">Lombok</a></li>
<li><a href="http://www.z2-environment.eu/check_it_out">Check out z2_base</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2011/12/set-them-free-using-lombok-in-z2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome</title>
		<link>http://www.z2-environment.net/blog/2011/12/welcome/</link>
		<comments>http://www.z2-environment.net/blog/2011/12/welcome/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 11:58:36 +0000</pubDate>
		<dc:creator>Henning</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/?p=8</guid>
		<description><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
My name is Henning Blohm. I am co-found and co-owner of a small software startup, ZFabrik Software, located near Heidelberg in Germany. Previously I spent a significant part of my life at SAP AG, mostly working on Java topics. SAP &#8230; <a href="http://www.z2-environment.net/blog/2011/12/welcome/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
#leftcontainerBox {
	float:left;
	position: fixed;
	top: 60%;
	left: 70px;
}
#leftcontainerBox .buttons {
	float:left;
	clear:both;
	margin:4px 4px 4px 4px;
	padding-bottom:2px;
}
#bottomcontainerBox {
	width: 50%;
	padding-top: 1px;
}
#bottomcontainerBox .buttons {
	float: left;
	margin: 4px 4px 4px 4px;
}
</style>
<p>My name is Henning Blohm. I am co-found and co-owner of a small software startup, ZFabrik Software, located near Heidelberg in Germany.</p>
<p>Previously I spent a significant part of my life at SAP AG, mostly working on Java topics. SAP does not do as much Java as some people may believe &#8211; I learned a lot by working in an environment where Java was more in a defending position rather than the champion. By far, most of the code SAP customers get to enjoy is written in ABAP, SAP&#8217;s proprietary programming language. Arguably an old-fashioned, hardly beautiful language. But don&#8217;t be fooled: It&#8217;s not about the language. It&#8217;s all about the software engineering approaches behind it.</p>
<p>A common tune of this blog will be just that: Things that suck in &#8220;Java-style&#8221; software engineering vs. other approaches.</p>
<p>One tangible result of my learnings at SAP is the <a title="z2-environment" href="http://www.z2-environment.eu/home" target="_blank">z2-Environment</a>: A &#8220;System Centric&#8221; approach to Java development (w/o breaking Java&#8217;s neck). I am sure that will play a big role in this blog.</p>
<p>Some other technologies that we use heavily in projects will certainly play a role. Most notably Hadoop/HBase and the Vaadin UI toolkit.</p>
<p>It was about time. Wanted to get started on this a long time back: A blog about all things &#8220;z&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.z2-environment.net/blog/2011/12/welcome/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

