<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6846321098245171072</id><updated>2025-02-07T13:56:24.694-05:00</updated><category term="programming"/><category term="software architecture"/><category term="tools"/><category term="java"/><category term="team"/><category term="business"/><category term="design patterns"/><category term="open source"/><category term="grid"/><category term="methodology"/><category term="standards"/><category term="osgi"/><category term="spring"/><category term="integration"/><category term="linux"/><category term="pop tech"/><category term="administration"/><category term="agile"/><category term="eclipse"/><category term="gridgain"/><category term="hadoop"/><category term="perl"/><category term="php"/><category term="rails"/><category term="ruby"/><title type='text'>Thoughts on Development</title><subtitle type='html'>Thoughts on software design, development, tools, and methods from a software architect.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default?start-index=26&amp;max-results=25'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-4397443094917678121</id><published>2009-12-23T19:17:00.004-05:00</published><updated>2009-12-23T19:33:56.853-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="hadoop"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="osgi"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><title type='text'>Upcoming Posts</title><content type='html'>&lt;p&gt;
It&#39;s been longer than I&#39;d have liked since I&#39;ve posted anything. I&#39;ve been involved in transitioning to a new position at a fantastic (secret) start up and immersing myself in learning new things. I want to take some time to put together some really interesting pieces that will be helpful not only in the academic &lt;q&gt;oh that&#39;s nice&lt;/q&gt; way, but also pragmatically.
&lt;/p&gt;
&lt;p&gt;
With the growing emphasis on distributed, highly concurrent applications in the development world, I&#39;d like to put out some analysis of best practices in these types of applications. Frameworks / projects like &lt;a href=&quot;http://www.springsource.org/about&quot;&gt;Spring&lt;/a&gt; and &lt;a href=&quot;http://hadoop.apache.org&quot;&gt;Hadoop&lt;/a&gt; give us the means to build huge applications that solve real problems, but still so many people struggle to put them into practice. We have excellent reference, but the narrative is filled with oversimplified how-tos that don&#39;t &lt;q&gt;show work,&lt;/q&gt; as my eighth grade math teacher would say.
&lt;/p&gt;
&lt;p&gt;
Of particular interest, and the focus of the next few posts, will be Spring (&lt;a href=&quot;http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/index.html&quot;&gt;3.0.0 release&lt;/a&gt;), &lt;a href=&quot;http://www.springsource.org/spring-integration&quot;&gt;Spring Integration&lt;/a&gt;, OSGi (yea, again), Hadoop, &lt;a href=&quot;http://hadoop.apache.org/hbase&quot;&gt;HBase&lt;/a&gt;, and EC2. Sure, plenty has been written about all of these, but hey, it&#39;s the internet and every crackpot gets their say.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/4397443094917678121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/4397443094917678121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/4397443094917678121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/4397443094917678121'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/12/upcoming-posts.html' title='Upcoming Posts'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-6745513999079287973</id><published>2009-09-09T00:25:00.011-04:00</published><updated>2009-09-09T01:34:04.972-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="grid"/><category scheme="http://www.blogger.com/atom/ns#" term="integration"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><title type='text'>Map / Reduce and Dependency Injection</title><content type='html'>&lt;p&gt;
I&#39;ve had a number of good discussions lately around &lt;a href=&quot;http://en.wikipedia.org/wiki/Map_reduce&quot;&gt;map / reduce&lt;/a&gt; frameworks like &lt;a href=&quot;http://hadoop.apache.org&quot;&gt;Hadoop&lt;/a&gt; and &lt;a href=&quot;http://gridgain.com/&quot;&gt;GridGain&lt;/a&gt; and (object and resource) dependency management. This is just a summarized rehash of those discussions, but hopefully in a slightly more organized format.
&lt;/p&gt;
&lt;p&gt;
So you need / want to write map / reduce code. It&#39;s a whole new world out there. It&#39;s the in thing to do and all your friends are cooler than you. I get it. You fire up Hadoop and realize after a few rounds of edit, deploy, test that this is less than fun. GridGain solves this with the &lt;q&gt;&lt;a href=&quot;http://www.gridgain.com/product_features.html#key7&quot;&gt;zero deployment&lt;/a&gt;&lt;/q&gt; model, serializing your map job and thawing it on the other side of the cluster, but you quickly run into fun with things that don&#39;t serialize cleanly. The question becomes how do I get what I need into my map (or reduce) implementation?
&lt;/p&gt;
&lt;p&gt;
Before we continue, it&#39;s worth noting that GridGain offers some support for (GridGain component and SPI) &lt;a href=&quot;http://www.gridgainsystems.com/wiki/display/GG15UG/Resources+Injection&quot;&gt;resource injection&lt;/a&gt; as well as some support for integrating with Spring. To be honest, I found it awkward, but I don&#39;t want to address that here. I&#39;d like to give you something that works on Hadoop as well. (That said, it&#39;s worth checking out the deeper levels of GridGain as it is a great project that I still use daily.)
&lt;/p&gt;
&lt;p&gt;
My preferred method of working on moderately complex code is to build business logic as pojos and test them directly from junit. I may or may not manually inject data sources or configuration data (via simple setter method calls). Once things work, I wire them together in Spring configs (although one could easily pick some other DI container) and test the aggregate with an integration oriented test suite. Having everything working together, I box the result up into whatever deployable unit is appropriate. For me, this is usually a standalone daemon or a web service, but it could be OSGi or whatever environment you prefer.
&lt;/p&gt;
&lt;p&gt;
In many cases, there&#39;s some integration code to deal with the environment. In the case of a web service, I use Spring MVC and have a Spring config devoted to the MVC specific bits and the obligatory web.xml (against my will, usually). If I luck out and we&#39;re talking about &lt;a href=&quot;http://www.springsource.org/dmserver&quot;&gt;Spring dm Server&lt;/a&gt;, that gets easier, but that&#39;s another post. You get the idea.
&lt;/p&gt;
&lt;p&gt;
When we talk about something like Hadoop, we seem to treat it as a wildly different execution environment and start trying to find crazy ways to make resources available to Mappers or Reducers. I&#39;ll make it simple - wire up your Spring beans into a top level component that acts as a controller, instantiate the ApplicationContext from within your Mapper, get over the ick of calling context.&lt;a href=&quot;http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/beans/factory/BeanFactory.html#getBean%28java.lang.String%29&quot;&gt;getBean(&amp;quot;myapp&amp;quot;)&lt;/a&gt;, and invoke the appropriate methods. Revolutionary? Not at all. That&#39;s the point. Simple, straight forward, but somehow not something people think of doing.
&lt;/p&gt;
&lt;p&gt;
My suggestions for reducing the chance of Hadoop types sneaking into the thick of your code is to use the Mapper to do what you would do with a servlet shell; confirm the environment is as you expect it, coerce the input into something your application code likes, and then pass as arguments to your application&#39;s pseudo-main() method a custom parameter object that encapsulates the Hadoop-iness of the input.
&lt;/p&gt;
&lt;p&gt;
Many map / reduce applications are different in the type of data they process and what I&#39;m talking about is not a drop in solution. You absolutely should write your application code in a way that is conducive to the environment. This, in the case of large scale data tasks, usually means being stream oriented rather than complete-collection (in memory) based. Don&#39;t try and shoehorn some web controller into a Mapper and send me hate mail. I&#39;ll only pass it around as a cautionary tale of following overly general advice from know-it-all Internet nobodies that will scare the less jaded of our ilk. Of course, this does not necessitate abandoning things like encapsulation, layering, testability, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Open_Closed_Principle&quot;&gt;open / closed principle&lt;/a&gt;, and sometimes even good judgement.
&lt;/p&gt;
&lt;p&gt;
In my opinion, this leaves you with a system that shields the majority of your code from being glued to the outer infrastructure. There is always a risk of going overboard and you shouldn&#39;t sacrifice performance so much for obtuse abstraction. Use your brain. You know your tasks better than anyone. This structure should allow you to easily continue your normal development and testing outside of the M/R framework until you need to actually get to the integration testing. Even then, you have some additional flexibility with varying your application components without needing to worry about completely breaking your M/R glue layer. This reduces test time and (hopefully) lets you get back to what you were supposed to be doing... whatever that might have been.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/6745513999079287973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/6745513999079287973' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6745513999079287973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6745513999079287973'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/09/map-reduce-and-dependency-injection.html' title='Map / Reduce and Dependency Injection'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-7886267061788638175</id><published>2009-06-12T00:20:00.003-04:00</published><updated>2009-06-12T01:35:09.161-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="grid"/><category scheme="http://www.blogger.com/atom/ns#" term="gridgain"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="osgi"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><title type='text'>Why OSGi needs to come of age</title><content type='html'>&lt;p&gt;
The team I&#39;m lucky enough to be part of is currently working on a project with &lt;a href=&quot;http://www.gridgain.com&quot;&gt;GridGain&lt;/a&gt;, which I&#39;ve &lt;a href=&quot;http://esammer.blogspot.com/2009/01/another-night-with-gridgain.html&quot;&gt;mentioned before&lt;/a&gt;, once or twice. In our case, we are invoking map / reduce jobs via RESTful web services. It works well. The problems start cropping up with the way classes are loaded (or not) inside &lt;a href=&quot;http://tomcat.apache.org&quot;&gt;Tomcat&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
GridGain is (in our case), effectively, deployed in a war file. This is because we want to communicate with a layer around GridGain via HTTP (and Spring MVC, specifically). In the interest of time and simplicity, we chose to start up the grid from within Tomcat, although, a cleaner design would be to queue tasks from within Tomcat, run our GridGain app as a daemon, and dequeue tasks to be executed there (maybe using JMS or something similar). It&#39;s a lot of jumping through hoops, really, because at that point, you may as well speak JMS directly to the GridGain-enabled daemon. Too much bloat.
&lt;/p&gt;
&lt;p&gt;
Most of the complexity is really introduced simply because of the environment required to receive HTTP requests. Really, when you think about it, we&#39;ve had to - simply to support HTTP invocation - change how we build, package, deploy, start and stop services, and deal with 3rd party dependencies. Worst of all, Tomcat has to deal with the servlet specification and how class loading works, therein. As it turns out, GridGain plus Tomcat equals yuck.
&lt;/p&gt;
&lt;p&gt;
Now, I won&#39;t really go into specifics (in this post) about my thoughts on class loading in Java, peer class loading with GridGain, and the myriad of issues we&#39;ve seen and run into. What I do want to touch on is the more general theme that, even after all of this time, this stuff (i.e. static and dynamic class loading in containers) is still way too thick, intrusive, delicate, under-documented, and buggy. We need evolution, if not revolution.
&lt;/p&gt;
&lt;p&gt;
I dropped a war file containing our code, and approximately 100+ jars worth of dependencies to make Spring, Hibernate, AspectJ, and GridGain happy. One hundred, plus. Smells like disaster already. GridGain starts up, Spring MVC does its thing, life looks good. I make a request to a controller that invokes a task via GridGain and things get interesting.
&lt;/p&gt;
&lt;p&gt;
The task we want to start is looked up in a Spring config, and instantiated using reflection. It makes it easy to add new types of tasks without mucking around with the core grid assembly and packaging, but it creates an interesting case. The jar(s) containing the grid tasks need to now live in the war file. The alternative seemed to be storing them in a directory accessible to the Tomcat shared class loader, but during testing, we found that Tomcat couldn&#39;t handle this (for some reason that is still admittedly a little unclear to me). The class simply wasn&#39;t found. The class loader hierarchy is modified in Tomcat due to the servlet spec so the order should be bootstrap, system (JDK), the war classes and internal libs, &lt;span style=&quot;font-style:italic;&quot;&gt;then&lt;/span&gt; the common and shared class loaders (if I remember correctly). This means that when we move our grid tasks to the shared class loader, they would come after the web app class loader. Normally this shouldn&#39;t be a problem, but I &lt;span style=&quot;font-style:italic;&quot;&gt;think&lt;/span&gt; the issue we ran into was related to the fact that the grid task extended a class that was present in the war&#39;s class loader, not in the shared class loader. When we move the grid task jar into WEB-INF/lib, it magically starts working. Sigh.
&lt;/p&gt;
&lt;p&gt;
I&#39;m a fan of OSGi. It (mostly) makes sense to me. It&#39;s explicit (painfully so, in many cases) and direct. My feeling is that, in a case like we have here, at least it would be obvious that class loaders needed to be wired together to make this work. The main grid application could have fragments containing the grid tasks, for instance, to push additional &lt;q&gt;task plugins&lt;/q&gt; into the core application, making the classes available. Alternatively, a more direct way would be to simply list the packages as dependencies in the manifest of the core application. This would obviously couple the core app to the tasks, which isn&#39;t very nice.
&lt;/p&gt;
&lt;p&gt;
The GridGain team, unfortunately, hasn&#39;t embraced OSGi. In fact, Ivanov seems to summarily disregard it in the comments of &lt;a href=&quot;http://www.jroller.com/nivanov/entry/class_loading_in_distributed_systems&quot;&gt;this post&lt;/a&gt;. I was a bit let down to see this kind of hard-line stance on a subject that more and more people seem to be interested in, especially with the SpringSource folks driving at it. While Nikita makes an excellent point about distributed class loading and OSGi being a less than nice match, I do think there&#39;s room for GridGain with peer class loading disabled in an OSGi container. For some of us who don&#39;t care about the hassle of deploying grid tasks (and &lt;a href=&quot;http://www.gridgain.com/javadoc/org/gridgain/grid/GridJob.html&quot;&gt;GridJob&lt;/a&gt; implementations, specifically) on all nodes, at least having the option of GridGain in an OSGi container like Spring dm would be nice. It&#39;s possible that this can be done, but when I tried, things didn&#39;t go well. There&#39;s no doubt that Ivanov and the GridGain team have far more experience with the class loading details than I do, but the stance taken does still let me down, at least not without a better explanation and documentation.
&lt;/p&gt;
&lt;p&gt;
OSGi isn&#39;t perfect. It&#39;s far from it, obviously. What it does begin to chip away at, though, is the big fat &lt;q&gt;bundle-it-all-in-one-giant-file&lt;/q&gt; issue that plagues Java-land. Honestly, Java is &lt;span style=&quot;font-style:italic;&quot;&gt;thick&lt;/span&gt; and we have to change that. OSGi is one way to cut it down to a reasonable footprint while still allowing for decoupling and service-like component design. Sure, permgen errors are a dirty word and the class loading mechanics may be &lt;q&gt;too simplistic&lt;/q&gt; but it scares me to think we&#39;d be stuck in war-land for the rest of the foreseeable future.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/7886267061788638175/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/7886267061788638175' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/7886267061788638175'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/7886267061788638175'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/06/why-osgi-needs-to-come-of-age.html' title='Why OSGi needs to come of age'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-867280075560916861</id><published>2009-04-27T22:51:00.016-04:00</published><updated>2009-04-28T00:27:20.832-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="business"/><category scheme="http://www.blogger.com/atom/ns#" term="design patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="grid"/><category scheme="http://www.blogger.com/atom/ns#" term="pop tech"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><title type='text'>The Cloud - Not a Panacea</title><content type='html'>&lt;p&gt;
Everyone loves &lt;q&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing&quot;&gt;Cloud&lt;/a&gt;.&lt;/q&gt; I mean, &lt;a href=&quot;http://gigaom.com/2008/07/01/10-reasons-enterprises-arent-ready-to-trust-the-cloud/&quot;&gt;why not&lt;/a&gt;? There&#39;s no hardware to own, no storage systems to maintain, no networking hardware to deal with, it&#39;s infinitely scalable to the billionth degree; it&#39;s perfect!
&lt;/p&gt;
&lt;p&gt;
Ok, so no one gushes about it &lt;span style=&quot;font-style:italic;&quot;&gt;that&lt;/span&gt; much (do they?). It has its notable benefits, but they aren&#39;t quite as obvious or simple as people sometimes make them out to be.
&lt;/p&gt;
&lt;p&gt;
The crux of the issue is simple; simply moving traditional services, applications, or systems to a cloud-like environment yields little. Traditional systems with no knowledge of a cloud (or grid, or virtualized infrastructure, or...) environment can&#39;t take advantage of the dynamicity that it offers. Many systems (and arguably, people) don&#39;t understand what the true benefits of the cloud are.
&lt;/p&gt;
&lt;h2&gt;A Common Cloud Case&lt;/h2&gt;
&lt;p&gt;
Let&#39;s take a concrete - and common - example: an RDBMS on the cloud. I&#39;ll talk specifically about &lt;a href=&quot;http://www.mysql.com&quot;&gt;MySQL&lt;/a&gt; because it&#39;s on the tip of my tongue, but it will apply to many similar systems.
&lt;/p&gt;
&lt;p&gt;
So there you are, running MySQL on &lt;a href=&quot;http://aws.amazon.com/ec2&quot;&gt;Amazon EC2&lt;/a&gt; on your Linux distro of choice. That was easy enough. You cron a nightly export to &lt;a href=&quot;http://aws.amazon.com/s3&quot;&gt;S3&lt;/a&gt;. You&#39;ve taken advantage of some of the shared resources and that is good, to be sure. You can use EBS for large volumes. You lose some performance, but you can afford to get a larger instance so maybe you can increase some of the buffers and keep more in memory. Depending on your situation, it may all work out in the end. We won&#39;t get into the nuances of exactly what computational resources you get because it&#39;s damn near impossible to measure accurately and consistently. Let&#39;s call it a wash.
&lt;/p&gt;
Perhaps the most important part of this is that you can easily set up one or more replicas. That&#39;s pretty damn nice.
&lt;/p&gt;
&lt;p&gt;
That&#39;s a lot. The problem is that there isn&#39;t much one couldn&#39;t do in a traditional data center. Sure, something like EC2 can help jumpstart a start up - which is great - but for medium sized and larger companies, this isn&#39;t a concern. The question is what does the cloud do that the traditional data center (and approach) does not? The cloud is dynamic and on demand for a reason and this isn&#39;t it.
&lt;/p&gt;
&lt;h2&gt;What the Cloud Does Well&lt;/h2&gt;
&lt;p&gt;
Applications that natively and intrinsically know about the cloud and its properties &lt;span style=&quot;font-weight:bold;&quot;&gt;and&lt;/span&gt; can actually react to changing conditions are the true candidates for cloud computing. For instance, stateless web serving is something that can take advantage of this kind of environment (with some additional functionality). The reasoning here is simple: with some simple measuring of load and knowledge of capacity, additional web server instances can be forked off and run, independently. These additional web servers (or their IPs) could be added to an external load balancing system to make them available to the public. There&#39;s no significant dependency here. Content to be served by the additional web servers can be made available with little fanfare and, provided you have enough resources, additional connections can be made to resources such as relational databases, caching servers like &lt;a href=&quot;http://www.danga.com/memcached/&quot;&gt;memcached&lt;/a&gt;, and so forth.
&lt;/p&gt;
&lt;p&gt;
That&#39;s, of course, not the native case I mentioned. That&#39;s an adaption of a traditional service to the cloud using an orchestration process or resource manager, of sorts. The &lt;q&gt;best case&lt;/q&gt; for the cloud are applications where change of the infrastructure is built in. People tend to easily go to places like map / reduce frameworks where jobs are self contained or transport state with them. Not to trivialize that case, but it&#39;s not everyday you find the perfect fit for such a model. Many times, you find hybrids where map / reduce jobs (a computation layer) requires access to a data grid (the storage layer) which limits your flexibility and ability to deal with changing conditions. In that case, it&#39;s usually not desirable to repartition or shift your data storage based on load (although you can repopulate caches based on load and network expansion). Maybe you don&#39;t care about data affinity because the footprint is small or access is infrequent, but with massive data stores or logically partitioned data, this is prohibitively expensive.
&lt;/p&gt;
&lt;p&gt;
I&#39;m not sure I have a good conclusion to this. What I&#39;m driving at is that, while the cloud and dynamic infrastructure is a blessing, don&#39;t think of it as a panacea. Do the cost breakdown and consider what portions of your systems make sense in such an environment. Many times, running a traditional system where dynamic setup / teardown of nodes isn&#39;t feasible, on a platform like EC2, will wind up being more expensive after a year or so given even light usage. It&#39;s a buzzy topic and everyone wants to be &lt;q&gt;on the cloud.&lt;/q&gt; Remember that the fastest way to kill something in the eyes of business is to push it for the wrong reasons or in the wrong situations.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/867280075560916861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/867280075560916861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/867280075560916861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/867280075560916861'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/04/cloud-not-panacea.html' title='The Cloud - Not a Panacea'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-8583252894896478909</id><published>2009-04-17T00:03:00.003-04:00</published><updated>2009-04-17T00:36:16.188-04:00</updated><title type='text'>We&#39;re Hiring!</title><content type='html'>&lt;p&gt;
We at &lt;a href=&quot;http://www.conductor.com&quot;&gt;Conductor&lt;/a&gt; are looking for Java developers to join our engineering team here in New York City, NY, US. Please take a look at the &lt;a href=&quot;http://www.conductor.com/about/careers/java-engineer&quot;&gt;position details&lt;/a&gt; and submit your resume if you fit the bill. Make sure you indicate where you heard about the position (no, I don&#39;t get a referral bonus if people come from my blog. Unless someone from our HR department is reading this - then I want my bonus).
&lt;/p&gt;
&lt;p&gt;
We&#39;re very interested in people who have real world experience building large scale, highly available, distributed, performant, applications in Java with Spring. Love of open source and / or technology in general is a huge plus. Knowledge of a language like Python, Ruby, Groovy, or Javascript is also good. Experience building data mining or analysis applications is good for bonus points. Come work with us. Trust me, it&#39;s a good place to be!
&lt;/p&gt;
&lt;p&gt;
A reminder: None of this is sponsored, reviewed, or endorsed by my employer. Please see the &lt;a href=&quot;http://www.conductor.com/about/careers&quot;&gt;Careers&lt;/a&gt; section of the &lt;a href=&quot;http://www.conductor.com&quot;&gt;Conductor&lt;/a&gt; corporate website for details.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/8583252894896478909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/8583252894896478909' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/8583252894896478909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/8583252894896478909'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/04/were-hiring.html' title='We&#39;re Hiring!'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-3441649380883776362</id><published>2009-03-12T00:00:00.019-04:00</published><updated>2009-03-12T01:10:44.567-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="methodology"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="team"/><title type='text'>Principles of Architecture - Anticipate Reality</title><content type='html'>&lt;p&gt;
My title at work is System Architect. Actually, it&#39;s something like System Architect / Engineering Lead, but I have my suspicions that it was suggested by our business card printing company who may, or may not, get paid by the letter. That&#39;s a story for another time.
&lt;/p&gt;
&lt;p&gt;
What I&#39;m driving at is that many times, architects are thought of as different from developers. It&#39;s true that the path to software architecture is either rooted in, or tightly entwined with, software development, but it tends to be some kind of a specialization. The reason I bring this up is because, as architects, we run the risk of separation from actual, real world, implementation concerns. By removing ourselves from the nitty gritty &lt;q&gt;implementation details&lt;/q&gt; (a phrase I&#39;ve been lazy enough to toss around in certain circumstances, admittedly) we have the potential to forget or otherwise disregard the venerable minefield that is the production environment and even the real world.
&lt;/p&gt;
&lt;p&gt;
Using tools like diagrams, white boards with the nice non-smelly dry erase markers, pens and paper, and even more direct methods such as defining interfaces, we&#39;re still far removed from the underbelly. We&#39;re removed from reality both conceptually and (almost) physically; the implementation - the realization of a given architecture, big or small - is not our own. In other words, we&#39;re not subject to our own dog food. And, if you&#39;re not careful, you might end up designing for the utopian world of your favorite modeling tools. The professional term for that is &lt;q&gt;screwed.&lt;/q&gt;
&lt;/p&gt;
&lt;p&gt;
By not pushing yourself back into the role of implementor either by contributing to code directly or working closely with those dealing with your precious architecture, you are robbing yourself as well as sabotaging the rest of the team, not to mention the project. If you work in an organization where this isn&#39;t feasible you can still place yourself in the shoes of the developer, the testers, tech writers, product managers, all the way up to the end users. The impact of your design decisions are greater than just the common set of technical concerns. You are bound by the goals of the project. Your design must not only be simple, elegant, and technically correct, but it must deal with the idiosyncracies of the business, production woes, maintenance and operation teams, and so on. In fact, I&#39;m a little sad I even used the word elegant.
&lt;/p&gt;
&lt;p&gt;
I spend quite a bit of time writing code at work. I do this for a few reasons. For starters, we&#39;re just in need of extra hands; we&#39;re working on some very cool projects on tight time lines and I&#39;m always a developer regardless of title. Possibly even more important than simply generating code, though, is the need to get things right, in terms of design. By working with the rest of the team, dealing with implementation questions and concerns, all day, every day, I&#39;m forced to constantly reconsider what is working and what isn&#39;t. Developers are the first to trip over corner cases in the design or find awkward situations that are difficult to detect in a pure design phase. In an agile environment, the constant attention to high quality and &lt;q&gt;correctness&lt;/q&gt; means - in terms of design - following a design through to the end, through all its transformations and anticipating real world situations.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/3441649380883776362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/3441649380883776362' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3441649380883776362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3441649380883776362'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/03/principles-of-architecture-anticipate.html' title='Principles of Architecture - Anticipate Reality'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-7461279692871227692</id><published>2009-03-04T23:53:00.006-05:00</published><updated>2009-03-05T00:13:42.452-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Declarative Concurrency In Java - A follow up</title><content type='html'>&lt;p&gt;
It&#39;s put up or shut up, right? I don&#39;t know if this is something I can do by myself, but I&#39;m happy to try and get the ball rolling.
&lt;/p&gt;

