<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="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" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-12825838</atom:id><lastBuildDate>Thu, 24 Oct 2024 18:36:53 +0000</lastBuildDate><category>CI</category><category>development</category><category>java</category><category>maven</category><category>elisp</category><category>emacs</category><category>lisp</category><category>programming</category><title>The Coder&#39;s Cabal</title><description>&lt;p&gt;&#xa;My blog about technology, tools, and this coder&amp;#39;s experiences out in the wild ;&amp;#39;&amp;gt;&#xa;&lt;/p&gt;&#xa;&lt;br&gt;&#xa;&lt;p&gt;&#xa;&lt;b&gt;&amp;quot;You never, ever, know enough&amp;quot;&lt;/b&gt; - &lt;i&gt;Jake&lt;/i&gt;&#xa;&lt;/p&gt;</description><link>http://coderscabal.blogspot.com/</link><managingEditor>noreply@blogger.com (Jake)</managingEditor><generator>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-2528819809943954527</guid><pubDate>Fri, 08 Mar 2013 20:27:00 +0000</pubDate><atom:updated>2013-03-08T15:27:40.057-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">elisp</category><category domain="http://www.blogger.com/atom/ns#">emacs</category><category domain="http://www.blogger.com/atom/ns#">lisp</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>Emacs Calendar Extension - Infromation Unity</title><description>Well, I&#39;ve been away for a while. Honestly, I find it hard to make time to post - but I swear, I&#39;m going to make more of an effort because I&#39;m actually working on some &lt;i&gt;ver&lt;/i&gt;y exciting&lt;i&gt;&amp;nbsp;&lt;/i&gt;stuff.&lt;br /&gt;
&lt;br /&gt;
I&#39;ll put off the super exciting stuff for a bit, but did want to post something exciting - to me at least...&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQz9VAPKJ9PIyXZOWcwFWFQbMxYIo571hobRaz8DceFkyf1MQvcLA&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQz9VAPKJ9PIyXZOWcwFWFQbMxYIo571hobRaz8DceFkyf1MQvcLA&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
As a preface, I&#39;ve been getting into pretty heavy use of &lt;a href=&quot;http://en.wikipedia.org/wiki/Emacs&quot;&gt;Emacs&lt;/a&gt; over the last few months. To the extent that I&#39;m on a mission to use it for as a replacement for as many apps as possible. If you are aware of Emacs and the multitudes of extensions then you know just how powerful it can be. To the point that my desires of an Emacs-only desktop are not outside the realm of possibility - but I&#39;ll get into that in some later posts.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQ0_5zlwrembd8K47YpabsxyeIacY3WAojLVDY6Mnkfv8JEB7JYnA&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQ0_5zlwrembd8K47YpabsxyeIacY3WAojLVDY6Mnkfv8JEB7JYnA&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
So one of the things I &lt;i style=&quot;font-weight: bold;&quot;&gt;hate&lt;/i&gt;&amp;nbsp;in life is repeating myself - specifically in the realm of information. Having to put to-do items into multiple devices, multiple contacts apps, multiple calendar apps, etc.&lt;br /&gt;
&lt;br /&gt;
Emacs contains its own calendering functionality that is really full featured. I ran into my pet peeve, however, very shortly into its use. I refuse to put my reminders, to-dos, birthdays, etc into multiple applications. I want everything to be available instantly on my PC, my iOS devices, and my Android devices - natively, meaning not from a website - I want them built-in.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRp62Sx03gq4G1rXpQ8xbOoSCJfzMTVpoZ4o5JBS2o8W0SkiD7d&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRp62Sx03gq4G1rXpQ8xbOoSCJfzMTVpoZ4o5JBS2o8W0SkiD7d&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
As some background, we all know (at least folks familiar with Emacs), the editor in question is extremely customizable in that everything it does - and everything it can do - is based on a variant of Lisp, aptly entitled &lt;a href=&quot;http://en.wikipedia.org/wiki/Emacs_Lisp&quot;&gt;ELisp&lt;/a&gt;&amp;nbsp;(Emacs Lisp, of course). ELisp is built on top of &lt;a href=&quot;http://en.wikipedia.org/wiki/Common_lisp&quot;&gt;Common Lisp&lt;/a&gt;, mostly adding helper functions and functions for interactivity.&lt;br /&gt;
&lt;br /&gt;
Understanding this, and desperately wanting to achieve my goal of information unity, I decided to add Lisp and ELisp to my programming repertoire. It was tough sledding at first with all those weird names for things - s-exp, form, lambda, car, cdr, cons - but the light went on and I finally got past the tutorial stage and into some actual useful programming.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsSEjPTxJPLZiihYGFpNvObjDvKqXw1Lmel4-Ne4qf6iQ1J-CpI89id2vVBEYwZYQSk_kNJ8r1cBnKz9UiuxPXew0jj06ozLWQJ1DrXkFKEiObr4M4KFxLN1YaLUMmtygsoCel7g/s1600/lisp.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;177&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsSEjPTxJPLZiihYGFpNvObjDvKqXw1Lmel4-Ne4qf6iQ1J-CpI89id2vVBEYwZYQSk_kNJ8r1cBnKz9UiuxPXew0jj06ozLWQJ1DrXkFKEiObr4M4KFxLN1YaLUMmtygsoCel7g/s400/lisp.PNG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
I went about my dream of making this thing happen. Luckily for me, the calendar application within Emacs knows how to handle &lt;a href=&quot;http://en.wikipedia.org/wiki/ICalendar&quot;&gt;iCalendar&lt;/a&gt; file formats and is able to import them. Even more lucky for me is that the network access code is built-in as well - which solved a major piece of what I&#39;m trying to implement. I really just have to automate this import from the &quot;source of record&quot; and do some processing to get it to the way I wanted it to work. The pieces I&#39;m talking about are:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Use Google Calendar as my central calendaring application - every other device can leech the data from here - the source of record.&lt;/li&gt;
&lt;li&gt;Export my Google Calendars (I have multiple) in the iCalendar format.&lt;/li&gt;
&lt;li&gt;Import these exported sources into Emacs&lt;/li&gt;
&lt;li&gt;Solve any issues that arise (automation, de-duplication, fromatting, etc.)&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7eRznTtg5kIwCAUY22olAyylrvZKqkOKqBL2J1khxD0mM_7tDXQ&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR7eRznTtg5kIwCAUY22olAyylrvZKqkOKqBL2J1khxD0mM_7tDXQ&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My first item is solved - I already use Google Calendar fro everything (well, except for work - I&#39;m digging into that, now) - so I&#39;m in good shape there. As long as I put in good repeating events and descriptive entries I should be good.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My second item is also solved for me - Google will provide a link to your private calender &lt;i&gt;in iCalendar format. &lt;/i&gt;Sweet, that means I don&#39;t have to use a third-party tool to pre-process a proprietary format or rely upon an API to get the data. Whew!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My third item is handled in a very brute force manner by Emacs Calendar. Basically, you tell it to import a file and it does - just that and only that. Item already exists in your Emacs calendar? Too bad - it&#39;s duplicated. You like a special format? Too bad - it imports the defaults. As you can see, there will be some work to do there, which is where my newly learned language comes into play.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
My fourth item meshes with fixing the issues of the third - I need to clean up what Emacs Calendar imports, format items, and de-duplicate among a few other things..&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Awesome - time to put my newly acquired Lisp knowledge to use!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Oops! This post is getting a little lengthy - I guess you&#39;ll need to read the follow up post to see how I go about actually solving my issues.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Until then - you never, &lt;i&gt;ever&lt;/i&gt;, know enough!&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</description><link>http://coderscabal.blogspot.com/2013/03/emacs-calendar-extension-infromation.html</link><author>noreply@blogger.com (Jake)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsSEjPTxJPLZiihYGFpNvObjDvKqXw1Lmel4-Ne4qf6iQ1J-CpI89id2vVBEYwZYQSk_kNJ8r1cBnKz9UiuxPXew0jj06ozLWQJ1DrXkFKEiObr4M4KFxLN1YaLUMmtygsoCel7g/s72-c/lisp.PNG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-2590489574146533309</guid><pubDate>Tue, 14 Jun 2011 19:50:00 +0000</pubDate><atom:updated>2011-06-14T15:57:13.000-04:00</atom:updated><title>Great Article On Testibility and Class Design, Part II</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;This is a follow up to the previous article that I posted on class design - good read!&lt;br /&gt;
&lt;br /&gt;
As an aside, and one of the few things that I disagree with in either of  the articles, is the wrapping of collection classes within separate  classes solely for encapsulation. As much as I like single use classes, I  just don&#39;t think that encapsulating a collection in it&#39;s own class just  for access control is necessary. There are other means of achieving  this. If this happens to be a concern then more is going on with the  collection than probably should be.&lt;br /&gt;
&lt;blockquote&gt;&lt;span style=&quot;color: black; font-family: arial; font-size: small;&quot;&gt;&lt;b&gt;Making Large Classes Small &lt;br /&gt;
(In 5 Not-So-Easy Steps)&lt;/b&gt;&lt;/span&gt; &lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;    &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;In my &lt;a href=&quot;http://links.techwebnewsletters.com/ctt?kn=12&amp;amp;ms=MzY3MTM4NjcS1&amp;amp;r=MjIxNTY4NTE5MgS2&amp;amp;b=3&amp;amp;j=MTAzODUxMjE4S0&amp;amp;mt=1&amp;amp;rt=0&quot; name=&quot;drdobbs_com_architecture_and_d&quot;&gt;previous editorial&lt;/a&gt;, I discussed the benefits and other effects on code bases of using small classes, which I defined using a limit of 50-60 lines. I received many  letters on this article, most analogizing it to edicts of olden times to keep functions short enough to fit on one pane of glass. (The letters  will appear in the upcoming issue of &lt;i&gt;Dr. Dobb&#39;s Journal&lt;/i&gt;, our PDF magazine, which ships on June 19.)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;Much as I appreciate those letters, they miss a crucial point. I was not  discussing a single function, but rather an entire class, which implies  multiple functions in most cases. Coding classes as diminutive as 60  lines struck other correspondents as simply too much of a constraint and not worth the effort.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;But it&#39;s precisely the discipline that this number of lines imposes that creates the very clarity that&#39;s so  desirable in the resulting code. The belief expressed in other letters  that this discipline could not be consistently maintained suggests that  the standard techniques for keeping classes small are not as widely  known as I would have expected. (Given that the original editorial was  inspired by an extended effort to clean up a project that contains much  of my own code, I say this with all due humility.)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;Let&#39;s go over  the principal techniques. I presume in this discussion that design has  been done and it&#39;s now just a matter of writing the code. Or in the less attractive case, of maintaining code.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;&lt;b&gt;Diminish the workload. &lt;/b&gt;The first technique to apply is the single responsibility principle (SRP),  which states that classes should do only one thing. How big that one  thing is will determine in large part how big your classes are going to  be. Reduce the work of each class; then, use other classes to marshal  these smaller classes correctly.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;&lt;b&gt;Avoid primitive obsession.&lt;/b&gt; This obsession refers to the temptation to use collections in their raw form. This is definitely a code smell. If you have a linked list of  objects, that linked list should be in its own class, with a descriptive name. Expose only the methods that the other classes need. This  prevents other classes from performing operations without your knowledge on an object they don&#39;t own. The purpose of the list is also supremely  clear and this encapsulation enables you to change easily to a different data structure if the need should arise later on.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;&lt;b&gt;Reduce the number of class and instance variables.&lt;/b&gt; A profusion of instance variables is a code smell. It strongly suggests that the class is doing more than one thing. It also makes it very  difficult for subsequent developers to figure out what the class does.  Very often, some subset of the variables form a natural grouping. Group  them into a new class. And move the operations that manipulate them  directly into that class.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;&lt;b&gt;Subclass special-case logic.&lt;/b&gt; If  you have a class that includes rarely used logic, determine whether that logic can be moved to a subclass or even to another class entirely. The classic example of the benefits of object orientation is polymorphism.  Use it to handle special variants.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;&lt;b&gt;Don&#39;t repeat yourself (DRY).&lt;/b&gt; This suggestion appears pointlessly obvious. However, even coders who  are attentive to this rule will repeat code in two methods that differ  only in a single detail. In addition, they can overlook the introduction of duplicate code during maintenance. More than the other guidelines  here, which are all techniques, DRY is a discipline within a discipline.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;Taken together, these tools  get you most of the way to small classes. To see how they are implemented in real life, I suggest a book I&#39;ve mentioned  many times before, namely Martin Fowler&#39;s &lt;a href=&quot;http://links.techwebnewsletters.com/ctt?kn=37&amp;amp;ms=MzY3MTM4NjcS1&amp;amp;r=MjIxNTY4NTE5MgS2&amp;amp;b=3&amp;amp;j=MTAzODUxMjE4S0&amp;amp;mt=1&amp;amp;rt=0&quot; name=&quot;is_gd_FmIC0O_cid_nl_ddjupdate_&quot;&gt;Refactoring&lt;/a&gt;, which is essentially a cookbook of techniques for cleaning up code,  including the step-by-step process, and the illustrative code.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;Returning back to my own experience, I am finding that as I insist on this  particular discipline in my code rework, my brain is slowly developing a &quot;muscle memory&quot; and is beginning to think automatically about class  size prior to class development — and certainly during the cleanup of  existing code. Cheers!&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: black; font-family: arial; font-size: x-small;&quot;&gt;— Andrew Binstock&lt;br /&gt;
Editor in Chief&lt;br /&gt;
&lt;a href=&quot;mailto:alb@drdobbs.com&quot; name=&quot;alb_drdobbs_com&quot;&gt;alb@drdobbs.com&lt;/a&gt;&lt;br /&gt;
Twitter: &lt;a href=&quot;http://links.techwebnewsletters.com/ctt?kn=23&amp;amp;ms=MzY3MTM4NjcS1&amp;amp;r=MjIxNTY4NTE5MgS2&amp;amp;b=3&amp;amp;j=MTAzODUxMjE4S0&amp;amp;mt=1&amp;amp;rt=0&quot; name=&quot;search_twitter_com_search_q_pl&quot;&gt;platypusguy&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/pixy.gif?x-id=5aef06fc-d500-868c-81d7-9af18be5dd77&quot; /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://coderscabal.blogspot.com/2011/06/great-article-on-testibility-and-class_14.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-5011854053105625135</guid><pubDate>Tue, 07 Jun 2011 20:39:00 +0000</pubDate><atom:updated>2011-06-07T16:39:41.574-04:00</atom:updated><title>Great Article On Testibility and Class Design</title><description>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;I got this in an email update from Dr. Dobb&#39;s, but unfortunately I couldn&#39;t find it on the web site to link to, very odd. So I&#39;m reproducing it here. Not to take credit for it but to herald it. Although I don&#39;t quite agree with line counting, but the principle is sound.&lt;br/&gt;&lt;br/&gt;&lt;blockquote&gt;&lt;font size=&#39;3&#39; face=&#39;arial&#39; color=&#39;black&#39;&gt;&lt;b&gt;In Praise of Small Classes&lt;/b&gt;&lt;/font&gt; &lt;br/&gt; &lt;font size=&#39;2&#39; face=&#39;arial&#39; color=&#39;black&#39;&gt;    &lt;p&gt;If you&#39;ve been doing OO programming for a while, you&#39;ve surely run into  the seemingly endless essays on testability. This debate focuses on how  to write code to make it more amenable to automated testing. It&#39;s a vein that is particularly intriguing to exponents of test-driven development (TDD), who argue that if you write tests first, as in the orthodox  approach to TDD, your code will be inherently testable.&lt;/p&gt;&lt;p&gt;In real  life, however, this is not always how it happens. TDD developers  frequently shift to the standard code-before-tests approach when hacking away at a complex problem or one in which testability is not easily  attained. They then write tests after the fact to exercise the cod; then modify the code to increase code coverage. There are good reasons why  code can be hard to test, even for the most disciplined developers. A  simple example is testing private methods; a more complex one is  handling singletons. These are issues at the unit testing level. At  higher levels, such as UAT, a host of tools help provide testability.  Those products, however, tend to focus principally on the GUI aspect  (and startlingly few of those handle GUIs on mobile devices). In other  areas, such as document creation, there is no software that provides  automated UAT-level validation because parsing and recreating the  content of a report or output document is often an insuperable task.&lt;/p&gt;&lt;p&gt;I don&#39;t want to get off my main point, however. Which is that what makes  code untestable is frequently not anything I&#39;ve touched on so far, but  rather excessive complexity. High levels of complexity, generally  measured with the suboptimal cyclomatic complexity measure (CCR), is  what the agile folks correctly term a &quot;code smell.&quot; Intricate code  doesn&#39;t smell right. According to numerous studies, it generally  contains a higher number of defects and it&#39;s hard — sometimes impossible — to maintain. Fortunately, there are many techniques available to the  modern programmer to reduce complexity. One could argue that Martin  Fowler&#39;s masterpiece, &lt;a target=&#39;_blank&#39; name=&#39;1306bb8dfd87c749_is_gd_FmIC0O__cid_nl_ddjupdate&#39; href=&#39;http://links.techwebnewsletters.com/ctt?kn=43&amp;amp;ms=MzY2OTIwMTMS1&amp;amp;r=MjIxNTY4NTE5MgS2&amp;amp;b=0&amp;amp;j=MTAzMzQ1MDE1S0&amp;amp;mt=1&amp;amp;rt=0&#39;&gt;Refactoring&lt;/a&gt;, is almost entirely dedicated to this topic. (Michael Feathers&#39; &lt;a target=&#39;_blank&#39; name=&#39;1306bb8dfd87c749_is_gd_0vUhR8_cid_nl_ddjupdate_&#39; href=&#39;http://links.techwebnewsletters.com/ctt?kn=21&amp;amp;ms=MzY2OTIwMTMS1&amp;amp;r=MjIxNTY4NTE5MgS2&amp;amp;b=0&amp;amp;j=MTAzMzQ1MDE1S0&amp;amp;mt=1&amp;amp;rt=0&#39;&gt;Working Effectively With Legacy Code&lt;/a&gt; is the equivalent tome for the poor schlemiels who are handed a high-CCR codebase and told to fix it.)&lt;/p&gt;&lt;p&gt;My question, though, is how to avoid creating complexity in the first  place? This topic too has been richly mined by agile trainers, who offer the same basic advice: Follow the Open-Closed principle, obey the  Hollywood principle, use the full panoply of design patterns, and so on. All of this is good advice; but ultimately, it doesn&#39;t cut it. When  you&#39;re deep into a problem such as parsing text or writing business  logic for a process that calls on many feeder processes, you don&#39;t think about Liskov Substitution or the Open-Closed principle. Typically, you  write the code that works and you change it minimally once it passes the essential tests. In other words, as you&#39;re writing the code there is  little to tell you, &quot;Whoa! You&#39;re doing it wrong.&quot;&lt;/p&gt;&lt;p&gt;For that, you  need another measure, one which I&#39;ve found to be extraordinarily  effective in reducing initial complexity and greatly expanding  testability: class size. Small classes are &lt;i&gt;much&lt;/i&gt; easier to understand and to test.&lt;/p&gt;&lt;p&gt;If small size is an objective, then the immediate next question is, &quot;How  small?&quot; Jeff Bay, who contributed a brilliant essay entitled &quot;Object  Calisthenics&quot; (in the book &lt;a target=&#39;_blank&#39; name=&#39;1306bb8dfd87c749_is_gd_j7RU5z_cid_nl_ddjupdate_&#39; href=&#39;http://links.techwebnewsletters.com/ctt?kn=18&amp;amp;ms=MzY2OTIwMTMS1&amp;amp;r=MjIxNTY4NTE5MgS2&amp;amp;b=0&amp;amp;j=MTAzMzQ1MDE1S0&amp;amp;mt=1&amp;amp;rt=0&#39;&gt;The Thoughtworks Anthology&lt;/a&gt;) that touches on this topic, suggests the number should be in the 50-60 line range. Essentially, what fits on one screen.&lt;/p&gt;&lt;p&gt;Most developers, endowed as we are with the belief that our craft does not  and should not be constrained to hard numerical limits, will scoff at  this number (or at any number of lines) and will surely conjure up an  example that is irreducible to such a small size. Let them enjoy their  big classes. But I suspect they are wrong about the irreducibility.&lt;/p&gt;&lt;p&gt;I have lately been doing a complete rewrite of some major packages in a  project I contribute to. These are packages that were written in part by a contributor whose style I never got the hang of. Now that he&#39;s moved  on, I want to understand what he wrote and convert it to a development  style that looks familiar to me and is more or less consistent with the  rest of the project. Since I was dealing with lots of large classes, I  decided this would be a good time to hew closely to Bay&#39;s guideline. At  first, predictably, it felt like a silly straitjacket. But I persevered, and things began to change under my feet. Here is what was different:&lt;/p&gt;&lt;p&gt;Big classes became collections of small classes. I began to group these  classes in a natural way at the package level. My packages became a lot  &quot;bushier.&quot; I also found that I spent more time in managing the package  tree, but this grouping feels more natural. Previously, packages were  broken up at a rough level that dealt with major program components and  they were rarely more than two or three levels deep. Now, their  structure is deeper and wider and is a useful roadmap to the project.&lt;/p&gt;&lt;p&gt;Testability jumped dramatically. By breaking down complex classes into their  organic parts and then reducing those parts to the minimum number of  lines, each class did one small thing that I could test. The top level  class, which replaced its complex forebear, became a sort of main line  that simply coordinated the actions of multiple subordinate classes.  This top class generally was best tested at the UAT level, rather than  with unit tests.&lt;/p&gt;&lt;p&gt;The single-responsibility principle (SRP), which  states that each class should do only one thing, became the natural  result of the new code, rather than a maxim that needed to apply  consciously.&lt;/p&gt;&lt;p&gt;And finally, I have enjoyed an advantage foretold by  Bay in his essay: I can see the entire class in the IDE without having  to scroll. Dropping in to look at something is now quick. If I use the  IDE to search, the correct hit is easy to locate, because the package  structure leads me directly to the right class. In sum, everything is  more readable; and on a conceptual level, everything is more manageable.&lt;/p&gt;&lt;p&gt;— Andrew Binstock&lt;br/&gt;  Editor in Chief&lt;br/&gt;  &lt;a target=&#39;_blank&#39; name=&#39;1306bb8dfd87c749_alb_drdobbs_com&#39; href=&#39;mailto:alb@drdobbs.com&#39;&gt;alb@drdobbs.com&lt;/a&gt;&lt;br/&gt;&lt;/p&gt;&lt;/font&gt;&lt;blockquote&gt;Twitter: &lt;a target=&#39;_blank&#39; name=&#39;1306bb8dfd87c749_search_twitter_com_search_q_pl&#39; href=&#39;http://links.techwebnewsletters.com/ctt?kn=25&amp;amp;ms=MzY2OTIwMTMS1&amp;amp;r=MjIxNTY4NTE5MgS2&amp;amp;b=0&amp;amp;j=MTAzMzQ1MDE1S0&amp;amp;mt=1&amp;amp;rt=0&#39;&gt;platypusguy&lt;/a&gt;&lt;/blockquote&gt;&lt;font size=&#39;2&#39; face=&#39;arial&#39; color=&#39;black&#39;&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;/font&gt;&lt;/blockquote&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class=&#39;zemanta-pixie&#39;&gt;&lt;img src=&#39;http://img.zemanta.com/pixy.gif?x-id=749d854d-11d5-8db2-8441-6ed6be07f006&#39; alt=&#39;&#39; class=&#39;zemanta-pixie-img&#39;/&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://coderscabal.blogspot.com/2011/06/great-article-on-testibility-and-class.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-1074864703662078403</guid><pubDate>Sat, 04 Jun 2011 20:53:00 +0000</pubDate><atom:updated>2011-06-04T16:53:57.108-04:00</atom:updated><title>Lol - the lighter side of computers :)</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;object width=&quot;320&quot; height=&quot;266&quot; class=&quot;BLOGGER-youtube-video&quot; classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0&quot; data-thumbnail-src=&quot;http://1.gvt0.com/vi/vh3tuL_DVsE/0.jpg&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/vh3tuL_DVsE&amp;fs=1&amp;source=uds&quot; /&gt;&lt;param name=&quot;bgcolor&quot; value=&quot;#FFFFFF&quot; /&gt;&lt;embed width=&quot;320&quot; height=&quot;266&quot; src=&quot;http://www.youtube.com/v/vh3tuL_DVsE&amp;fs=1&amp;source=uds&quot; type=&quot;application/x-shockwave-flash&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;</description><link>http://coderscabal.blogspot.com/2011/06/lol-lighter-side-of-computers.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-1440436009110763749</guid><pubDate>Fri, 27 May 2011 14:59:00 +0000</pubDate><atom:updated>2011-05-27T15:35:23.785-04:00</atom:updated><title>Pains with Fuse / ServiceMix</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;Ok, so I&#39;m just starting out with ESB&#39;s - crazy I know for as long as I&#39;ve been at java development (over 10 years). To be totally honest, I was never really able to wrap my head around exactly what they can do for you - the definitions being so ambiguous that it really just sounded like a marketing ploy.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://fusesource.com/images/header_logo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left:1em; margin-right:1em&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;53&quot; width=&quot;200&quot; src=&quot;http://fusesource.com/images/header_logo.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Anyway, the light has kind of gone off for me and I decided to delve into some open source ESB stacks like ServiceMix, OpenESB, and Fuse. Needless to say there were quite a few new concepts, as well as technical hurdles, that I needed to overcome in order to get a simple test running. All in all about 3 days work. &quot;Three days!&quot;, you say to yourself, &quot;This guys gotta be a nimrod&quot;. That wasn&#39;t wholly the case (well, maybe partially). If you know how I work and digest things you&#39;d know that just getting something to work simply isn&#39;t enough. I actually like to know how things are working internally. Why does this do that, what makes that kick off, what exactly is MEP, JBI, and DSL. What&#39;s the NMR and how does it work - that kind of stuff.&lt;br /&gt;
&lt;br /&gt;
I settled on Fuse, which is really an enterprise supported edition of Servicemix, because it seemed to adhere to all the standards I wanted to follow as well as providing what appeared to be pretty decent documenation - at least as decent as open source documentation goes. I dug in, did my research on the different technologies involved and their interactions. As it turns out, the documentation was spotty and a few versions behind (gasp!) - so there I was, off and digging.&lt;br /&gt;
&lt;br /&gt;
As it turns out, they have nifty maven archetypes for just about anything that you want to create. Simple SU and SA assemblies for ServiceMix / Fuse as well as other types of artifacts. Seems pretty easy and well put together... until the above bit me. Everything is out of date - from the documentation to the archetypes, which makes them not so handy for a variety of reasons.&lt;br /&gt;
&lt;br /&gt;
Although the archetypes are moderately helpful for creating the basic project structure and the poms, they were completely useless in actually building a working project. The plugin tooling was the wrong version, the dependencies for the binding components were incorrect, and even worse - there is nowhere, and I mean nowhere - that the correct versions of all the dependencies are listed in order to fix the issue. Not outside of trial and error anyways - which is just not practical considering the sheer number of BE&#39;s and BC&#39;s that exist.&lt;br /&gt;
&lt;br /&gt;
So I did some snooping around the examples and the dark recesses of the distribution. As it turns out they did a nice job of pom inheritance in their examples. And this is what led me to a resolution. If you follow the pom inheritance change up to it&#39;s root from one of the examples you come to the master pom. In&amp;nbsp; which, and thank you so much SMX/Fuse contributers, they have a dependencyManagement section which lists &lt;i&gt;all&lt;/i&gt; of the possible dependencies for the BC&#39;s and BE&#39;s!&lt;br /&gt;
&lt;br /&gt;
Now that I figured out all the correct versions of everything the only thing left to due was to create a master pom for my purposes that included that dependencyManagement section. Why didn&#39;t I just use it as my master pom? There was way too much SMX/Fuse specific build process in it and it was just easier to strip out what I needed rather than molding my process to fit theirs.&lt;br /&gt;
&lt;br /&gt;
So there you have it - simple, huh? I&#39;m now off an building service assemblies sans issues like a champ.&lt;br /&gt;
&lt;br /&gt;
Hope this helps someone out there save a few hours of research!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;zemanta-pixie-img&quot; src=&quot;http://img.zemanta.com/pixy.gif?x-id=b5b253a8-d54e-8385-840e-8fdb551a1877&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
Well, like a champ apparently was a little premature. More issues have arisen due some xbean issues, which again, I&#39;m trying to scour the internet and figure out. Not that I can&#39;t get things to work, just that they aren&#39;t working the way &lt;i&gt;I&lt;/i&gt; want them to work...</description><link>http://coderscabal.blogspot.com/2011/05/pains-with-fuse-servicemix.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-1900306630526893806</guid><pubDate>Mon, 23 May 2011 19:36:00 +0000</pubDate><atom:updated>2011-05-23T15:36:11.126-04:00</atom:updated><title>ClassNotFoundException When Executing JUnit Test Runner In Eclipse With M2Eclipse</title><description>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;Running unit tests in Eclipse with Maven tooling can be a little tricky  as the JUnit plugin for eclipse is expecting to find all of the compiled classes under target/classes. &lt;br/&gt;&lt;br/&gt;This would be fine, except that  the JUnit plugin simple tells Eclipse to build, which invokes the Maven  builder (which is called by m2eclipse plugin of eclipse) to build, which only goes through Maven&#39;s &lt;i&gt;compile&lt;/i&gt; phase - meaning it only compiles regular source files - not &lt;b&gt;test&lt;/b&gt; files.&lt;br/&gt;&lt;br/&gt;This is kind of a miss by the folks who wrote the m2eclipse plugin as they  should have added an additional builder for Eclipse that would kick off  the compiler:testCompile goal which does compile the test files - but  alas, it&#39;s not my plugin.&lt;br/&gt;&lt;br/&gt;Anyway, for the JUnit runner to work  correctly in Eclipse we need to add an additional builder to each  project that we want to run tests. This builder will invoke maven in a  separate step of Eclipse&#39;s build process to compile the test classes  before JUnit executes.&lt;br/&gt;&lt;br/&gt;Follow these steps:&lt;br/&gt;&lt;br/&gt;&lt;ul&gt;&lt;li&gt;Select he project to configure and &lt;i&gt;alt+enter&lt;/i&gt; to open its properties.&lt;/li&gt;&lt;li&gt;Select &lt;i&gt;Builders&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Click &lt;i&gt;New&lt;/i&gt; to bring up the configuration type dialog.&lt;/li&gt;&lt;li&gt;Select &lt;i&gt;Program&lt;/i&gt; and then click &lt;i&gt;Ok&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt; &lt;br/&gt;This brings us to the launch configuration properties dialog which we need to fill out to create the launch configuration.&lt;br/&gt; &lt;br/&gt;&lt;ul&gt;&lt;li&gt;Enter &lt;i&gt;Maven Test Compiler&lt;/i&gt; for the &lt;i&gt;Name&lt;/i&gt; property&lt;/li&gt;&lt;li&gt;Location refers to the executable that you&#39;d like to run. This needs to point to your &lt;i&gt;mvn.bat&lt;/i&gt; file&lt;/li&gt;&lt;li&gt;In &lt;i&gt;Working Directory&lt;/i&gt;, click on the &lt;i&gt;Variables...&lt;/i&gt; button and select &lt;i&gt;project_loc&lt;/i&gt; and then click &lt;i&gt;Ok&lt;/i&gt;&lt;/li&gt;&lt;li&gt;Under &lt;i&gt;Arguments&lt;/i&gt; enter - wthout the qutoes - &quot;compiler:testCompile&quot;&lt;/li&gt;&lt;li&gt;Go to the &lt;i&gt;Build Options&lt;/i&gt; tab, and make sure that the check boxes under &lt;i&gt;Run the builder&lt;/i&gt; are selected for all except &lt;i&gt;During a &quot;Clean&quot;&lt;/i&gt; and then click &lt;i&gt;Ok&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt; &lt;br/&gt;This should take you back to the project&#39;s properties. You can now select &lt;i&gt;Ok&lt;/i&gt; and happily enjoy running the eclipse JUnit test runner!&lt;br/&gt;&lt;br/&gt;&lt;div class=&#39;zemanta-pixie&#39;&gt;&lt;img src=&#39;http://img.zemanta.com/pixy.gif?x-id=7c0daf85-80b8-8883-865d-1460a9ec90c2&#39; alt=&#39;&#39; class=&#39;zemanta-pixie-img&#39;/&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://coderscabal.blogspot.com/2011/05/classnotfoundexception-when-executing.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-5186230227790724243</guid><pubDate>Mon, 02 Mar 2009 16:59:00 +0000</pubDate><atom:updated>2009-03-02T11:59:28.292-05:00</atom:updated><title>Uggh - Too busy...</title><description>&lt;div xmlns=&#39;http://www.w3.org/1999/xhtml&#39;&gt;I have some many things that I want to blog about - even going so far as to write some basic drafts on the topics...&lt;br/&gt;&lt;br/&gt;I have been too busy with work and other fun things to actually get into them, though. I will try to get one of them rolling tonight before my backlog gets too overwhelming...&lt;br/&gt;&lt;br/&gt;&lt;div class=&#39;zemanta-pixie&#39;&gt;&lt;img src=&#39;http://img.zemanta.com/pixy.gif?x-id=f18fbedb-356a-405d-b44a-774609011563&#39; class=&#39;zemanta-pixie-img&#39;/&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://coderscabal.blogspot.com/2009/03/uggh-too-busy.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-8028008731032047298</guid><pubDate>Mon, 23 Feb 2009 20:05:00 +0000</pubDate><atom:updated>2009-02-23T15:15:06.003-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CI</category><category domain="http://www.blogger.com/atom/ns#">development</category><category domain="http://www.blogger.com/atom/ns#">java</category><title>Current Projects - Part II: Where the hell is that class? Or, The Jar Indexer</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;First, a little background for the developer novice:&lt;br /&gt;&lt;br /&gt;As any (Java) developer knows there are a ton of external class dependencies when you are developing an application. This is done via &quot;import&quot; statements (or fully qualified class names) in the code itself. Every language has this type of mechanism in one form or another. It&#39;s a very simple and straightforward process.&lt;br /&gt;&lt;br /&gt;Problems soon follow, however, as the compiling application needs to be able to find these resources to successfully build the software. Each language has it&#39;s own dependency packaging scheme and also a means of finding these packages. Java uses .jar files, which are really nothing more than zip files with a specific layout. These jar files need to be included on the application&#39;s &quot;classpath&quot; (a special variable that java looks to in order to find it&#39;s compile-time and run-time dependencies) in order to compile and run.&lt;br /&gt;&lt;br /&gt;Ok, now that the primer is out of the way we&#39;ll get down to the issue at hand.&lt;br /&gt;&lt;br /&gt;I actually spend a lot of my time going from project to project converting them to use the Maven build process. This entails finding and declaring every top-level dependency that is required for both test-, compile-, and run-times. Keep in mind that enterprise level applications have &lt;i&gt;dozens&lt;/i&gt; of dependencies. As you can imagine this is a daunting and very boring task.&lt;br /&gt;&lt;br /&gt;Why so daunting you ask? To be honest, it&#39;s a basic flaw of the java dependency packaging scheme. The &lt;i&gt;class&lt;/i&gt; is the basic unit of Java and it is on these is that software depends. Classes, to maintain a unique namespace, are housed in &lt;i&gt;packages &lt;/i&gt;- which is no more than a directory structure inside of the jar file itself (i.e. com.mgensystems.TestClass). All that is fine and good, but Java doesn&#39;t force any sort of standard on the naming of the jar files by what it contains. A single jar can contain any number of package and class combinations. Now you can start to see my problem - not being able to locate a jar that contains a particular package / class combination...&lt;br /&gt;&lt;br /&gt;Well, being lazy at heart, I decided to come up with a solution that would allow me to find these pesky dependencies with a lot less effort. What I wanted to do was find some way to record every jar file on the filesystem and have every package and class they contained indexed so that I could find a specific jar file when looking for a particular class. What I came up with is the very appropriately named &lt;b&gt;Jar Indexer&lt;/b&gt;. And yes - I do this a lot. Some folk would call it lazy - I call it being ingenuous and efficient :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://lucene.apache.org/images/lucene_green_300.gif&quot; style=&quot;max-width: 800px;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;The Jar Indexer is, at it&#39;s core, very simple. It utilizes an open source indexing engine from the Apache open source project called &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;ct=res&amp;amp;cd=1&amp;amp;url=http%3A%2F%2Flucene.apache.org%2Fjava%2Fdocs%2F&amp;amp;ei=WPiiSa-3EIjTnQfnxZX9DQ&amp;amp;usg=AFQjCNEqGyJwCIJYBla9RMYdyQF30L69PA&amp;amp;sig2=Tg3pQ2_iXYKMlDCPPBpx5A&quot;&gt;Lucene&lt;/a&gt;. The Lucene engine allows you to index whatever tidbits of information that you want and will provide you the means to search on it - which sounds like something that could be very handy!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src=&quot;http://commons.apache.org/images/logo.png&quot; style=&quot;max-width: 800px;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Having the most difficult part of the project done for me (thank you open source!) all that I needed to do was a) provide the engine with the information to index, and b) wrap a simple interface around the index and search functions.&lt;br /&gt;&lt;br /&gt;To accomplish Part A of the design I chose to rely upon another open source tool from the Jakarta Commons project - &lt;a href=&quot;http://commons.apache.org/io/&quot;&gt;commons-io&lt;/a&gt;. Commons-IO allows me to specify a root location and have a list of recursively scanned files returned to me based on a filter - how nice is that? I take that output and break open each jar, noting every package and class it contains. I then pass that information into Lucene to index. Of course it was a little more complicated than that (I added a caching mechanism and whatnot for speed plus some other pieces of niftiness), but that was the high level process in a nutshell.&lt;br /&gt;&lt;br /&gt;Now for Part B - a simple user interface. I again called upon the open source community and used another Jakarta Commons project- &lt;a href=&quot;http://commons.apache.org/cli/&quot;&gt;commons-cli&lt;/a&gt;. This handy API provides an easy way to create a command-line interface. You specify the arguments and it will parse them. Extremely simple but it&#39;s a tremendous time saver.&lt;br /&gt;&lt;br /&gt;Below is an example of the command-line for indexing using the Jar Indexer:&lt;br /&gt;&lt;br /&gt;&lt;small&gt;usage: JarIndexer -p paths -i path&lt;br /&gt; -i,--index-path &amp;lt;path&amp;gt;   full path to the location of the index&lt;br /&gt; -p,--jar-paths &amp;lt;paths&amp;gt;   comma separated full paths to directories&lt;br /&gt;                          containing jars to index&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;and the command-line for searching the index:&lt;br /&gt;&lt;br /&gt;&lt;small&gt;usage: JarIndexer [-q queries] [-o format] [-l repo] -i index [-f field]&lt;br /&gt; -q,--path-to-file &amp;lt;queries&amp;gt;   file containng multiple queries&lt;br /&gt; -o,--result-format &amp;lt;format&amp;gt;   set to &#39;m&#39; for maven dependency&lt;br /&gt; -l,--repo-location &amp;lt;repo&amp;gt;     the base path of the maven repository for&lt;br /&gt;                               building the dep section&lt;br /&gt; -f,--field-name &amp;lt;field&amp;gt;       sets the default field&lt;br /&gt; -i,--index-path &amp;lt;index&amp;gt;       full path to the location of the index&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When this application is run on the root of the filesystem it will index every jar / package / class on your machine and you can easily find in what jar any particular class is located... very handy indeed...&lt;br /&gt;&lt;br /&gt;You can download the Jar Indexer from sourceforge.net &lt;a href=&quot;https://sourceforge.net/projects/jarindexer/&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What&#39;s next for Jar Indexer? More information indexed, more output formats, and a fancy GUI... I&#39;ll keep you posted. Also, any ideas would be fantastic as well.&lt;br /&gt;&lt;br /&gt;I hope maybe this tool will be useful to folks. But more importantly it was the first step in my goal of automating the Maven set up for new and existing projects. Be sure to read my next blog on the Maven Source Dependency Scanner!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img src=&quot;http://img.zemanta.com/pixy.gif?x-id=7443b19c-4378-48b1-b5ef-4cd4a2388587&quot; class=&quot;zemanta-pixie-img&quot; /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://coderscabal.blogspot.com/2009/02/current-projects-part-ii-where-hell-is.html</link><author>noreply@blogger.com (Jake)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-6156366127270337693</guid><pubDate>Mon, 23 Feb 2009 18:06:00 +0000</pubDate><atom:updated>2009-02-23T15:16:28.444-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">CI</category><category domain="http://www.blogger.com/atom/ns#">development</category><category domain="http://www.blogger.com/atom/ns#">java</category><title>Current Projects - Part I: A Preface</title><description>&lt;div xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;What do I do?&lt;br /&gt;&lt;br /&gt;Well, I&#39;m a software developer / architect by trade. I&#39;ve worked for various consulting companies over the years and have worked for dozens of clients using a half dozen languages on a bevy of platforms...&lt;br /&gt;&lt;br /&gt;Now that we have that out of the way, my main focus over the last couple of years - outside of straightforward development - has been continuous integration, or more precisely the implementation of continuous integration in the enterprise.&lt;br /&gt;&lt;br /&gt;Don&#39;t know what that is? Check out the &lt;a href=&quot;http://en.wikipedia.org/wiki/Continuous_integration&quot;&gt;wikipedia &lt;/a&gt;entry for a decent overview. If you are still so extremely interested after that thrilling description - please continue reading...&lt;br /&gt;&lt;br /&gt;Nowadays I mostly work in the Java domain - so keep that in mind when I talk about the toolsets of CI. This is particularly important as the build tool of choice (at least for me and what I&#39;ve implemented for the enterprise at Nationwide Insurance) is Maven - which you can check out at the &lt;a href=&quot;http://maven.apache.com/&quot;&gt;Apache Maven&lt;/a&gt; site...&lt;br /&gt;&lt;br /&gt;Maven deals with the &quot;how&quot; of compiling a project and producing an artifact. Unlike other build tools available it is built from the ground up to handle the dependencies of a project (in this case other jar,sar, *ar files). Dependencies are the main headache in any build / deployment scenario. From simply finding out what they are and where they are located to what version of which is needed (including their transitive dependencies).&lt;br /&gt;&lt;br /&gt;It can be very nightmarish...&lt;br /&gt;&lt;br /&gt;In any case, this series will not be a Maven tutorial. The projects I&#39;ve created are for use (mainly) with Maven and I will go over the pertinents in a JIT manner (just-in-time for you non-java folk) so that you won&#39;t be completely lost :)&lt;br /&gt;&lt;br /&gt;I&#39;m just getting back into blogging - so be gentle...&lt;br /&gt;&lt;br /&gt;Next Up - The jar-indexer&lt;br /&gt;&lt;div class=&quot;zemanta-pixie&quot;&gt;&lt;img src=&quot;http://img.zemanta.com/pixy.gif?x-id=9cfc8e94-208b-4e4f-8abe-385b5099fb0d&quot; class=&quot;zemanta-pixie-img&quot; /&gt;&lt;/div&gt;&lt;/div&gt;</description><link>http://coderscabal.blogspot.com/2009/02/current-projects-part-i-preface.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-1734721951431348781</guid><pubDate>Thu, 12 Apr 2007 02:11:00 +0000</pubDate><atom:updated>2007-04-11T22:17:27.493-04:00</atom:updated><title>Yet More Development Angst</title><description>As is obvious by my previous post, I&#39;m completely disenchanted with the preachings of the patron saints of technology and their consistent gear switching on &quot;best practice&quot;, &quot;best language&quot;, &quot;best framework&quot;.&lt;br /&gt;&lt;br /&gt;Best practice is just that, what works well in practice, not theory. And theory is the domain in which they dwell. I get tired, as much as most of you do I&#39;m sure, of beating the &quot;best practice&quot; drum only to have &quot;best practice&quot; thrown to the wayside for the &quot;just get it done&quot; mentality that EVERY corporation, when put to it, adheres to.&lt;br /&gt;&lt;br /&gt;&quot;Best language&quot; and &quot;best frameworks&quot; are both very subjective terms and I realize this. I do, however, expect prophets of a particular &quot;best **/*&quot; to stick to one or maybe two for a few years before they declare the &quot;next&quot; best language or framework.&lt;br /&gt;&lt;br /&gt;Just as these same cats a few years ago were mocking client side work and declaring that everything should be done on the server side, they&#39;ve now switched gears again and declared it should be done on the client with minimal calls to the server. There will be yet another switchback in the next few years as more and more client side code becomes unmaintainable.&lt;br /&gt;&lt;br /&gt;All of the switching and technological &quot;discovery&quot; is perfectly fine and good, but if you ask yourself the simple question &quot;Has development gotten easier with the advent of all these new technologies&quot; you&#39;ll find the answer is no - emphatically. Not only is it no, it&#39;s an order of magnitude more difficult to properly design, implement, and pay for an enterprise level application than it was just 10 years ago...&lt;br /&gt;&lt;br /&gt;Users not only expect but demand the same type of functionality and responsiveness that they had 10 years ago when VB desktop apps ruled the world. And here we are, still mired in the same transport level crap we started out in...</description><link>http://coderscabal.blogspot.com/2007/04/yet-more-development-angst.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-6968245814218959539</guid><pubDate>Wed, 11 Apr 2007 20:53:00 +0000</pubDate><atom:updated>2007-04-11T17:01:26.637-04:00</atom:updated><title>Ruby Can Save The World!!!</title><description>(This is an excerpt from an email, but I felt that rant wasn&#39;t in a public enough forum)...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;*** Starting Rant ***&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&quot;Why do we continue to re-invent the (broken) wheel?&quot;&lt;br /&gt;&lt;br /&gt;The talking heads continue to keep themselves popular on the conference circuit by declaring &quot;new&quot; languages sexy. Where was Martin Fowler when I was playing around with Ruby in the late 90&#39;s? Declaring Java the next sexy language.&lt;br /&gt;&lt;br /&gt;Do I like Ruby / Groovy / ${insert cool language here} ?&lt;br /&gt;&lt;br /&gt;Sure, they&#39;re all cool.&lt;br /&gt;&lt;br /&gt;I like &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;Lua&lt;/span&gt; myself, and have had fun the &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_1&quot;&gt;perl&lt;/span&gt;, python, smalltalk, ADA, and a score of other languages in the past. But how about we stop trying to fix the symptoms of our programmatic issues by creating new languages and instead focus on the REAL problems behind them.&lt;br /&gt;&lt;br /&gt;Why does web development suck compared to the days of desktop development? First and foremost is the transport, and not far behind is the statelessness. Statelessness has been solved somewhat, but why is it that web development has been going on solid since the 90&#39;s and we still have to be concerned with this paradigm of request-response? Why hasn&#39;t this communication layer been abstracted away so that development can focus on the important aspects of the project.&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_2&quot;&gt;JSF&lt;/span&gt; and other overly complicated frameworks may help with that issue but introduce plenty of problems of their own. We&#39;re absolutely destroying the KISS principle every time we adopt the next flashy framework or language that promises easy set up and next to nothing maintenance - these always have a cost and rarely fix the problem.&lt;br /&gt;&lt;br /&gt;How do we fix this? Not with a language or a framework, but a tool. A new browser. One that is actually INTENDED to serve applications and be more than a terminal (and no, Flex, &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_3&quot;&gt;OpenLazlo&lt;/span&gt;, etc. won&#39;t suffice - those are shoehorn patches). At least that would be a great start and the best first step. Then follow that up with some other improvements to ease data access, configuration, etc...&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;*** Rant Wind Down ***&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Above all I&#39;m beginning to tire of the declarations, musings, and &quot;The Thinker&quot; &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_4&quot;&gt;posings&lt;/span&gt; of the Fowler&#39;s, &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_5&quot;&gt;Eckel&#39;s&lt;/span&gt;, and &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_6&quot;&gt;Cockburn&#39;s&lt;/span&gt; of the world. Look closely (or not so closely) and it&#39;s apparent they have their own agendas. They are paid extremely well to pontificate and then talk about their pontifications on the circuit. They are paid just as well the next year on said circuit when they refute what they had spewed just 12 months before...&lt;br /&gt;&lt;br /&gt;Not that these guys don&#39;t have valuable insight and a vast amount of experience, but they make mistakes - consistently. That&#39;s why every other year they are touting the next greatest technology... A good example was the panel of last year&#39;s &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_7&quot;&gt;NFJS&lt;/span&gt; downright berating Struts - a framework they were in love with only a year or two before.&lt;br /&gt;&lt;br /&gt;So my advice is take what they preach, decide on your own if it makes sense, and then either disregard it or tuck it away for use later. Some of the ideas bandied about simply aren&#39;t practical (pair-programming being one of them) while others are just goofy (writing a test for a class that doesn&#39;t exist just to watch the test (amazingly) fail).&lt;br /&gt;&lt;br /&gt;Let the TDD zealots and &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_8&quot;&gt;XP&lt;/span&gt; / Agile adepts begin posting!&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;*** End Rant ***&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;I apologize for this rant but I&#39;m mired in writing documentation and I have reached my boiling point and have had my fill of Magic Cure All Languages (&lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_9&quot;&gt;MCAL&lt;/span&gt; for short)...&lt;br /&gt;&lt;br /&gt;Also, feel free to take my advice above and disregard any and / or all of my musings :)</description><link>http://coderscabal.blogspot.com/2007/04/ruby-can-save-world.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-1659321952301807575</guid><pubDate>Thu, 01 Mar 2007 19:26:00 +0000</pubDate><atom:updated>2007-03-02T10:33:41.279-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">maven</category><title>Maven 2 Remote Repositories - Part II</title><description>It appears that archiva doesn&#39;t work right out of the box - at least not for it&#39;s current version. After downloading and building the project it was still throwing configuration exceptions and wouldn&#39;t deploy. So I searched around jira and &lt;a href=&quot;http://jira.codehaus.org/browse/MRM-288&quot;&gt;found a fix for the bug&lt;/a&gt;. After following the prescribed steps and creating my own basic archiva.xml in my .m2 directory it worked, at least the test did...&lt;br /&gt;&lt;br /&gt;When I continued on to deploying the standalone version to my destination server there was another issue - a NamingException. Turns out someone checked in the plexus.xml config that duplicated a datasource. I just had to go to the conf/plexus.xml file and fix it... I crossed my fingers, closed my eyes, and ran the run.sh script...&lt;br /&gt;&lt;br /&gt;It worked!&lt;br /&gt;&lt;br /&gt;Now for configuration...&lt;br /&gt;&lt;br /&gt;Follow the directions to set up your managed repositories and the repositories that they proxy. Pretty straightforward and works out of the box. The tricky part is setting up your settings.xml&lt;br /&gt;&lt;br /&gt;It appears that at this time just setting up mirrors doesn&#39;t work unto itself. Mirroring works for any non-plugin repositories. However, for each plugin repository you will need to set up pluginRepository elements in a profile. This is clunky and will hopefully get worked out as the product matures.&lt;br /&gt;&lt;br /&gt;The last tidbit that took me a while to figure out is this: Any connection to the managed archiva repository is expected to be secure - meaning it wants a userid and password. This was not abundantly clear in the documentation... You need to set up a server entry in your settings.xml for each mirror / pluginRepository that you you plan on proxying. The userid and password are those that are defined in archiva. I simply defined a &lt;span style=&quot;font-style: italic;&quot;&gt;maven-user &lt;/span&gt;user with no password and assigned to it the role of Repository Observer.&lt;br /&gt;&lt;br /&gt;Once you have these set up you are good to go!</description><link>http://coderscabal.blogspot.com/2007/03/maven-2-remote-repositories-part-ii.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-12825838.post-4597634942580333364</guid><pubDate>Thu, 01 Mar 2007 15:52:00 +0000</pubDate><atom:updated>2007-03-01T16:45:30.798-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">maven</category><title>Maven 2 Remote Repositories</title><description>In Maven 1.x the repositories were simple - there wasn&#39;t a difference between a local repository and a remote repository. The layouts were the same and there wasn&#39;t additional information in one that wasn&#39;t contained in the other. The only variant was where the repository was located.&lt;br /&gt;&lt;br /&gt;In Maven 2.x that all changed. With the addition of transitive dependencies everything got a little more complicated. I will attempt to explain...&lt;br /&gt;&lt;br /&gt;A remote repository, and local for that matter, contain a few more files. The obligatory jars are still there, as are deployed poms. The additional files come in the way of metadata and their checksums.&lt;br /&gt;&lt;br /&gt;Each artifact has  at it&#39;s root level (i.e. not by version) a maven-metadata.xml file (on the server) or multiple maven-${serverId}-metadata.xml files that contain all the releases of the artifact, as well as the latest and released versions and it&#39;s deployed timestamp (on the remote) or it&#39;s downloaded timestamp (on the local).&lt;br /&gt;&lt;br /&gt;These files are used for a couple of things. The first is to allow maven to check for updates based on time. If you have repositories in your settings.xml or POM that allow updates (daily for example) Maven will check these timestamps and compare local versus remote to determine if a download is required. The second use is that of when a dependency is declared without a version. Maven will first check the local repository and it&#39;s metadata to determine what the latest version of the artifact is and download if necessary.&lt;br /&gt;&lt;br /&gt;This poses a small problem when trying to create an enterprise remote repository that doesn&#39;t allow access to the internet at large. These metadata files need to be mantained by hand (or by an automated process) outside of the realm of Maven&#39;s dependency management.&lt;br /&gt;&lt;br /&gt;Why can&#39;t you copy a local repository to the remote? You can, but it won&#39;t work for these dynamic version checks. The problem is that the metadata files are renamed to that of the server id from where a particular version was downloaded. There can be several, depending on the artifact, so you can&#39;t just rename the file back to what Maven is expecting to find.&lt;br /&gt;&lt;br /&gt;I&#39;m checking into a couple of options. The first I&#39;ve implemented as a stopgap - a basic wget script that can download the artifact&#39;s complete directory structure. It works, but it&#39;s clunky and doesn&#39;t automatically handle transtitive dependency downloads. The second tool I&#39;m going to testdrive is &lt;a href=&quot;http://maven.apache.org/archiva/guides/getting-started/index.html&quot;&gt;Archiva&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Check back to see the results...</description><link>http://coderscabal.blogspot.com/2007/03/maven-2-remote-repositories.html</link><author>noreply@blogger.com (Jake)</author><thr:total>0</thr:total></item></channel></rss>