&lt;p&gt;
Some time ago, I wrote about &lt;a href=&quot;http://esammer.blogspot.com/2009/01/declarative-concurrency-in-java.html&quot;&gt;declarative concurrency in Java&lt;/a&gt;. It seemed to get a good reaction from many people from different sections of the community. I wound up receiving a lot of email about how people were interested and how the idea of being able to define concurrency semantics in such a manner was appealing for a number of reasons. Well, I went ahead and stubbed out a project which I&#39;ve pushed to github[1] for the world to pick at! It&#39;s minimal and there&#39;s very little there right now, but I wanted to solidify my intent to actually produce a prototype by physically creating the project and pushing it out there.
&lt;/p&gt;

&lt;p&gt;
Everyone is welcome and encouraged to participate. The goal of the project will be to create a simple, open source, library in Java that will do the following.
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Allow developers to annotate methods, indicating that they may be executed in parallel.&lt;/li&gt;
&lt;li&gt;Provide a simple library that will, based on configuration and hints from the annotations, intercept invocations of the annotated methods and execute them concurrently.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
I hope to get additional feedback on the concepts as well as the implementation as it evolves over time. Thanks to all who have provided feedback and encouragement thus far!
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;&lt;a href=&quot;http://wiki.github.com/esammer/decothread&quot;&gt;http://wiki.github.com/esammer/decothread&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
[1] - &lt;a href=&quot;http://github.com&quot;&gt;github.com&lt;/a&gt; - &lt;a href=&quot;http://wiki.github.com/esammer/decothread&quot;&gt;decothread project @ github&lt;/a&gt;
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/7461279692871227692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/7461279692871227692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/7461279692871227692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/7461279692871227692'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/03/declarative-concurrency-in-java-follow.html' title='Declarative Concurrency In Java - A follow up'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-6678721516573206907</id><published>2009-02-24T23:17:00.021-05:00</published><updated>2009-02-26T20:32:03.354-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="methodology"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="team"/><title type='text'>Principles of Architecture - Reduce and Simplify</title><content type='html'>&lt;p&gt;
Just a few days ago, I had a weekly one on one meeting with my boss. It&#39;s times like that where work becomes kind of like a game of &lt;q&gt;Can I go a full hour without putting my foot in my mouth?&lt;/q&gt; Turns out, I came out unscathed this time.
&lt;/p&gt;
&lt;p&gt;
Recently, around the office, we&#39;ve been talking a lot about the principles behind the agile manifesto. Pav (aka John Pavley, CTO) mentioned that I probably had a similar list of principles of software architecture I operate by. He pointed out that I hadn&#39;t really vocalized what those are in any obvious way and that doing so would probably be beneficial or at least interesting. Thinking about what those principles are and needing to actually enumerate them also helps me think about what&#39;s really important and why.
&lt;/p&gt;
&lt;p&gt;
Before we get into the first principle I want to discuss, I want to clarify why I&#39;m using the term principle rather than, well, anything else. During our discussions of the principles of the agile manifesto, we used this word because, like what I hope to describe in software architecture, those items are considered intrinsic properties of software development. As Pav would say, &lt;q&gt;they&#39;re discovered, not invented.&lt;/q&gt; I tend to think he&#39;s right and that the choice of the word &lt;q&gt;principle&lt;/q&gt; is deliberate and intentional. This is also my intention here.
&lt;/p&gt;
&lt;p&gt;
One of the first two principles that came to mind was the idea of reduction and simplicity. When designing software, we strive to reduce or eliminate complexity wherever possible. There are times where a task is inherently complicated, but the design of the system need not necessarily be complicated. If that sounds counter-intuitive, consider the separation between designing the system&#39;s architecture - the way it behaves, the layering, the major objects in play, the way it interacts with constituent systems or resources, its fault semantics, and so on - from its implementation. In many cases, what you&#39;ll find is that the implementation may have some inherent level of complexity to meet the business requirements, but that a well designed system is almost obvious and easily fits in your brain without confusing you. Let&#39;s consider something concrete.
&lt;/p&gt;
&lt;p&gt;
If you were to design an SQL query execution engine... I don&#39;t even need to finish that sentence for it to sound scary. Take a few minutes to think about how you might &lt;span style=&quot;font-style:italic;&quot;&gt;design&lt;/span&gt; a query execution engine. In five or ten minutes you might actually be able to work out a simple model that makes sense (within reason). The details of how to implement that design is where one gets into the shady details of how to make the magic happen. Even the design of a compiler is simple enough, in most cases, where as the implementation is where the complexity lies. A compiler will have a grammar, a lexer, a parser, probably an AST, a chain of optimization strategies, maybe a number of output generation strategies. Within each of those major components, you could break things down further and come up with an easily understood design for a modular compiler. I&#39;m not trying to trivialize building a compiler (try implementing a C++ compiler some day) but I do think that with some thought, the design process would effect a reasonable, intuitive result.
&lt;/p&gt;
&lt;p&gt;
The point I&#39;m trying to make is that a well designed system should be intuitive to the person or team implementing the system as well as the architect. If you find it difficult to communicate a design, there&#39;s a high chance that the implementation of that design will not make things any simpler. In fact, it&#39;s probably impossible. To be clear, some things have an inherent degree of complexity, but we should always &lt;span style=&quot;font-style:italic;&quot;&gt;strive&lt;/span&gt; for the simplest, but still most complete, design possible.
&lt;/p&gt;
&lt;p&gt;
These are all relative terms; simple, complex, intuitive, complete. You&#39;ll always have to rely on your judgement, experience, and best practices of the trade. By properly deconstructing an application, its components, their components, and so on, even the most complex system can be easily understood and digested.
&lt;/p&gt;
&lt;p&gt;
Some techniques I find useful for making this happen are:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Apply &lt;q&gt;Divide and Conquer.&lt;/q&gt; Break down components recursively until you get to easy to understand units of functionality.&lt;/li&gt;
&lt;li&gt;Never work alone. Statistically, you&#39;re more than likely to be surrounded by people who can contribute experiences and ideas during the design process that will yield a better result. The added benefit here is that you&#39;re constantly having to explain your thought process and ideas to other humans; the degree of complexity is probably proportional to the number of times a junior developer says &lt;q&gt;Huh?&lt;/q&gt;&lt;/li&gt;
&lt;li&gt;Follow patterns and best practices. Silly questions like &lt;q&gt;Does your class do one thing and do it well?&lt;/q&gt; have saved me from my own &lt;q&gt;cleverness&lt;/q&gt; more than once (but admittedly not always).&lt;/li&gt;
&lt;li&gt;Trust your gut. If it sounds too complicated, it probably is. Take a break, look at similar problems, ask around, and try a different approach.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
There&#39;s no complexity blasting ray gun of designly awesomeness. There&#39;s no third party library that you can &lt;q&gt;just drop in&lt;/q&gt; to &lt;q&gt;make it simple.&lt;/q&gt; Sometimes, the business requirements are as tough as they sound. Most of the time though, you can reduce and simplify.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/6678721516573206907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/6678721516573206907' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6678721516573206907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6678721516573206907'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/02/principles-of-architecture-reduce-and.html' title='Principles of Architecture - Reduce and Simplify'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-1731981219523638718</id><published>2009-02-10T22:44:00.026-05:00</published><updated>2009-02-11T01:01:14.580-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="standards"/><title type='text'>Class Categories in Java</title><content type='html'>&lt;p&gt;
Class categories have existed in a few incarnations over the years. My personal knowledge of comp sci history is thin, at best, but my small amount of research into the material is that it came from Smalltalk-80. Certainly, my first exposure to class categories came from working with &lt;a href=&quot;http://en.wikipedia.org/wiki/Objective-C&quot;&gt;Objective-C&lt;/a&gt; on NeXTSTEP and later Mac OS X.
&lt;/p&gt;
&lt;p&gt;
What a category does is relatively simple to understand. Basically, the idea is that a developer may take an existing class and, effectively, append methods to it without having access to the source code or subclassing it. This is best illustrated in code.
&lt;/p&gt;
&lt;pre&gt;
// A normal, and terribly boring class.
public class Foo {

  public void displayMessage(String message) {
    System.out.println(&quot;A useless message:&quot; + message);
  }

}

// Extending the class by creating a category on it.
public class Foo (MyExtensions) {

  public String getDefaultMessage() {
    return &quot;Hello world.&quot;;
  }

}

// ...and finally, what one would expect.
Foo f = new Foo();

f.displayMessage(f.getDefaultMessage());
&lt;/pre&gt;
&lt;p&gt;
Normally, when I explain class categories to Java developers, I barely get the words out before I&#39;m hit with what you might expect. People question whether this is breaking encapsulation, if this bloats code, if it creates tight coupling, if it breaks access rules, and so on. Some of the more dynamic languages like Ruby and Perl will happily let you do things like this (albeit, sometimes safer than others), but that happens at runtime.
&lt;/p&gt;
&lt;p&gt;
I&#39;m proposing we bring categories to Java. Yep. I said it. I&#39;m going to focus more on how this might work rather than why I think it&#39;s a good idea, although I&#39;ll try and briefly address that too. Here&#39;s how I think it could work and why.
&lt;/p&gt;
&lt;h2&gt;The Basics&lt;/h2&gt;
&lt;p&gt;
The syntax would work like Objective-C&#39;s syntax. Creating a category would be done by specifying the same package and class definition, in the interest of simplicity, with the addition of a category name enclosed in parenthesis (see the above example). It would not be legal to specify inheritance when creating a category; inheritance would always be defined by the &lt;q&gt;original&lt;/q&gt; definition (i.e. the uncategorized class declaration), although there&#39;s no reason to prohibit the implementation of additional interfaces in a category. This would allow those creating categories on a class to extend an existing class to implement a new interface without modifying source code.
&lt;/p&gt;
&lt;h2&gt;Access, Security, and Visibility&lt;/h2&gt;
&lt;p&gt;
In many ways, the access and visibility rules of subclassing applies to categories as the result is very similar from the perspective of the original class; the new functionality is unknown and untrusted.
&lt;/p&gt;
&lt;p&gt;
It would only be legal to access public or protected members of a class when creating a category. This would respect access and visibility restrictions on code developed prior to the existence of categories. Overriding a method in a category would not be permitted, although method overloading is fine. Private members within a category would not be visible outside of the category.
&lt;/p&gt;
&lt;h2&gt;Category Availability&lt;/h2&gt;
&lt;p&gt;
The biggest differentiation between categories in Java and class reopening in Ruby, for instance, is that the contributions made to a class via a category would be known and could be checked for at compile time. This would allow developers to see and avoid cases of competing categories or member addition during development, which is usually not possible with languages that allow for this kind of functionality.
&lt;/p&gt;
&lt;p&gt;
It would not be legal to create a category on a class declared as final. This extends the meaning of declaring a class to be final, but only slightly as creating a category is similar in intention to subclassing (in theory). This rightly implies that there is no way to prevent the creation of categories, but allow subclassing as there&#39;s no obvious reason to draw a distinction as categories can only access public and protected members of an existing class, just as a subclass would.
&lt;/p&gt;
&lt;p&gt;
External classes including unrelated as well as subclasses of a class with categories would see all members including those defined in categories as usual. The category information of a member should be made available via the standard reflection classes and methods. Given the above example Foo class, the following would work as expected.
&lt;/p&gt;
&lt;pre&gt;
/* Includes both methods from the original class declaration
 * as well as methods from categories.
 */

Methods[] methods = Foo.class.getMethods();

/* Additionally, category information should be made available
 * via reflection.
 */

Category[] categories = Foo.class.getCategories();

for (Category category : categories) {
  System.out.println(&quot;Methods in category:&quot; + category.getName());

  for (Method method : category.getMethods()) {
    System.out.println(&quot;method name:&quot; + method.getName());
  }
}
&lt;/pre&gt;
&lt;h2&gt;Some Quick Reasons Why&lt;/h2&gt;
&lt;p&gt;
There are a few nice advantages to having categories available in a language, especially at compile time. There are the obvious advantages such as simple code organization. What I tend to think is more interesting, though, is creating categories to apply specialized functionality to core classes. For instance, one may want to add methods to collections to glue validation logic to core components. In cases where Spring is used, it&#39;s not uncommon to see many &lt;q&gt;adapter&lt;/q&gt; type objects that simply exist to make an object more amenable to participate in DI. I believe that a lot of code and class structures could be greatly simplified by being able to make minor alterations to existing classes rather than resorting to multiple objects to mediate or adapt existing code to new systems and frameworks.
&lt;/p&gt;
&lt;p&gt;
Like anything else, there is the obvious ability to abuse something like categories. I think there are times when more traditional approaches are the best option, and there&#39;s no replacement for good design and education, but to remove a valuable tool because some subset of the population may misuse it only serves to hurt those that could make proper use.
&lt;/p&gt;
&lt;p&gt;
My plan is to attempt to draft this as a JSR and submit it for review. I don&#39;t know if I have the ability to chew through the politics (I&#39;m assuming are) attached to that, but it might be fun to try. Clearly there&#39;s more to work out (I haven&#39;t looked deeply into what this does to the compiler and runtime at a low level, for instance), but I&#39;m interested in what people think about categories in Java.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/1731981219523638718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/1731981219523638718' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/1731981219523638718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/1731981219523638718'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/02/class-categories-in-java.html' title='Class Categories in Java'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-3246628856072064746</id><published>2009-01-21T23:33:00.006-05:00</published><updated>2009-01-22T23:41:38.362-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="grid"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Another Night with GridGain</title><content type='html'>&lt;p&gt;
Earlier this evening, I had a chance to attend a presentation on &lt;a href=&quot;http://www.gridgain.com&quot;&gt;GridGain&lt;/a&gt; at this month&#39;s NYC &lt;a href=&quot;http://www.nyjavasig.com&quot;&gt;JavaSIG&lt;/a&gt; at the Google Engineering building here in New York City, NY, US. I&#39;ve written about GridGain before, but if you haven&#39;t read &lt;a href=&quot;http://esammer.blogspot.com/2008/09/gridgain-simple-effective-and-made-of.html&quot;&gt;my thoughts on it&lt;/a&gt;, I&#39;ll sum it up; I&#39;m a fan.
&lt;/p&gt;
&lt;p&gt;
I got a chance to talk to &lt;a href=&quot;http://www.jroller.com/nivanov/&quot;&gt;Nikita Ivanov&lt;/a&gt;, if only briefly. Nice enough guy. What I like about his presentation most is the lack of - and there&#39;s probably no other way to really say it - bullshit. Sure, he uses words like &lt;q&gt;grid&lt;/q&gt; and &lt;q&gt;cloud&lt;/q&gt; which is always suspect, but in this case, he provides an actual, single slide, definition of what it means to him and GridGain.
&lt;/p&gt;
&lt;blockquote&gt;
Grid Computing = Compute Grid + Data Grid
&lt;/blockquote&gt;
&lt;p&gt;
Makes sense if the terms &lt;q&gt;compute grid&lt;/q&gt; and &lt;q&gt;data grid&lt;/q&gt; mean something to you. Nikita seems to stick to (what I think is) the standard definition of a data grid - a network of data storage machines containing partitioned or distributed storage. I&#39;m paraphrasing a bit here, but mostly because I don&#39;t recall his exact wording. The compute grid portion of that should be obvious. I&#39;m not providing any hints on that one.
&lt;/p&gt;
&lt;p&gt;
Cloud computing is defined by Ivanov as follows.
&lt;/p&gt;
&lt;blockquote&gt;
Cloud Computing = Grid Computing + Data Center Automation
&lt;/blockquote&gt;
&lt;p&gt;
This is also simple and concise. So we get &lt;q&gt;grid computing;&lt;/q&gt; at least in the context of GridGain. Data center automation, in this case (and Ivanov&#39;s opinion) covers not just the normal stuff, but specifically the creation and shutdown of instances of machines. This is generally stuck behind an API such as Amazon&#39;s EC2 and related services with the goal that one can have a greater degree of flexibility. While I&#39;m not really in love with EC2 as some others may be (not referring to Ivanov, specifically, just the sometimes expressed idea that EC2 is solution to all woes) it is a readily available cloud environment that one can play with. I&#39;m glad it exists.
&lt;/p&gt;
&lt;p&gt;
A panacea? Of course not. Honestly, what could be, short of a super code-monkey falling from the sky to do your evil bidding? Ok, maybe an intern.
&lt;/p&gt;
&lt;p&gt;
The point, I think, is that this kind of functionality - the ability to perform massive, distributed, parallelized computing without six-plus figures worth of hardware and software - is both simple and significant.
&lt;/p&gt;
&lt;p&gt;
As usual, no grand epiphany here on my part... just some commentary on one of the areas where we can push performance in real world applications. That, of course, being something we should always be looking to do. Thanks to GridGain, Ivanov, NY JavaSIG, Google, the JavaSIG sponsors, and my employers for not getting annoyed that I suckered my team into cutting out early to go to the event.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/3246628856072064746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/3246628856072064746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3246628856072064746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3246628856072064746'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/01/another-night-with-gridgain.html' title='Another Night with GridGain'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-5648762406946271232</id><published>2009-01-09T00:15:00.012-05:00</published><updated>2009-01-09T01:08:07.421-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="osgi"/><category scheme="http://www.blogger.com/atom/ns#" term="spring"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Of Maven Dependencies and Repositories</title><content type='html'>&lt;p&gt;
I think of &lt;a href=&quot;http://maven.apache.org&quot;&gt;Maven&lt;/a&gt; the same way I tend to think of &lt;a href=&quot;http://git-scm.com/&quot;&gt;Git&lt;/a&gt;; excellent features, but just a little more complicated and obtuse than is really reasonable for the task. I know that&#39;s insanely unpopular to say about Git, but luckily this isn&#39;t about Git.
&lt;/p&gt;
&lt;p&gt;
Recently, I was converting a project at work to Maven (from &lt;a href=&quot;http://ant.apache.org&quot;&gt;Ant&lt;/a&gt;) as an experiment. This is a relatively standard, mid-sized, Java project that makes heavy use of a number of what I would consider common Java libraries. In our case, we use &lt;a href=&quot;http://www.springsource.org&quot;&gt;Spring&lt;/a&gt; very heavily, along with other staples like &lt;a href=&quot;http://www.hibernate.org&quot;&gt;Hibernate&lt;/a&gt;. One of Maven&#39;s killer features is the ability to resolve dependencies and pull the correct versions from the &lt;a href=&quot;http://www.mavenrepository.com&quot;&gt;Maven Repository&lt;/a&gt;, but we already know that.
&lt;/p&gt;
&lt;p&gt;
I found the selection of dependencies from the central repository to be one of the worst things I&#39;ve had to do in recent days. I was spending more time setting up different repositories and wading through the duplicate packages than I was enjoying the benefits of such features. It&#39;s almost more of a headache than doing it all by hand.
&lt;/p&gt;
&lt;p&gt;
In OSGI bundles, which have some similarities in dependency specification, at least, with Maven, one has the ability to express dependencies in a few ways. The obvious unit of dependency is specifying another bundle. This is, effectively, the same as Maven. OSGI bundles, though, may also opt to specify only what Java packages the bundle imports and let the runtime figure out what bundle to take those packages from. This is similar to how many Linux package managers operate when more than one package can fulfill a dependency and it&#39;s traditionally referred to as a &lt;span style=&quot;font-style:italic;&quot;&gt;virtual dependency.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Maybe what we need from Maven is the notion of the virtual dependency. A Maven POM could specify virtual packages as dependencies that could be filled by any one of a number of providers. Java lends itself to this very well because the majority of standards define the APIs with service providers being distributed separately. Think of things like JPA (provided by Hibernate EM), JAXP (Xerces and friends), and so on. I suppose it&#39;s a little different because Java developers want to pick an implementation for a specific reason, but having virtual dependencies would eliminate many of the overly specific dependency graphs created when dealing with complex packages such as Spring, for instance.
&lt;/p&gt;
&lt;p&gt;
It&#39;s worth noting that the most significant issue I have with Maven is the quality of the metadata. It is just plain awful. Some of the things I ran into were:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Packages that weren&#39;t updated with bug fixes or recent versions&lt;/li&gt;
  &lt;li&gt;Many copies of the same package with different names and odd descrepancies in versions&lt;/li&gt;
  &lt;li&gt;Missing (or unavailable) dependencies&lt;/li&gt;
  &lt;li&gt;When using Spring&#39;s Maven repositories, duplicates of the dependencies are pulled in because Spring depends on versions not in the central rep.&lt;/li&gt;
  &lt;li&gt;Because Spring came from Spring&#39;s repository, packages like &lt;a href=&quot;http://www.gridgain.com&quot;&gt;GridGain&lt;/a&gt; which depend on Spring, grab the version from the central repository, but &lt;a href=&quot;http://www.springsource.org/spring-integration&quot;&gt;Spring Integration&lt;/a&gt; which is only available from Spring&#39;s rep has a dependency on the version of Spring from Spring&#39;s rep... AARRRRRRRRRRRRGGGGGGGGGGHHHHH!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I get that this is hard and it requires a lot of coordination. I get that I could repackage things in my local repository or a corporate shared repository. Should I have to? A lot of the advantage of Maven is lost when one has to manually follow dependencies to figure out why there are two (full) versions of Spring Core in the project. It&#39;s annoying, wasteful, and prone to error.
&lt;/p&gt;
Maven, I want to like you. Really I do. But like a real, live, flesh and blood human, you make it so difficult sometimes, just like your sister (Git).
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/5648762406946271232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/5648762406946271232' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/5648762406946271232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/5648762406946271232'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/01/of-maven-dependencies-and-repositories.html' title='Of Maven Dependencies and Repositories'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-2574911431702643613</id><published>2009-01-07T23:29:00.021-05:00</published><updated>2009-01-08T00:33:35.234-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Declarative Concurrency in Java</title><content type='html'>&lt;p&gt;
Good, solid, safe, effective concurrent programming is hard. Modern languages and paradigms make it easier, but for most, it&#39;s still a challenge to get right, right away. Many people have predicted the end of the great Ghz race. They&#39;re probably right. I don&#39;t have any great insight into the CPU design community. Honestly, it just doesn&#39;t hold my attention. Multi-core systems are all the rage these days, though, and that&#39;s pretty damn cool. None of this is new; plenty of smarter people than myself have pointed it out.
&lt;/p&gt;
&lt;p&gt;
One of the purported benefits of functional programming is how it lends itself to concurrent programming. Luckily, I work with a smart guy who&#39;s both patient and polite enough to talk to me about FP without serving kool-aid (thanks Adam). Many of those conversations entail discussion about state, immutability, and side effects in software implementation. This, of course, leads me to think about how some of these things apply to one of our weapons of choice where we work - Java.
&lt;/p&gt;
&lt;p&gt;
Java accomplishes concurrency via thread objects. Big deal; nothing new here. Most of the confusion comes into play not when deciding what should run concurrently - that&#39;s usually obvious - but when figuring out how to protect shared state. Again, in Java-land, we do this with different types of locks, either implicitly with synchronized blocks or explicitly with the grab bag of fun from the java.util.concurrent.locks package. Many of the Sun docs talk about how we use locks to establish &lt;q&gt;happens before&lt;/q&gt; relationships between points in code. What&#39;s interesting is that this language seems so natural and simple. So why is lock management such a pain?
&lt;/p&gt;
&lt;p&gt;
Maybe imperative locking isn&#39;t the right approach. Maybe, there&#39;s a more natural way to establish a &lt;q&gt;happens before&lt;/q&gt; relationship. It sounds like dependency declaration. I&#39;m wondering if we can&#39;t find a way to declare dependencies within source code. Maybe there&#39;s a way to declare dependencies, with something like annotations, where instrumentation can infer what we&#39;re looking for. This, of course, is sugar for what we have now, but I don&#39;t think sugar is always bad.
&lt;/p&gt;
&lt;pre&gt;
 public class MyClass {

   private int counter = 0;

   @Concurrent( stateful = true )
   public void execute() {
     /* Do something that might touch shared state. */
     this.counter++;
   }

   @Concurrent( unitName = &quot;otherExecute&quot;, stateful = false )
   public void otherExecute(String someArg) {
     /* Do something that promises not to alter ourselves. */
   }

   @Concurrent(
     unitName      = &quot;somethingElse&quot;,
     stateful      = true,
     happensBefore = &quot;otherExecute&quot;
   )
   public void somethingElse() {
     /* This can be run concurrently, could touch state, but
      * must happen before &quot;otherExecute&quot; is called.
      */
   }

   static public void main(String[] args) {
     ConcurrentController controller;
     ConcurrentUnit       unit1;
     ConcurrentUnit       unit2;

     controller = ConcurrencyController.forClass(MyClass.class);

     unit1 = controller.getUnit(&quot;somethingElse&quot;).setThreadPoolSize(10);
     unit2 = controller.getUnit(&quot;otherExecute&quot;).setThreadPoolSize(5);

     unit1.start();
     unit2.start();
   }
 }
&lt;/pre&gt;
&lt;p&gt;
The @Concurrent annotations would instruct an instrumentation library to perform an operation in parallel. The hints &lt;q&gt;stateful&lt;/q&gt; and &lt;q&gt;happensBefore&lt;/q&gt; could be used to perform additional automatic member variable monitor acquisition or something equally snazzy. The unitNames could be used to grab a &lt;q&gt;handle,&lt;/q&gt; of sorts, to a concurrent unit of work and be used to establish relationships or to report on concurrency &lt;q&gt;plans&lt;/q&gt; (which could be similar to an RDBMS query execution plan). Who knows... I&#39;m tossing ideas around.
&lt;/p&gt;
&lt;p&gt;
I don&#39;t think it covers every situation. In fact, I&#39;m sure it doesn&#39;t cover everything. It&#39;s beyond flawed and probably not possible. I&#39;m just trying to get some wheels turning. The goal is to have simpler, coarse-grained, declarative concurrency definition that can be externalized.
&lt;/p&gt;
&lt;p&gt;
I&#39;m intrigued by the idea of simple concurrency models that don&#39;t remove the fine-grained control given to us by the language and APIs. If concurrency isn&#39;t going away, it has to get easier for the majority of people to do it correctly.
&lt;/p&gt;
&lt;p&gt;
I&#39;m especially interested in feedback on this.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/2574911431702643613/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/2574911431702643613' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2574911431702643613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2574911431702643613'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/01/declarative-concurrency-in-java.html' title='Declarative Concurrency in Java'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-3080295549434606199</id><published>2009-01-01T13:58:00.007-05:00</published><updated>2009-01-01T14:50:33.768-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="team"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Agile Languages and Developer Experience</title><content type='html'>&lt;p&gt;
I just finished reading &lt;a href=&quot;http://weblog.jamisbuck.org/&quot;&gt;Jamis Buck&#39;s&lt;/a&gt; &lt;a href=&quot;http://weblog.jamisbuck.org/2008/11/9/legos-play-doh-and-programming&quot;&gt;Legos, Play-Doh, and Programming&lt;/a&gt; article where he discusses some significant differences in methodologies between languages like Ruby and Java. It got me thinking.
&lt;/p&gt;
&lt;p&gt;
Jamis makes a number of points about how the Ruby way is generally more dynamic and less prone to specialized components. This has a lot to do with the points of extension in Ruby and the malleability of the language, itself. For instance, Ruby&#39;s ability to inject methods into existing classes or the convention of duck typing in standard libraries allow developers to pose as different types of objects and get away with a lot more than a language like Java. There are tons of arguments in both communities over which approach is &lt;q&gt;better.&lt;/q&gt; I call shenanigans.
&lt;/p&gt;
&lt;p&gt;
It&#39;s my hypothesis that both are great. I know that sounds like a cheap way to duck the flying artillery between the camps, but it&#39;s the truth. Hey, I wrote Perl for &lt;span style=&quot;font-style:italic;&quot;&gt;years&lt;/span&gt; so don&#39;t pretend to have invented the notion of language flexibility with me. (The previous sentence just started a million replies; let&#39;s pretend I&#39;ve already read them all because I know what you&#39;re going to say.) I&#39;ve used Ruby, Python, Perl, Java, C, C++, and others on medium to large sized, &lt;q&gt;real&lt;/q&gt; projects so I think I can be objective on this one.
&lt;/p&gt;
&lt;p&gt;
It&#39;s my experience that the problem isn&#39;t with either approach, really. I&#39;ve met ninja-good developers on all sides. The wall I have run into, on the other hand, is that the amount of rope given to a lesser experienced or disciplined developer is almost directly proportional to the insanity they can manufacture. I don&#39;t think one can make a blanket statement on language suitability one way or the other.
&lt;/p&gt;
In the past, I&#39;ve used dynamic languages (heavily) for my own projects. No matter how right or wrong my own code is, it&#39;s mine and I get it, most of the time. I have a basis in C and tend to do a lot of &lt;q&gt;mental book keeping&lt;/q&gt; when I code. It&#39;s a holdover from days when I didn&#39;t have things to sanity check my own work. There was a lot of rope, but I was the only one in the room so I made sure not to throw it over the rafters, wrap it around my neck, climb on a chair, and then try to figure out what I had done wrong. If I did, I had only myself to blame.
&lt;/p&gt;
&lt;p&gt;
When I&#39;m working with a team of fifty developers of varying levels of experience, discipline, knowledge of good design and testability, and interest in their craft, the game changes. You can&#39;t bank on each member of the team having the same skill set or even interest in what you&#39;re trying to get done. Or, maybe you can, simply by applying very strict guidelines. The fact of the matter is that it&#39;s not as cut and dry either side wants you to believe. You&#39;re going to have code-cowboys who are &lt;q&gt;clever&lt;/q&gt; - and beware that word for it means smart, but with a hint of tricky and subversiveness - who are going to do things like override the built in functions to given them cool new uses never previously imagined! You&#39;re going to have recent university grads who need mentoring, even if only half of them know it. You&#39;re going to have your average, mediocre, developer for whom this is a nine to five gig funding an ever more expensive pot habit. And, if you&#39;re lucky, you&#39;ll have one or two super star, ninja coders, who turn out reliable, efficient, readable, documented, testable, well designed, code. (As an aside, if you&#39;re one of those people, have one, or know one, I&#39;m looking for resumes.)
&lt;/p&gt;
&lt;p&gt;
My point: &lt;span style=&quot;font-style:italic;&quot;&gt;do not optimize for a group you do not have.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Lying to yourself will only get you knee deep in your own rationalizations about why your language is, in fact, the best one on the planet, and how the other guys &lt;q&gt;just don&#39;t get it.&lt;/q&gt; The worst part is you&#39;ll still be right every single time.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/3080295549434606199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/3080295549434606199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3080295549434606199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3080295549434606199'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2009/01/agile-languages-and-developer.html' title='Agile Languages and Developer Experience'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-2458402974977351382</id><published>2008-12-31T17:01:00.004-05:00</published><updated>2008-12-31T17:11:07.641-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pop tech"/><title type='text'>Twitter (Yea, I know)</title><content type='html'>&lt;p&gt;
Against my better judgement, which is how I do most things in life, I&#39;ve begun playing with &lt;a href=&quot;http://www.twitter.com&quot;&gt;twitter&lt;/a&gt; again. I invite you to &lt;a href=&quot;http://twitter.com/esammer&quot;&gt;follow me&lt;/a&gt; there, taking every opportunity to taunt me for my usage of such a self indulgent, narcissistic, &lt;q&gt;hey look at me,&lt;/q&gt; kind of (dare we call it) technology.
&lt;/p&gt;
&lt;p&gt;
I blame some of those I work with for my renewed experimentation. You know who you are (ahem-Kiril-cough).
&lt;/p&gt;
&lt;p&gt;
Email or reply here and let me know all the reasons why I shouldn&#39;t succumb to the silliness, or to let me what your nick there is so we can be silly together, exchanging absurdly pithy comments about happenings in our lives.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/2458402974977351382/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/2458402974977351382' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2458402974977351382'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2458402974977351382'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/12/twitter-yea-i-know.html' title='Twitter (Yea, I know)'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-3681647898529522564</id><published>2008-09-05T17:30:00.092-04:00</published><updated>2009-01-01T22:55:28.250-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="grid"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><title type='text'>GridGain - simple, effective, and made of pure happy juice</title><content type='html'>&lt;p&gt;
Let&#39;s talk about real, tangible, hype-less, &lt;q&gt;grid&lt;/q&gt; computing. I swear,
it&#39;s real.
&lt;/p&gt;

&lt;p&gt;
I&#39;ve heard endless sales pitches about &lt;q&gt;moving your apps to the grid.&lt;/q&gt; It&#39;s
almost quaint how easy they make it sound. Let&#39;s pretend, for a moment, you have
an application that benefits from parallelization, you have no issues with data
availability, and you control your source code (because you&#39;re not going to
make every application you use magically run in parallel regardless of the sales
pitch).
&lt;/p&gt;

&lt;p&gt;
To this end, I&#39;ve been using &lt;a href=&quot;http://www.gridgain.com&quot;&gt;GridGain&lt;/a&gt;, recently.
In a few weeks I might even be
able to talk about why, but that&#39;s far less important. For those living under
a rock, GridGain is a Java implementation of a Google-ish &lt;a href=&quot;http://labs.google.com/papers/mapreduce.html&quot;&gt;map / reduce&lt;/a&gt; system.
The effect is that, with very little code and even less configuration, one can
cause suitable code to run in parallel, on a grid of JVM nodes. I won&#39;t discuss
the map / reduce concept in detail, other than to say the idea is to:
&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;take a job, break it up into smaller units of work&lt;/li&gt;
  &lt;li&gt;assign these units to processing nodes&lt;/li&gt;
  &lt;li&gt;collect the results from the processing nodes&lt;/li&gt;
  &lt;li&gt;aggregate the results, as appropriate&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
Items #1 and #2 refer to the &lt;q&gt;map&lt;/q&gt; part of the process, while
#3 and #4 refer to the &lt;q&gt;reduce&lt;/q&gt; component.
&lt;/p&gt;

&lt;p&gt;
There are two ways to use GridGain. The first method is to annotate methods
(either static or otherwise) that should be run on the grid. This is fast
to write, and coarse-grained in that the unit of work is (usually, but need not be)
the entire method. The second method of running tasks on the grid is by directly
accessing the &lt;a href=&quot;http://www.gridgain.com/javadoc/overview-summary.html&quot;&gt;GridGain APIs&lt;/a&gt;. This, of course, tends to mean a bit more code, but
to some, may be easier to understand and debug. Which method you choose, will
probably depend mostly on preference, but could also be influenced by dependencies.
I opted for direct invocation via the APIs because I prefer not to futz around
with AspectJ - which is how the annotations actually work - and friends unless I&#39;m
also using it for other things. GridGain is happy to work with AspectJ, Spring AOP,
or JBoss AOP, according to the docs, although they seem to recommend against Spring
AOP due to a lack of &lt;q&gt;full functionality&lt;/q&gt; or some such. I didn&#39;t get too much
into the details.
&lt;/p&gt;

&lt;p&gt;
The APIs are surprisingly direct and simple to understand for something that is
so seemingly nebulous. This, coupled with some of the best documentation I&#39;ve
seen in some time, makes for a pleasant experience. The only thing that makes
my vision a little blurry is the generic-soup that begins to occur, but for
the type safety, it&#39;s probably worth it; anything that needs to run on a grid
is arguably important enough that you can groan through the angle brackets.
&lt;/p&gt;

&lt;p&gt;
Running a GridGain node requires zero configuration, in many cases, although being
a Spring application, itself, and being well written with a number of service
provider interfaces, one could easily sculpt what amounts to a custom product out
of it. What is nice is that one can easily run GridGain within an IDE like Eclipse
during testing and development, which significantly speeds the process of rolling
out your apps. While on the topic of time saving features, GridGain using peer-based
class loading meaning, for simple, self contained, tasks, one need not do any kind
of special deployment to execute tasks. The task classes are transmitted and loaded
by GridGain itself, without any need for restarts or copying. It&#39;s like a magic
fairy sprinkled happy-time sparkles in my brain.
&lt;/p&gt;

&lt;p&gt;
Of course, GridGain provides all manners of fancy pants things that I haven&#39;t yet
explored such as node affinity for processing &lt;q&gt;close to&lt;/q&gt; your data, integration
with caching products from Oracle and JBoss, different scheduling and communication
methods, and similar goodies. I also haven&#39;t fully explored implementing custom service
providers, but it&#39;s mostly because I couldn&#39;t find one that I might need that wasn&#39;t
already implemented.
&lt;/p&gt;

&lt;p&gt;
Here&#39;s a bottom of the barrel, super-contrived, example to whet your noggin knobs.
&lt;/p&gt;

&lt;pre&gt;
public class TestApp {

  static public void main(String[] args) throws GridException {
    try {
      Grid grid;
      GridTaskFuture&lt;String&gt; future;

      grid = GridFactory.start();

      future = grid.execute(MyTask.class, &amp;quot;Print me...&amp;quot;);

      // This causes GridGain to block until all jobs are complete. It
      // also returns the result, if there is one.
      future.get();

    } finally {
      GridFactory.stop(false);
    }
  }
}

/*
 * The task class is going to be the unit of word that gets split
 * into smaller jobs (GridJob) that get distributed and executed.
 * I&#39;m using adapters for both the task as well as the jobs to avoid
 * extra work, so yes, I&#39;m cheating.
 */
public class MyTask extends GridTaskAdapter&amp;lt;String, String&amp;gt; {

  @Override
  protected Collection&amp;lt;? extends GridJob&amp;gt; split(int gridSize, String arg)
    throws GridException {

    List&amp;lt;GridJobAdapter&amp;lt;String&amp;gt;&amp;gt; jobs;

    jobs = new ArrayList&amp;lt;GridJobAdapter&amp;lt;String&amp;gt;&amp;gt;();

    // Build a collection of jobs to run on the grid.

    for (int i = 0; i &lt; 10; i++) {
      jobs.add(new GridJobAdapter&amp;lt;String&amp;gt;(arg) {
        @Override
        public Serializable execute() throw GridException {
          System.out.println(&amp;quot;arg:&amp;quot; + getArgument());
        }
      });
    }

    return jobs;
  }


  @Override
  public String reduce(List&amp;lt;GridJobResult&amp;gt; results) throws GridException {
    System.out.println(&amp;quot;Not much to reduce when we&#39;re printing stuff...&amp;quot;);

    return null;
  }
}
&lt;/pre&gt;

&lt;p&gt;
I know it&#39;s probably considered verbose, still, to the scripting community
at large, but when you consider what&#39;s happening here, it&#39;s pretty bad ass.
&lt;/p&gt;
&lt;p&gt;
It&#39;s worth noting that there are other frameworks similar to GridGain, in
this space, that deserve a look as well. &lt;a href=&quot;http://hadoop.apache.org/core/&quot;&gt;Hadoop&lt;/a&gt; comes to mind. I have no
direct experience with them, so I don&#39;t want to say either way, but I have
heard nice things.
&lt;/p&gt;
&lt;p&gt;
This is all very contrived and still thin on details. My goal wasn&#39;t to
reproduce a howto, but more so to, well, to glow about GridGain, to some
small degree. I encourage everyone to check out GridGain for themselves and
find the things relevant to them.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/3681647898529522564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/3681647898529522564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3681647898529522564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/3681647898529522564'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/09/gridgain-simple-effective-and-made-of.html' title='GridGain - simple, effective, and made of pure happy juice'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-8857437649950776627</id><published>2008-09-05T11:56:00.000-04:00</published><updated>2008-09-05T11:56:41.477-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="rails"/><category scheme="http://www.blogger.com/atom/ns#" term="ruby"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><title type='text'>(Brief) Thoughts on Rails</title><content type='html'>&lt;p&gt;
In working with &lt;a href=&quot;http://www.ruby-lang.org&quot;&gt;Ruby&lt;/a&gt;, and
specifically &lt;a href=&quot;http://www.rubyonrails.org&quot;&gt;Ruby on Rails&lt;/a&gt;, I&#39;ve
developed a few opinions about the underlying design, architecture, but
more so the development principals and philosophies.

Note that I wouldn&#39;t classify myself as a Ruby nor a Rails expert, although
I do have extensive experience with other languages and frameworks.
&lt;/p&gt;
&lt;p&gt;
Both Ruby and Rails are philosophy heavy. This isn&#39;t inherently a bad thing, in my
opinion. These communities are rife with smart people writing smart software; you
wouldn&#39;t want the opposite, or any other combination thereof. The gripes that I
do have are in the places where those smarts are complimented to the point where
they metamorphose into arrogance. Please don&#39;t get caught up on the word &lt;q&gt;arrogance.&lt;/q&gt;
Keep going. I just couldn&#39;t find a less provocative synonym.
&lt;/p&gt;
&lt;p&gt;
Let Rails be decomposed into three pieces - the model (ActiveRecord), view (ActionView
and ERb, in my case), and controller (ActionController) components. When building
any Rails application, one is sure to work with all three. Therein, lies the first
issue; Rails owns all.
&lt;/p&gt;
&lt;h4&gt;Configuration has use&lt;/h4&gt;
&lt;p&gt;
Rails (and Ruby) favor convention over configuration. I think this is absolutely a
good, general, idea. Having worked with things like &lt;a href=&quot;http://www.springframework.org&quot;&gt;Spring&lt;/a&gt; and Java in general, I would welcome
a bit less in the way of configuration, in some cases. That said, in the case of Rails,
there are certain things I wish I could configure via (something like) XML rather than
code. For instance, the route configuration in Rails (aka: mapping URLs to controllers)
is done in code. The code is kind of DSL-ish which makes it a bit better, I suppose, but
developing tools to parse and generate said &lt;q&gt;configuration&lt;/q&gt; would be painful. One
could eval the code and attempt to work with it that way, but that&#39;s not necessarily
safe, nor would it be free from a huge number of dependencies (like Rails, itself). Another
option is to replace routes.rb (the standard file name) with something skeletal that loads
configuration from XML or YAML even, but shouldn&#39;t that come out of the box? You know, in the
interest of the entire Rails community not repeating themselves and all.
Please Rails, let me use configuration where it makes sense. This is but one simple example.
&lt;/p&gt;
&lt;p&gt;
Ruby on Rails. It&#39;s not new and there&#39;s no shortage of both hype and panning from all sides.
Nothing is ever the panacea. There is no short cut to building complete, real world,
applications. You can make it easier, but you can&#39;t take away the requirements that
a client or business places on an application. Specifically, a framework, language,
or library may never dictate what is possible unless there is a technical limitation
or purpose. Philosophy in software is excellent; obstinance is unforgivable.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/8857437649950776627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/8857437649950776627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/8857437649950776627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/8857437649950776627'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/02/brief-thoughts-on-rails.html' title='(Brief) Thoughts on Rails'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-5683656043370516006</id><published>2008-07-20T13:54:00.025-04:00</published><updated>2009-01-01T22:57:30.794-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Content Management Systems</title><content type='html'>&lt;p&gt;
Recently, I&#39;ve encountered a situation where we needed certain (static) elements of our site to be under the control of a content management system. This seems easy enough. I did a fair amount of research into both &lt;a href=&quot;http://drupal.org/&quot;&gt;Drupal&lt;/a&gt; and &lt;a href=&quot;http://www.joomla.org/&quot;&gt;Joomla&lt;/a&gt;, two of the more popular projects that are out in the wild these days. The requirements are straight forward:
&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Non-technical people must be able to edit content and publish it to the site.&lt;/li&gt;&lt;li&gt;The content needs to be published as static, well formed, HTML.&lt;/li&gt;&lt;li&gt;Multiple templates must be supported such that one can create and manage content for each type of page.&lt;/li&gt;&lt;/ol&gt;

&lt;p&gt;
There&#39;s always two questions we ask when we see requirements like this; &quot;are these things technically feasible and realistic&quot;, but more importantly, &quot;why do we have these requirements?&quot; To better address the former, the latter must be defined.
&lt;/p&gt;
&lt;p&gt;
One of the tenets of a system such as a CMS is that it must integrate with existing infrastructure. In our case, we have an existing site, in production, that can&#39;t be easily disrupted. Nor can we take the time to perform any kind of wholesale migration of code or deployment strategy. Again, the goal is to manage just a very small subsection of the site that is entirely static with one of these systems. Easier said than done.
&lt;/p&gt;
&lt;p&gt;
Both Drupal and Joomla have an amazing feature set, to be sure. Both have large, active, communities, plenty of modules, and significant deployments. Upon further inspection of both, what I found both surprised and scared me; neither does what I need it to do. Let me break down the requirements in a more specific way; I would like to create multiple, complete, HTML templates with small sections that can be edited by content authors.
&lt;/p&gt;
&lt;p&gt;
This seems like the easiest use case possible for a &lt;span style=&quot;font-style: italic;&quot;&gt;content management system&lt;/span&gt;, yet neither system seems to handle this easily. Neither Drupal nor Joomla operates &quot;off line,&quot; instead opting to render pages dynamically, at request time. Drupal&#39;s caching system, which initially sounded promising, simply builds the static page and insert it back into the database. Worse, is that Drupal insists that a site has a &quot;theme&quot; which, while similar to a template, implies that there is only one per site. Joomla at least seems to acknowledge that a site can have multiple templates, but there&#39;s no provision for creating them (although one can &lt;span style=&quot;font-style: italic;&quot;&gt;edit&lt;/span&gt; an existing template). Of course, Joomla also seems to lack support for generating static HTML output in a location of my choice.
&lt;/p&gt;
&lt;p&gt;
What Drupal and Joomla both seem to do extremely well is allow one to create a site from scratch with all manners of bells and whistles. Both have extensive support for users, comments, neat little calendar thingies, forums, RSS feed generators... wowzers. These are both great projects for building a site with specific needs, but, and I know this is going to result in hate mail, without writing custom code, neither performs the functions I would consider the baseline requirements of a content management system.
&lt;/p&gt;
&lt;p&gt;
On a side note, I did find the Apache &lt;a href=&quot;http://lenya.apache.org/&quot;&gt;Lenya&lt;/a&gt; project which seems to be much more what I would expect from a CMS. The online demo for Lenya doesn&#39;t make me feel very confident about it, but I&#39;m hoping it&#39;s going to improve over time. In true Apache project style, they seem to have people doing &lt;a href=&quot;http://lenya.apache.org/index/roadmap.html#positioning&quot;&gt;evaluation&lt;/a&gt; of what areas they&#39;re lacking in and what they need to be successful. No wonder the Apache umbrella turns out such good work.
&lt;/p&gt;
&lt;p&gt;
There&#39;s also a number of other projects out there, some of which I&#39;ve used before, some of which I&#39;m intimately familiar with. That&#39;s what I&#39;m avoiding them and not mentioning them at all. Suffice it to say there&#39;s a lot of work to do in the CMS arena.
&lt;/p&gt;
&lt;p&gt;
I am interested in Drupal and Joomla in that I think there&#39;s something there, but I am surprised at the wide-and-shallow approach to content management. I hope to get a better understanding of the goals of the projects in the coming weeks to see what they&#39;re really trying to address. Unfortunately, the do-all projects tend to never do one thing well.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/5683656043370516006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/5683656043370516006' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/5683656043370516006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/5683656043370516006'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/07/content-management-systems.html' title='Content Management Systems'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-6218747539972135375</id><published>2008-05-23T00:45:00.007-04:00</published><updated>2009-01-01T22:57:59.442-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="business"/><category scheme="http://www.blogger.com/atom/ns#" term="team"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Operations on the cheap</title><content type='html'>&lt;p&gt;
My current position puts me back into the world of tech ops,
for lack of a better description. I&#39;m primarily responsible
for data center operations and infrastructure. It&#39;s not a
bad gig, but as one might expect, it shifts the focus.
&lt;/p&gt;
&lt;p&gt;
I have the omnipresent mandate of running the show on the
cheap. This, of course, should be an anti-surprise for anyone
in either a startup or a smart company. Waste is always
wasteful even if you can afford it. Hint: you can never
afford it.
&lt;/p&gt;
&lt;p&gt;
Given this most recent brush with corporate poverty (which
I fully support and feel is one of the things that keeps us
honest about what is really necessary) I feel like I need
to write something up on what has worked, in my experience.
Maybe it&#39;s time for &lt;a href=&quot;http://www.stickk.com&quot;&gt;motivation&lt;/a&gt;.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/6218747539972135375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/6218747539972135375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6218747539972135375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6218747539972135375'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/05/operations-on-cheap.html' title='Operations on the cheap'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-2178711363746780937</id><published>2008-03-16T19:20:00.007-04:00</published><updated>2009-01-01T22:58:36.080-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="business"/><category scheme="http://www.blogger.com/atom/ns#" term="open source"/><category scheme="http://www.blogger.com/atom/ns#" term="standards"/><title type='text'>Open Source and the IP Clause</title><content type='html'>&lt;p style=&quot;font-size: smaller; font-style: italic;&quot;&gt;
This article reflects my lay-person&#39;s understanding of employment
and intellectual property. It is not legal advice of any kind.
I am not a lawyer. Don&#39;t assume that any of this is correct. This
is based on drips of information I&#39;ve picked up over the years.
Corrections are very welcome.
&lt;/p&gt;
&lt;p&gt;
As I&#39;ve mentioned recently, I&#39;ve switched jobs in the past month.
One of the things I always worry about is the dreaded intellectual
property clauses in most modern employment contracts. You may be
surprised to find out that most companies &lt;q&gt;in the know&lt;/q&gt; are
willing to modify these, traditionally, draconian clauses if you
phrase the request correctly.
&lt;/p&gt;

&lt;h3&gt;The Problem&lt;/h3&gt;
&lt;p&gt;
Commonly, these sections claim ownership of all IP, in all forms,
for the company, with very little restriction. In more than one
case, I&#39;ve seen contracts that claim ownership of all IP developed
on and off the clock, &lt;span style=&quot;font-style: italic;&quot;&gt;regardless
of whether or not the work is related to what the business does
or may do.&lt;/span&gt; This, of course, means that anyone interested in
doing any kind of open source development, or even research of any
kind, will not necessarily own such work.
&lt;/p&gt;
&lt;p&gt;
I like to get involved in open source projects so having the freedom
to do so is worth something to me. I found that simply being up front
and asking the employer for modifications to the contract, if necessary,
is the best way to go.
&lt;/p&gt;

&lt;h3&gt;The Changes&lt;/h3&gt;
&lt;p&gt;
In the most recent contract I was presented with, the company claimed
all rights over everything developed while I was employed. Having one
or two projects I&#39;m interested in working on that are entirely unrelated
to the company&#39;s stated business, I asked for changes to the contract.
&lt;/p&gt;
&lt;p&gt;
I did not provide specific language for the changes I requested. I asked
the company&#39;s management and general counsel for the following privileges.
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Ownership and the right to develop source code, written work, and
    IP in any other form provided it did not compete with or interfere in
    the company&#39;s stated goals and business.
  &lt;/li&gt;
  &lt;li&gt;
    The right to release any IP, in any form, under a license of my
    choosing, citing the GPL, LGPL, BSD, APL, MPL, Creative Commons, and
    other licenses as examples of the type of license I may select.
  &lt;/li&gt;
  &lt;li&gt;
    The right to participate in standards groups and bodies, user groups,
    and conferences, presenting any IP that I would own, under these changes.
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Some of that is redundant. I asked for these things this way because I wanted
to make very clear what my intentions were; to effectively disclose to the
public, any IP I developed during my employment that was unrelated to the
business.
&lt;/p&gt;
&lt;p&gt;
As concessions, I offered that the company would be allowed to dictate the
following.
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
    Whether or not I disclose for whom I work. They have the option of requiring
    me to state for whom I work (i.e. if they feel it helps them in some way).
  &lt;/li&gt;
  &lt;li&gt;If any IP was in a &lt;q&gt;shady grey area&lt;/q&gt; about whether or not it was
    in conflict with the business&#39;s goals or primary line of business, it would
    remain unreleased by me.
  &lt;/li&gt;
  &lt;li&gt;
    I must select a license that allows the company to use said IP. Restrictions
    on their use of said IP was acceptable (i.e. I license something under GPL
    which limits their usage in some cases).
  &lt;/li&gt;
  &lt;li&gt;
    They may opt to review work for conflict with their business.
  &lt;/li&gt;
  &lt;li&gt;
    I am still (obviously) subject to, and aware of, the non-compete
    clauses in my contract.
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;Reality&lt;/h3&gt;
&lt;p&gt;
It&#39;s not utopia. I don&#39;t even know if it&#39;s all enforceable; like I said, I&#39;m &lt;span style=&quot;font-weight:bold;&quot;&gt;really&lt;/span&gt; not a lawyer (and they are). I probably
won&#39;t develop anything worth their time, but I want the option to try. More importantly,
we, as potential contributors to open source work and standards, have the obligation
of protecting projects and bodies to which we contribute.
I don&#39;t know how effective the changes are that I requested, but certainly in its
original form, that contract could be problematic to an open source project if I had
contributed something and my employer wasn&#39;t happy about it.
&lt;/p&gt;
&lt;p&gt;
I hope more companies, especially those that thrive on open source software and
standards (even if only indirectly; I&#39;m looking at you, Oracle, Java, and Microsoft shops),
become more tolerant of what is required to generate such IP. Better, of
course, are those that can directly contribute company owned IP, but by simply not attempting
to exert ownership of the minds of their employees, a company is taking a huge step in the
right direction. At least in my (non-lawyer) opinion.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/2178711363746780937/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/2178711363746780937' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2178711363746780937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2178711363746780937'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/03/open-source-and-ip-clause.html' title='Open Source and the IP Clause'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-4510683382593120205</id><published>2008-03-12T23:48:00.006-04:00</published><updated>2008-03-13T00:25:11.919-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="integration"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="php"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="standards"/><title type='text'>Mixed Language Architectures</title><content type='html'>&lt;p&gt;
I&#39;ve recently switched jobs. I won&#39;t get too much into that. I hate interviewing
and recruiters even more. More importantly, my new &lt;q&gt;home&lt;/q&gt; is full of smart people
and a snazzy set of problems to solve.
&lt;/p&gt;
&lt;p&gt;
The CTO at this company was dealt a bad hand. Before either of us were hired,
a functional, but severely damaged PHP application was built by contractors for
the main web site. Put away your flame throwers; that&#39;s a comment about the
situation and has zero to do with the language. Because we&#39;re not far into
the life of this company or the application, there&#39;s an opportunity to fix
what doesn&#39;t work, and the underlying (lack of) architecture doesn&#39;t work.
&lt;/p&gt;
&lt;p&gt;
In an effort not to drastically upset time lines and ongoing projects, our CTO
had to come up with an approach that would increase capacity, scale, and inject
design principals and best practices into what already existed. The current
application did not allow for the features the business folks wanted down the
road. It needed love and attention.
&lt;/p&gt;
&lt;p&gt;
The plan was to leave PHP for the presentation logic, templating, and rendering,
but to gut major pieces of business functionality and implement them as
services that exist in a middle tier. These services are written in Java and
served up as web services for easy consumption by the PHP front end layer as
well as by third party applications for integration. The PHP layer retains
some ability to cache results from the service layer, where necessary, but
ultimately, the real heavy lifting in business logic takes place within the
services, themselves.
&lt;/p&gt;
&lt;p&gt;
The advantages to this approach are:
&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;
    Existing functionality can be tackled and replaced piecemeal; a much
    less taxing proposal.
  &lt;/li&gt;
  &lt;li&gt;
    A very clear separation of responsibility must exist.
  &lt;/li&gt;
  &lt;li&gt;
    Rapid prototyping can still occur in PHP which is generally better
    at fast turn around and testing.
  &lt;/li&gt;
  &lt;li&gt;
    The majority of very complex configuration and scaffolding that needs
    to happen with Java is in the web tier and its associated frameworks.
    Using Java as a back end service layer lets you get strongly typed,
    well defined, and proven technology in a place where it&#39;s easy to work
    with. Frameworks and components like Spring, Quartz, Hibernate, JMS,
    Lucene, and solid transaction management can be exploited without
    having to incur the long development times that are expected at the
    web layer.
  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Surely this isn&#39;t magic, nor is it rocket science. I do
find it interesting that the downside - a strained architecture -
can be turned into something positive by clearly defining lines
and using standards as a means of self-integration.
&lt;/p&gt;
&lt;p&gt;
If you work in an environment similar to this, I&#39;m interested
in hearing your experiences, both good and bad.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/4510683382593120205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/4510683382593120205' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/4510683382593120205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/4510683382593120205'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/03/mixed-language-architectures.html' title='Mixed Language Architectures'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-6246853971549984202</id><published>2008-02-22T02:02:00.004-05:00</published><updated>2009-01-01T22:59:06.826-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="business"/><category scheme="http://www.blogger.com/atom/ns#" term="team"/><title type='text'>What Makes the Job</title><content type='html'>&lt;p&gt;
As much as I have a burning hatred for interviewing for jobs, I&#39;ve had to do so lately.
I&#39;m a creature of habit and comfort. I like working with and getting to know a core group
of people. People are important like that. People are, absolutely, what make the job.
&lt;/p&gt;
&lt;p&gt;
More so than anything, I&#39;ve realized over the last week of interviews (I limit it to exactly
one week of interviews) that a little extra money, the promise of equity in a company, even
the business the company is in; all a far distant second to the people. Smart, talented,
&lt;b&gt;interested&lt;/b&gt;, people.
&lt;/p&gt;
&lt;p&gt;
Almost unbelievably, I found two companies that seem to be full of people that are exactly
what I would look for  (well, at least the ones I met). For the record, I&#39;m not sucking
up; I&#39;ve already received the offers and I don&#39;t think they know about or care about this
blog. There shouldn&#39;t be anything remarkable about this, but there is. No pinball machine,
free bagels, or company sponsored potato sack race can possibly come close to what I get
out of picking the brains of smart coworkers.
&lt;/p&gt;
&lt;p&gt;
That&#39;s all. Nothing notable, per se, just a realization about what&#39;s really important to me.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/6246853971549984202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/6246853971549984202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6246853971549984202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/6246853971549984202'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2008/02/what-makes-job.html' title='What Makes the Job'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-319680366097422636</id><published>2007-10-29T23:27:00.000-04:00</published><updated>2009-01-01T22:59:06.827-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="tools"/><title type='text'>Time Keeping and Scheduling Systems</title><content type='html'>&lt;p&gt;
The following is probably old hat. For me, today, it&#39;s worth rehashing.
&lt;/p&gt;
&lt;p&gt;
Recently, I&#39;ve had to work on a rather feature rich scheduling system. This is one of those tasks that always seems trivial the first time you need to do it, but really isn&#39;t. In many, many, many cases, the existing frameworks can&#39;t bail you out of the details. Sure, plenty of frameworks and libraries do things like timezone conversion and the like; that&#39;s helpful (if not required), but not the complete package.
&lt;/p&gt;
&lt;p&gt;
I was working on recurrent schedule generation with a coworker, &lt;span style=&quot;font-style:italic;&quot;&gt;GR&lt;/span&gt;. Whilst working out the scary details of operating in multiple client timezones, being locale sensitive, guaranteeing non-duplicate job execution, he turned to me with a stunning revelation (as he&#39;s known to do, often), and said
&lt;/p&gt;
&lt;blockquote&gt;
You know, this is one of those things that has been done a thousand times, correctly, but none of those implementations were ever &lt;q&gt;right.&lt;/q&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Obviously, what he meant is that you can&#39;t get this &lt;q&gt;right&lt;/q&gt; because it&#39;s so heavily dependent on the context within one is operating. It depends on desirable locale effects, granularity of event intervals, and similar concerns. In one case, it may not matter if an event fires twice, once a year, during the day light savings time adjustment; task idempotency may be guaranteed, whereas in other cases, this isn&#39;t true (like for me). Maybe you have the have luxury of operating within a single timezone (lucky you). All of these things affect the feature set and can really change the game.
&lt;/p&gt;
&lt;p&gt;
All of the solutions I have (personally) encountered for task scheduling miss the mark, in my current case, in one way or another. It&#39;s frustrating to have to build something that seems as if it should already exist. Of course, there are internal, business requirements that prevent me from either going into significant detail, or from my open sourcing the result, but trust me when I say this isn&#39;t as easy as it sounds. (I say this in hope of staving off the slew of &lt;q&gt;well, why not just use &lt;span style=&quot;font-style:italic;&quot;&gt;XYZ&lt;/span&gt;&lt;/q&gt; comments I&#39;m bound to get.)
&lt;/p&gt;
&lt;p&gt;
If all of this means nothing to you, take away only this: sometimes, being forced to reinvent the wheel gives one an amazing appreciation for the work that went into the damn thing.
&lt;/p&gt;
&lt;p style=&quot;font-size: 80%;&quot;&gt;
Many thanks to my ninja-smart coworker, &lt;span style=&quot;font-weight:bold;&quot;&gt;GR&lt;/span&gt;, as well as my apologies for my awful paraphrasing of his insightful, comedic wit, and view of the task at hand.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/319680366097422636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/319680366097422636' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/319680366097422636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/319680366097422636'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2007/10/time-keeping-and-scheduling-systems.html' title='Time Keeping and Scheduling Systems'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-5398637967992946527</id><published>2007-10-22T23:16:00.001-04:00</published><updated>2007-10-22T23:44:41.882-04:00</updated><title type='text'>A Quick Note on BlogRush</title><content type='html'>&lt;p&gt;
When I first created this blog (ugh... I hate that word) I played around with different things in a feeble attempt to get some traffic. One of those things was BlogRush. I won&#39;t provide a link or more information other than they claim to drive traffic based on... oh who cares. It didn&#39;t work, anyway.
&lt;/p&gt;
&lt;p&gt;
What&#39;s pretty damn awesome is that, in addition to not working, their site was non-functional for some time. Oops. But - and this is the icing on the cake - today, I received this email from them (edited for brevity).
&lt;/p&gt;
&lt;blockquote&gt;
We regret to inform you that your BlogRush Account has been made INACTIVE because your blog did not pass our Quality Review criteria.  You will find instructions below for making your account active again.
&lt;/blockquote&gt;
&lt;p&gt;
Wait. It gets better.
&lt;/p&gt;
&lt;blockquote&gt;
We determined that your blog did not meet our strict quality guidelines. Please do not take this personally but realize that we must abide by a very strict set of quality guidelines. (They are listed below.)
&lt;/blockquote&gt;
&lt;p&gt;
Note that the content syndicated via BlogRush was so unbelievably off topic, it wasn&#39;t funny. Here&#39;s the great part, though; their standards.
&lt;/p&gt;
&lt;blockquote&gt;
- The blog contains unique, quality content that provides opinions, insights, and/or recommended resources that provide value to readers of the blog. Articles, videos, public domain works, press releases, and content written by others are okay to be used on the blog, but the ratio of unique content should far outweigh content from other sources.
&lt;/blockquote&gt;
&lt;p&gt;
Ok, so I have opinions and I&#39;m not a link farm. Check. Admittedly, I can&#39;t quantify my thoughts or opinions as &lt;q&gt;quality content,&lt;/q&gt; but...
&lt;/p&gt;
&lt;blockquote&gt;
- The blog should be updated on a regular basis (at least several times a month) and should not just go a few months between posts.
&lt;/blockquote&gt;
&lt;p&gt;
Check.
&lt;/p&gt;
&lt;blockquote&gt;
- The blog should already contain at least 10-12 quality posts. New blogs with very little content will not be accepted.
&lt;/blockquote&gt;
&lt;p&gt;
New? Yes, but I meet their 10 - 12 posts. Check.
&lt;/p&gt;
&lt;blockquote&gt;
- The blog&#39;s primary contain must be in English. BlogRush is currently not available for non-English blogs.
&lt;/blockquote&gt;
&lt;p&gt;
Again, admittedly, my writing leaves a lot to be desired, but it&#39;s (mostly considered) English. Check.
&lt;/p&gt;
&lt;blockquote&gt;
- The blog should not contain an excessive amount of advertising and links and very little actual content. The focus of the blog should be quality content.
&lt;/blockquote&gt;
&lt;p&gt;
This is not without a certain degree of irony, but OK. Check.
&lt;/p&gt;
&lt;blockquote&gt;
- The primary content of the blog should not be &quot;scraped&quot; content from other sources and/or script-generated pages for the sole purpose of search engine rank manipulation. The focus of the blog should be quality content.
&lt;/blockquote&gt;
&lt;p&gt;
My writing is so terrible I would never presume to pin it on someone else. It&#39;s mine. The focus is certainly quality content (minus this post, oddly enough) - whether or not I achieve said goal is an exercise best left to the reader. Well, OK... Check.
&lt;/p&gt;
&lt;blockquote&gt;
- The blog&#39;s content (or advertising) should not contain any of the following types of content: hate, anti-racial, terrorism, drug-related, hacking, phishing, fraud, pornographic, nudity, warez, gambling, copyright infringement, obscene or disgusting material of any kind, or anything considered illegal.
&lt;/blockquote&gt;
&lt;p&gt;
Uh... I guess it depends on how one defines &lt;q&gt;hacking,&lt;/q&gt; but otherwise, I think we&#39;re safe on this one as well. As an aside, someone will have to explain what &lt;q&gt;anti-racial&lt;/q&gt; means; I do not endorse any kind of racism, but do I no longer even &lt;span style=&quot;font-style:italic;&quot;&gt;have&lt;/span&gt; a race? That&#39;s... weird. Just the phrase &lt;q&gt;anti-racial&lt;/q&gt; hurts my head. Dear BlogRush lawyers; &lt;q&gt;racial&lt;/q&gt; != &lt;q&gt;racism&lt;/q&gt; and you probably &lt;span style=&quot;font-style:italic;&quot;&gt;do&lt;/span&gt; want to be anti-racism. You confuse me.
&lt;/p&gt;
&lt;p&gt;
So there you have it. BlogRush has deemed this content to be of low quality or &lt;q&gt;anti-racial&lt;/q&gt; and I have removed the BlogRush widget. I&#39;m actually kind of feeling better already; it had &lt;q&gt;From the Blogosphere&lt;/q&gt; on it and that just makes me... cringe.
&lt;/p&gt;
&lt;p&gt;
I urge others drop BlogRush, as well.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/5398637967992946527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/5398637967992946527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/5398637967992946527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/5398637967992946527'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2007/10/quick-note-on-blogrush.html' title='A Quick Note on BlogRush'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-2803518027566834787</id><published>2007-10-21T17:09:00.000-04:00</published><updated>2009-01-01T22:59:06.828-05:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="osgi"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><category scheme="http://www.blogger.com/atom/ns#" term="software architecture"/><title type='text'>An OSGi Experience</title><content type='html'>&lt;p&gt;
Last Wednesday, I had a chance to attend the local &lt;a href=&quot;http://www.javasig.com&quot;&gt;Java Special Interest Group&lt;/a&gt; meeting at the Google Engineering building, here in New York City. This month&#39;s topic was the &lt;a href=&quot;http://www.osgi.org&quot;&gt;OSGi&lt;/a&gt; standard and the technology behind it. The presenters were Dr. Richard Nicholson and David Savage from &lt;a href=&quot;http://www.paremus.com&quot;&gt;Paremus&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Unfortunately, while the slides were good and the presenters were clearly very smart, their presentation style left quite a bit to be desired. (Hint: Know your slides, know your audience, don&#39;t read from the slides, etc. Credit to my very smart coworker, JF, for those helpful suggestions.)
&lt;/p&gt;
&lt;p&gt;
If you&#39;re not familiar with OSGi (which I wasn&#39;t, really, until recently), it is basically a framework for structuring applications as loadable &lt;q&gt;bundles&lt;/q&gt; which can be dynamically managed. Of course, that&#39;s a simplification; I suggest reading the &lt;a href=&quot;http://www.osgi.org/osgi_technology/index.asp?section=2&quot;&gt;OSGi group&#39;s explanation&lt;/a&gt; for a better understanding. One person at the meeting who sits on the OSGi board from a major web app server company, with whom I had a chance to talk prior to the presentation, summed it up as &lt;q&gt;class loaders on steroids.&lt;/q&gt;
&lt;/p&gt;
&lt;p&gt;
During the presentation, Dr. Nicholson discussed some of the failings of service oriented architectures and how it hadn&#39;t really lived up to the hype. Probably true, but what does? It made me wonder how one can judge something like that, but I suppose (and according to my presentation saavy cohort, JF) making a controversial statement during a presentation keeps people paying attention. It worked on me, to be sure.
&lt;/p&gt;
&lt;p&gt;
OSGi, in theory, allows one to build application bundles as independent components and wire them together at runtime. I&#39;m still shady on some of the details around how that wiring takes place, but it&#39;s certainly comparable to the &lt;span style=&quot;font-style:italic;&quot;&gt;idea&lt;/span&gt; of software services. As I understood it, OSGi is local, within a JVM. If you want to extend the concept to encompass distributed applications, you need another layer on top of this. During the presentation, Dr. Nicholson demonstrated a product from Paremus called &lt;a href=&quot;http://www.paremus.com/products/products_infiniflow.html&quot;&gt;InfiniFlow&lt;/a&gt; which he described as an &lt;q&gt;Enterprise Service Fabric.&lt;/q&gt; Names aside (because that&#39;s a little, shall we say, marketing inspired?), he used 12 Apple Mac Minis running the InfiniFlow agent and his Mac Book Pro to dynamically build a fractal rendering farm. Not too shabby, Doc.
&lt;/p&gt;
&lt;p&gt;
With this, he loaded a number of OSGi bundles into (presumably) some InfiniFlow management application, deployed it to all 12 machines (getting instant feedback the entire time), and showed us that the network (or fabric) was set to render a &lt;a href=&quot;http://en.wikipedia.org/wiki/Mandelbrot_set&quot;&gt;Mandelbrot set&lt;/a&gt;. Kicking off the rendering showed that each Mac Mini was performing calculations and sending the results back to the laptop where pieces of the image were being drawn. That was neat.
&lt;/p&gt;
&lt;p&gt;
What was more impressive is that he, next, loaded a new OSGi bundle and almost immediately, the client had new options for the &lt;a href=&quot;http://en.wikipedia.org/wiki/Julian_set&quot;&gt;Julian set&lt;/a&gt;. Starting the rendering process showed that the 12 nodes now supported and were executing a new function with no down time, no restarts, and no administrative work (other than the initial loading of the bundles).
&lt;/p&gt;
&lt;p&gt;
The idea behind OSGi is very cool. Dr. Nicholson and Mr. Savage told us that some projects such as &lt;a href=&quot;http://www.eclipse.org&quot;&gt;Eclipse&lt;/a&gt; already use OSGi functionality and that &lt;a href=&quot;http://www.apache.org&quot;&gt;Apache&lt;/a&gt; is releasing an OSGi R4 implementation as open source in the form of &lt;a href=&quot;http://felix.apache.org/site/index.html&quot;&gt;Felix&lt;/a&gt;. Additionally, they said that they have plans to try and push OSGi for other languages, specifically mentioning PHP and others (sorry, don&#39;t remember all the details). This could be nice to see, especially in environments where multiple languages are supported in one runtime (like with language independent VMs like &lt;a href=&quot;http://www.parrotcode.org/&quot;&gt;Parrot&lt;/a&gt;) such that Java OSGi bundles could be loaded in Perl or Ruby. This is where I&#39;d mention the CLR if I were a Windows guy.
&lt;/p&gt;
&lt;p&gt;
Who knows if OSGi will gain the kind of traction they&#39;re hoping for, but it does have some major players involved including Eclipse, Apache, BEA, IBM, Interface21 (Spring guys), SAP AG, and many others. Either way, the ideas behind this technology are really exciting, from an architectural point of view for obvious reasons.
&lt;/p&gt;
&lt;p&gt;
As an aside, it&#39;s worth considering the rather yucky learning curve to understanding how these bundles are wired together. With systems such as OSGi (or anything like it), it can easily become a debugging nightmare and a maze of abstraction. I&#39;d be remiss if I didn&#39;t at least make mention of this aspect. You need smart tools, smart people, and a &lt;span style=&quot;font-weight:bold;&quot;&gt;very&lt;/span&gt; clear understanding of this kind of technology before deciding to go down this road. Here&#39;s to hoping these guys do it right (and keep it as open source)!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/2803518027566834787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/2803518027566834787' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2803518027566834787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/2803518027566834787'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2007/10/osgi-experience.html' title='An OSGi Experience'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6846321098245171072.post-999912948881089145</id><published>2007-10-09T23:37:00.000-04:00</published><updated>2007-10-10T00:55:56.527-04:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="design patterns"/><category scheme="http://www.blogger.com/atom/ns#" term="methodology"/><category scheme="http://www.blogger.com/atom/ns#" term="programming"/><title type='text'>Strategy and Decorator - A comparison (Part 2)</title><content type='html'>&lt;p&gt;
In my &lt;a href=&quot;http://esammer.blogspot.com/2007/10/strategy-and-decorator-comparison-part.html&quot;&gt;last entry&lt;/a&gt;, I talked a bit about the &lt;a href=&quot;http://en.wikipedia.org/wiki/Decorator_Pattern&quot;&gt;Decorator&lt;/a&gt; design pattern and how one can use it to extend the functionality of a class. In part two of my look at the Decorator and Strategy design patterns, I&#39;ll take a similar look at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Strategy_pattern&quot;&gt;Strategy&lt;/a&gt; pattern. (Go figure.)
&lt;/p&gt;
&lt;p&gt;
The Strategy pattern, like Decorator, lets one vary part of a class&#39;s functionality dynamically, but in a different way (and for a different purpose). The goal with Strategy is to define an interface for a family of algorithms and allow them to be dynamically substituted. It does this in a very similar way as Decorator, at some level, in that all strategy implementations must conform to an interface that is known to the caller. The important difference is that rather than one object wrapping another up, from a structural point of view, the caller (sometimes called the Context as it is in the Wikipedia article), delegates a single method (usually) to the concrete strategy implementation. That&#39;s probably a bad explanation. Let&#39;s look at an example.
&lt;/p&gt;

&lt;pre&gt;
public interface SortStrategy {
  public String[] sort(String[] items);
}

public class QuickSortStrategy implements SortStrategy {
  public String[] sort(String[] items) {
    // ...
  }
}

public class MyApplication {
  private SortStrategy sortStrategy;

  public void main(String[] args) {
    MyApplication app = new MyApplication();

    app.setSortStrategy(new QuickSortStrategy());

    app.arrayPrinter(&quot;Sorted args: &quot; + app.sort(args));
  }

  // Getters, setters, arrayPrinter(), etc...
}
&lt;/pre&gt;

&lt;p&gt;
Of course, it&#39;s not very interesting when we have just one concrete strategy implementation like in our example, but you can easily see how you can pick a class based on external information. I use sorting as an example because it&#39;s dead simple to understand why one would want to vary the algorithm based on the data.
&lt;/p&gt;
&lt;p&gt;
What&#39;s really interesting about this is when we start combining a pattern like Strategy with, for instance, generics. Now, you have a situation where you can vary algorithms &lt;span style=&quot;font-style:italic;&quot;&gt;and&lt;/span&gt; types; that&#39;s reusability.
&lt;/p&gt;
&lt;p&gt;
When people talk about Strategy, then tend to talk about vary &lt;q&gt;an algorithm,&lt;/q&gt; but it&#39;s also interesting to consider things that aren&#39;t necessarily algorithms. For instance, Strategy is an option when talking about varying serialization methods, network transports, and so forth. If there is a case where you want to vary part of an object&#39;s behavior at runtime, but not necessarily all of it (or can&#39;t because of other inheritance requirements), Strategy can really bail you out. In short, you&#39;re delegating some behavior to a dynamically selected class that is guaranteed to conform to a known interface for implementing said behavior; that&#39;s Strategy.
&lt;/p&gt;
&lt;p&gt;
While this hasn&#39;t been a direct A / B comparison of Decorator and Strategy, hopefully a better understanding of these two patterns will help you as it has me.
&lt;/p&gt;
&lt;p style=&quot;font-size: 80%;&quot;&gt;
As always, comments are very welcome!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://esammer.blogspot.com/feeds/999912948881089145/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/6846321098245171072/999912948881089145' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/999912948881089145'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6846321098245171072/posts/default/999912948881089145'/><link rel='alternate' type='text/html' href='http://esammer.blogspot.com/2007/10/strategy-and-decorator-comparison-part_09.html' title='Strategy and Decorator - A comparison (Part 2)'/><author><name>E. Sammer</name><uri>http://www.blogger.com/profile/01099836951897026435</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>