<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Alan Hohn</title><link>https://alanhohn.com/</link><description>Recent content on Alan Hohn</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><atom:link href="https://alanhohn.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Chapter 1</title><link>https://alanhohn.com/extras/conversational-git/chapter-01/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-01/</guid><description>Why This Book I recently had some close friends talk about their hesitation in adopting Git as opposed to continuing to work with Subversion. I&amp;rsquo;ve used Subversion for many years, and advocated for its use. I have since jumped wholeheartedly on the Git bandwagon, so I wanted to find a way to tell the story of why I made the switch and why I think so much of the open source community is now based around Git and Git-friendly sites like GitHub.</description></item><item><title>Chapter 2</title><link>https://alanhohn.com/extras/conversational-git/chapter-02/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-02/</guid><description>Setting up Git I&amp;rsquo;m not going to spend a lot of time talking about installing Git. The audience for this book is familiar with installing software and using a command line, and Git is sufficiently available on various operating systems that I&amp;rsquo;ll just assume that git --version on the command line doesn&amp;rsquo;t return command not found. I&amp;rsquo;m also going to assume UNIX syntax for other commands.
I&amp;rsquo;m also not going to talk about GUIs.</description></item><item><title>Chapter 3</title><link>https://alanhohn.com/extras/conversational-git/chapter-03/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-03/</guid><description>Multiple Repositories In Subversion, the only way we work with multiple repositories is through a mirror, which has to have exactly the same history to work correctly. Git is designed around multiple repositories; to help work on a project, you have to have not just a working copy but a &amp;ldquo;clone&amp;rdquo; of the whole repository so you can commit, push, and pull.
Like Subversion, a lot of teams using Git share a common repository located on some server.</description></item><item><title>Chapter 4</title><link>https://alanhohn.com/extras/conversational-git/chapter-04/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-04/</guid><description>Teamwork Of course, we could continue working like the previous chapter. Harry or Isabelle makes a change, pushes it, the other pulls it, and everyone is kept up to date. But in a real environment, Harry and Isabelle are going to be making changes at the same time.
Starting from the scratch directory again:
cd harry echo &amp;#34;Third content&amp;#34; &amp;gt; content03 git add . git commit -m &amp;#34;Third&amp;#34; And meanwhile&amp;hellip;</description></item><item><title>Chapter 5</title><link>https://alanhohn.com/extras/conversational-git/chapter-05/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-05/</guid><description>A Conflict This time, Harry and Isabelle both decide to add a line at the end of the same file. Starting from the scratch directory again:
cd harry echo &amp;#34;Harry&amp;#39;s line&amp;#34; &amp;gt;&amp;gt; content01 git commit -am &amp;#34;Harry&amp;#34; git push Notice that I added an a in front of the m in the git commit command. Because I&amp;rsquo;m not adding any new files, only updating modified files, and I know it&amp;rsquo;s safe to pick up all my changes in the commit, I can skip the separate git add step.</description></item><item><title>Chapter 6</title><link>https://alanhohn.com/extras/conversational-git/chapter-06/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-06/</guid><description>Yes, the chapter title puns seem to be getting worse as we go. Not really something I&amp;rsquo;m in control of.
What Are Branches For One of the things I love about Subversion compared to other systems I&amp;rsquo;ve used is how easy it is to branch. I&amp;rsquo;ve used version control systems where &amp;ldquo;branching&amp;rdquo; occurs at the item level, which isn&amp;rsquo;t really a branch at all. The way Subversion is architected internally, a branch is cheap because it&amp;rsquo;s a shallow copy of the repository state at a point in time.</description></item><item><title>Chapter 7</title><link>https://alanhohn.com/extras/conversational-git/chapter-07/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-07/</guid><description>I was under self-imposed pressure to make a chapter title pun, so of course I couldn&amp;rsquo;t think of one.
Better Feature Branches There are a couple of flaws with what we did last time with feature branches. First, one of the benefits of version control is collaboration with others, but Harry selfishly kept his branch to himself and only shared his changes when he was done. Second, while Harry could commit changes to his feature branch, it only lived in his repository, which means if his computer died, his work would be gone.</description></item><item><title>Chapter 8</title><link>https://alanhohn.com/extras/conversational-git/chapter-08/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-08/</guid><description>Feature Branches with Conflicts Straight to the Git this time.
First let&amp;rsquo;s make sure we&amp;rsquo;re clean.
cd harry git checkout master git pull cd ../isabelle git checkout master git pull Isabelle has some work to do and makes a feature branch.
git checkout -b hamlet echo &amp;#34;Nymph, in your orisons. Be all my sins remember&amp;#39;d&amp;#34; &amp;gt; spear03 git add . git commit -m &amp;#34;Hamlet and Ophelia&amp;#34; git push --set-upstream origin hamlet And meanwhile Harry is working too.</description></item><item><title>Chapter 9</title><link>https://alanhohn.com/extras/conversational-git/chapter-09/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-09/</guid><description>When It Goes Wrong When I started learning Subversion, it didn&amp;rsquo;t take long before I had to perform that familiar Google search to find out how to &amp;ldquo;undo&amp;rdquo; a commit. The general answer for Subversion is that it&amp;rsquo;s possible, but it&amp;rsquo;s far easier to just fix whatever is wrong and make a new commit.
That&amp;rsquo;s very good advice for Git as well. It&amp;rsquo;s easy to get hung up trying to find a clever Git solution.</description></item><item><title>Chapter 10</title><link>https://alanhohn.com/extras/conversational-git/chapter-10/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-10/</guid><description>What Did I Just Do? The one consistent thing about mistakes is that realization happens about 100ms too late. Whether it&amp;rsquo;s committing to the wrong branch, merging to the wrong branch, or some other problem, &amp;ldquo;messing up&amp;rdquo; your repository is the worst feeling.
The most important thing with Git is when this happens, don&amp;rsquo;t panic, and don&amp;rsquo;t push. Anything can be fixed, but it&amp;rsquo;ll be fixed a lot easier if it hasn&amp;rsquo;t been pushed yet.</description></item><item><title>Chapter 11</title><link>https://alanhohn.com/extras/conversational-git/chapter-11/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/chapter-11/</guid><description>Workflow with Git I&amp;rsquo;ve presented a lot of topics around using Git on a project. I&amp;rsquo;ve advocated for the use of feature branches. What&amp;rsquo;s left is to talk about how to get started using Git on a typical project, including both tools and workflow.
Tools I mentioned at the beginning that I wouldn&amp;rsquo;t talk about setting up shared repositories on a server, because that kind of thing is best handled in a GitHub-like tool.</description></item><item><title>About</title><link>https://alanhohn.com/extras/conversational-git/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/about/</guid><description>This book was written because I thought there weren&amp;rsquo;t enough books and webpages about Git. No, not really.
This book was written because I saw an ever-so-narrow niche for a book that introduced Git from the perspective of a person who uses it every day, but still remembers what it was like getting up to speed. I remember having questions like:
I see that there&amp;rsquo;s extra complexity with Git because of the need to synchronize different repositories.</description></item><item><title>Updates</title><link>https://alanhohn.com/extras/conversational-git/updates/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/extras/conversational-git/updates/</guid><description>Thanks to the individuals who have contributed to this book.
Version 1.0:
Initial version. Merged in fixes provided by ceilfors and gliptak. Version 1.1:
Changes to chapters 2-5 as suggested by a reader. Thanks for the detailed comments. Version 1.1a:
Also update the EPUB and MOBI versions. About | Start Reading | Table of Contents</description></item><item><title>OSGi Services: Automated Discovery and Service Lookup</title><link>https://alanhohn.com/posts/2016/osgi-service-lookup/</link><pubDate>Sat, 29 Oct 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/osgi-service-lookup/</guid><description>This articles continues a series on declarative services in OSGi. We started with a basic OSGi bundle, then discussed architecting a multi-bundle application. Then we looked closer at declarative services and how to register them. All of this is fully demonstrated in an example application on GitHub.
With the last article, we left off with a service interface, and implementation, and a few ways to tell the service registry about it.</description></item><item><title>OSGi: Declarative Services and the Registry</title><link>https://alanhohn.com/posts/2016/osgi-service/</link><pubDate>Sat, 29 Oct 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/osgi-service/</guid><description>In two previous articles, I introduced building an OSGi bundle and the architecture of a multi-bundle OSGi solution. One of the key features of that multi-bundle solution in its associated GitHub repository is the use of OSGi declarative services.
OSGi declarative services are the OSGi way to handle the instantiation problem: the fact that we want to code to interfaces, but we need some way to instantiate classes and some way to provide some concrete instance of an interface in order for the parts of our modular application to work together.</description></item><item><title>Structure of OSGi Application with Declarative Services</title><link>https://alanhohn.com/posts/2016/osgi-architecture/</link><pubDate>Thu, 27 Oct 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/osgi-architecture/</guid><description>So with our previous article and with a sample application, we made it all the way to an OSGi bundle that we can install in a Karaf container. However, so far we just build the bundle for our interfaces project, which just contains a single Java class.
And that raises an important question: in a project with only five total Java classes, why did I go to the trouble to have four separate OSGi bundles, plus a separate Maven project for the Karaf feature repository XML file?</description></item><item><title>Karaf Features and OSGi Services: A Bundle</title><link>https://alanhohn.com/posts/2016/osgi-bundle/</link><pubDate>Tue, 25 Oct 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/osgi-bundle/</guid><description>After finishing a pair of articles last week on Karaf features, I felt that I had done a poor job of explaining the context in which all of this bundling and featurizing was taking place. Instead I pretty much started in the middle, assuming the existence of OSGi bundles with proper manifests, all snug in their Maven repositories.
So I&amp;rsquo;m going to correct that and at the same time illustrate another cool OSGi technology: declarative services.</description></item><item><title>Apache Karaf Features for OSGi Deployment</title><link>https://alanhohn.com/posts/2016/karaf-features/</link><pubDate>Fri, 21 Oct 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/karaf-features/</guid><description>I&amp;rsquo;ve worked on multiple teams that have successfully used Apache Karaf as an OSGi container. In addition to the usual need to understand OSGi bundles and class resolution in the context of multiple class loaders (which deserves at least one article all by itself), Karaf adds the concept of a &amp;ldquo;feature&amp;rdquo; on top of OSGi bundles. While there is detailed documentation on features, I&amp;rsquo;ve found that they can be confusing for new users, especially when they are resolved from Maven, since there seems to be so much behind the scenes magic involved.</description></item><item><title>Karaf Features at Startup</title><link>https://alanhohn.com/posts/2016/karaf-features-boot/</link><pubDate>Fri, 21 Oct 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/karaf-features-boot/</guid><description>In a previous article I provided an introduction to how Apache Karaf uses &amp;ldquo;features&amp;rdquo; to simplify adding OSGi bundles to a container, including handling dependencies.
As discussed in that article, Karaf has its own XML format for a &amp;ldquo;feature repository&amp;rdquo;, an XML file that lists one or more features. Each feature lists features or bundles that it relies on, with support for versioning. The whole thing works because Karaf can retrieve both the feature repository XML files and the OSGi bundles from a variety of sources, including Maven.</description></item><item><title>TDD and CMM</title><link>https://alanhohn.com/posts/2016/tdd-and-cmmi/</link><pubDate>Sat, 08 Oct 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/tdd-and-cmmi/</guid><description>layout: post title: &amp;ldquo;Suggested Zone: DevOps&amp;rdquo; description: &amp;quot;&amp;quot; category: articles tags: [] TLDR: Extreme Programming appears to be at odds with traditional software engineering processes. But there are some interesting parallels.
Like over two thousand others at DZone, I recently read Grzegorz Ziemoński&amp;rsquo;s article on Test Driven Development (TDD). I always enjoy Grzegorz&amp;rsquo;s articles and appreciate his bold willingness to state opinions. I especially respect any author who takes on the challenge to write about things they&amp;rsquo;ve done wrong.</description></item><item><title>Testing REST services with pyresttest</title><link>https://alanhohn.com/posts/2016/pyresttest/</link><pubDate>Wed, 28 Sep 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/pyresttest/</guid><description>Early in my career, someone explained to me why &amp;ldquo;ping&amp;rdquo; is such a natural first test when something goes wrong with an application or service. It&amp;rsquo;s not just because it&amp;rsquo;s a basic test with a quick yes/no answer. It&amp;rsquo;s also because it bisects the standard network stack. If &amp;ldquo;ping&amp;rdquo; works, the issue is usually above the IP layer; if not, the issue is usually below (firewalls being the exception).
Similarly, when I recently spent some time creating a &amp;ldquo;smoke test&amp;rdquo; for an application deployment, I wanted something that would check if the application was up and running, without checking any complex behavior.</description></item><item><title>Language Flavors</title><link>https://alanhohn.com/posts/2016/language-flavor/</link><pubDate>Tue, 27 Sep 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/language-flavor/</guid><description>It might be having a child in Spanish this year, or maybe it&amp;rsquo;s the fact that I&amp;rsquo;ve been switching from Java to Ruby to Go to Python over the past couple months, but I&amp;rsquo;ve been giving some thought to how different languages are &amp;ldquo;flavored&amp;rdquo;. One of my favorite things about the Go programming language is that the second thing you read while learning it is a whole book on &amp;ldquo;writing clear, idiomatic Go code&amp;rdquo;.</description></item><item><title>Managing Puppet Certificates for Vagrant VMs</title><link>https://alanhohn.com/posts/2016/puppet-certs-vagrant/</link><pubDate>Sun, 25 Sep 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/puppet-certs-vagrant/</guid><description>Vagrant has built-in support for running Puppet in either &amp;ldquo;apply&amp;rdquo; mode, where the Puppet manifests and modules are provided from the host running Vagrant, or in &amp;ldquo;server&amp;rdquo; mode, where Puppet on the VM connects to some shared Puppet server. The latter choice has the advantage of requiring less setup for new users and of being closer to a typical production environment.
However, there is one major issue with using Puppet this way.</description></item><item><title>Architecture Is About Tradeoffs</title><link>https://alanhohn.com/posts/2016/tradeoffs/</link><pubDate>Wed, 07 Sep 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/tradeoffs/</guid><description>I just finished reading an interesting article here on DZone about the benefits of Java EE in contrast to microservices. In my opinion, it&amp;rsquo;s always salutary to see an argument like this that goes against the prevailing trend, because it helps us to remember that one of the most important rules of architecture is the one defined by Robert Heinlein: There Ain&amp;rsquo;t No Such Thing as a Free Lunch (TANSTAAFL).</description></item><item><title>The Problem With Software</title><link>https://alanhohn.com/posts/2016/the-problem-with-software/</link><pubDate>Wed, 07 Sep 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/the-problem-with-software/</guid><description>I was reading Martin Fowler&amp;rsquo;s well-known paper on architecture as a result of the reading and thinking I&amp;rsquo;ve been doing about the work of an architect (as exemplified in a few recent articles).
I very much like the idea of thinking about architecture as &amp;ldquo;things which are hard to change&amp;rdquo;. As he points out, in software there is no particular reason why anything should be hard to change. For anything we can think of: interfaces, database schema, even programming language, someone has come up with a scheme to make it easy to change.</description></item><item><title>Mockito Basic Example Using JDBC</title><link>https://alanhohn.com/posts/2016/mockito-part-1/</link><pubDate>Mon, 05 Sep 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/mockito-part-1/</guid><description>It&amp;rsquo;s been a while since I did a lot of work with Mockito, but I like to cover it when I teach unit testing for a couple reasons. First, it encourages students to think about writing for testability by showing what kinds of designs are easy to test and what kinds are very challenging. I believe this encourages more modular code. Second, it encourages students to write smaller, more focused unit tests.</description></item><item><title>Mockito Custom Answers</title><link>https://alanhohn.com/posts/2016/mockito-custom-answer/</link><pubDate>Mon, 05 Sep 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/mockito-custom-answer/</guid><description>In a previous article I introduced using Mockito to mock a database by mocking all the classes involved in the JDBC API. However, that simple example didn&amp;rsquo;t include any complex cases, like wanting the mocks to respond differently to different kinds of inputs.
Argument Matchers Mockito argument matchers are very powerful. We saw a simple example in the last article:
when(rs.getString(2)).thenReturn(p.getFirstName()); This creates a rule in the mock object that is only invoked when the getString() method is called with an argument of 2.</description></item><item><title>Process Improvement and Innovation</title><link>https://alanhohn.com/posts/2016/process-improvement-and-innovation/</link><pubDate>Mon, 29 Aug 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/process-improvement-and-innovation/</guid><description>Recently I wrote several articles on The Case for Lean. In that context I was writing about lean agile methods, specifically a class of agile methods that do not include &amp;ldquo;sprints&amp;rdquo; but instead use a continuous flow system with limits on work-in-progress. In those articles I tried to show why you might choose continuous flow over sprints to fit certain situations. By contrast, you might call this article &amp;ldquo;The Limits of Lean&amp;rdquo;, since I intend to write about something that can get overlooked when using lean techniques.</description></item><item><title>DevOps In Any Business</title><link>https://alanhohn.com/posts/2016/devops-any-business/</link><pubDate>Sun, 28 Aug 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/devops-any-business/</guid><description>Much of my time over the past couple years has been spent working with DevOps tools such as Ansible, Puppet, Vagrant, and Packer, rather than the traditional programming I did previously. Since I work in the defense industry, there are some unique challenges applying these tools and DevOps techniques. I had a recent conversation with a colleague about these challenges and whether it DevOps is worthwhile in our business. Of course, I think it is, and I tried to explain some of the reasoning.</description></item><item><title>Apache Camel Content Enricher Example</title><link>https://alanhohn.com/posts/2016/camel-enricher-2/</link><pubDate>Wed, 24 Aug 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/camel-enricher-2/</guid><description>In a previous article I discussed why Apache Camel is a useful tool for building small modules to perform integration independent of any of the pieces being integrated. With that out of the way I can go straight into showing an example of using Apache Camel&amp;rsquo;s content enricher.
The basic flow of our Camel route is to listen for data to come in via a publish-subscribe messaging destination and send it back out in a format that another consumer is expecting.</description></item><item><title>Apache Camel: Content Enricher Foibles</title><link>https://alanhohn.com/posts/2016/camel-enricher-3/</link><pubDate>Wed, 24 Aug 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/camel-enricher-3/</guid><description>This is the third of three articles on using Apache Camel with its content enricher to handle transforming data on its way between two applications. The first article discussed Camel and its positive attributes; the second provided an example of using content enricher a straightforward way.
To recap, Apache Camel provides a wealth of components and processors to interact with applications and services in all kinds of ways, including publish-subscribe messaging, REST, SOAP, file transfers, email, and many more.</description></item><item><title>Apache Camel Content Enricher</title><link>https://alanhohn.com/posts/2016/camel-enricher-1/</link><pubDate>Tue, 23 Aug 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/camel-enricher-1/</guid><description>A colleague and I were working through using Camel as an event-driven data router. Part of the work the router had to do was fetch additional information from a REST web service. This was a natural fit for Camel&amp;rsquo;s content enricher, but we had to work through a few bumps along the way, so it was a great learning experience.
Apache Camel Let me start first with a brief discussion of Camel and the content enricher pattern.</description></item><item><title>Language Features and Culture</title><link>https://alanhohn.com/posts/2016/language-features-and-culture/</link><pubDate>Tue, 16 Aug 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/language-features-and-culture/</guid><description>I was reading an interesting article on DZone recently that pointed out how many different programming languages have a rich community producing modules that are available for reuse. In some cases this community is not strictly affiliated with the creators of the language itself.
It&amp;rsquo;s instructive to see just how many examples there are out there. This is just a few that popped into my head without thinking hard.
Perl has the Comprehensive Perl Archive Network (CPAN).</description></item><item><title>Go Archive Support</title><link>https://alanhohn.com/posts/2016/go-archive/</link><pubDate>Sun, 31 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/go-archive/</guid><description>I happened to be working on a REST microservice recently, and ended up implementing it in the Go programming language. I was pleased by the experience, especially when it came to integrating the HTTP support with handling of zip archives.
One of the functions of the microservice is to accept files in ZIP format and to process the files it finds inside. I wanted to find a way to avoid generating a lot of temporary files on disk, since once the service was done with the uploaded file it didn&amp;rsquo;t need to hang onto it any longer.</description></item><item><title>Simplicity: One Concept</title><link>https://alanhohn.com/posts/2016/simplicity-one-concept/</link><pubDate>Sun, 31 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/simplicity-one-concept/</guid><description>Suggested Zone: Agile
TLDR: For a system to survive long-term incremental development, it helps to have one concept that stays true.
I&amp;rsquo;ve been thinking and writing about simplicity in architecture and design as a result of reading Niklaus Wirth&amp;rsquo;s article on programming languages. The first article was about how arguments over design can result from having multiple kinds of simplicity, while the second was about the need for architects to communicate using one diagram.</description></item><item><title>Beyond Beginning Git: Bundle and Retrospective Branching</title><link>https://alanhohn.com/posts/2016/git-bundle-and-retro-branch/</link><pubDate>Fri, 29 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/git-bundle-and-retro-branch/</guid><description>Zone: Agile
TLDR: Useful Git fixes for special circumstances.
In a couple previous articles, I talk about features that go beyond the first steps in Git. In the first I discussed the working tree, index, and HEAD. In the second I discussed exclude and interactive add.
Recently a couple other features became useful to me: bundle and retrospective branching. As always, I will discuss the &amp;ldquo;why&amp;rdquo; of the feature and how it should be used but much more information is available in places like this one.</description></item><item><title>Two Kinds of Simplicity</title><link>https://alanhohn.com/posts/2016/two-kinds-of-simplicity/</link><pubDate>Tue, 26 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/two-kinds-of-simplicity/</guid><description>Suggested Zone: Java
TLDR: Why do we argue so much about which way is simpler?
I was reading Niklaus Wirth&amp;rsquo;s On the Design of Programming Languages and was struck by his discussion of simplicity. It appeared to me to apply to a number of concepts in architecture and design beyond just programming languages, and even to explain why we so often disagree about design choices.
One of the key insights of his paper is that there are multiple kinds of simplicity.</description></item><item><title>In Search of Simplicity: One Diagram</title><link>https://alanhohn.com/posts/2016/simplicity-one-diagram/</link><pubDate>Mon, 25 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/simplicity-one-diagram/</guid><description>I was reading Niklaus Wirth&amp;rsquo;s On the Design of Programming Languages and was struck by his discussion of simplicity. It appeared to me to apply to a number of concepts in architecture and design beyond just programming languages, and even to explain why we so often disagree about design choices.
To start, I want to write about a principle I think is very important for architects and one that has been helpful for me in architecting large systems.</description></item><item><title>Inside VRRP: Applications</title><link>https://alanhohn.com/posts/2016/inside-vrrp-applications/</link><pubDate>Mon, 25 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/inside-vrrp-applications/</guid><description>Suggested Zone: Cloud
TLDR: Despite the name, VRRP isn&amp;rsquo;t just for router redundancy.
Over the past few articles, I&amp;rsquo;ve been showing the details of the Virtual Router Redundancy Protocol (VRRP). In the first article I introduced the technologies. In the second I showed a virtual lab using Vagrant, while in the [third3 I showed packet captures to reveal the details behind how it works.
This time I want to discuss real-world applications.</description></item><item><title>Inside VRRP: Packet Captures</title><link>https://alanhohn.com/posts/2016/inside-vrrp-capture/</link><pubDate>Sun, 17 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/inside-vrrp-capture/</guid><description>The Virtual Router Redundancy Protocol (VRRP) provides a way for multiple hosts to communicate so that one of them at a time can hold a virtual IP. Since VRRP is useful for high availability and operates at the intersection of Layer 2 and Layer 3 of the OSI model, it&amp;rsquo;s an interesting topic for a better understanding of networking.
In the first article I introduced VRRP and ARP, which is essential to its operation.</description></item><item><title>VRRP Virtual Lab with Ubuntu Xenial and Vagrant</title><link>https://alanhohn.com/posts/2016/inside-vrrp-lab/</link><pubDate>Sun, 17 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/inside-vrrp-lab/</guid><description>The Virtual Router Redundancy Protocol (VRRP) provides a way for multiple hosts to communicate so that one of them at a time can hold a virtual IP. Since VRRP is useful for high availability and operates at the intersection of Layer 2 and Layer 3 of the OSI model, it&amp;rsquo;s an interesting topic for a better understanding of networking.
Last time I introduced VRRP, then spent some time on the Address Resolution Protocol (ARP), which is used to locate the Ethernet address for a given IP address.</description></item><item><title>Inside VRRP: Introduction</title><link>https://alanhohn.com/posts/2016/inside-vrrp-intro/</link><pubDate>Sat, 16 Jul 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/inside-vrrp-intro/</guid><description>The Virtual Router Redundancy Protocol (VRRP) is a useful approach to provide failover at the network level on a subnet. I thought it might be interesting to see the details at the individual packet and frame level, so I put together a set of virtual machines for the purpose. On the way there were some other interesting challenges, so I&amp;rsquo;ll spend a little time writing about those as well.
To start, I&amp;rsquo;d like to introduce the technologies to show their purpose.</description></item><item><title>The Case for Lean: Capturing Business Work</title><link>https://alanhohn.com/posts/2016/case-for-lean-5/</link><pubDate>Mon, 27 Jun 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/case-for-lean-5/</guid><description>I&amp;rsquo;ve found myself advocating for Kanban methodologies as I&amp;rsquo;ve advised agile teams, and I&amp;rsquo;m working through my reasoning in the hopes of understanding it better myself. In the first article I talked about program oversight, in the second I talked about team dynamics, in the third I talked about principals and agents, and in the fourth I talked about presenting status.
Working for a large, project based organization, I&amp;rsquo;ve done a bit of work on proposals and estimation, including estimation under both traditional and agile methodologies.</description></item><item><title>The Case for Lean: Oversight</title><link>https://alanhohn.com/posts/2016/case-for-lean-1/</link><pubDate>Mon, 27 Jun 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/case-for-lean-1/</guid><description>As I&amp;rsquo;ve advised a few teams this year who are making the switch to agile, I&amp;rsquo;ve found myself advocating more and more heavily for Kanban or &amp;ldquo;continuous flow&amp;rdquo; styles. I thought I&amp;rsquo;d take some time and write down what I think are the reasons I&amp;rsquo;m moving in that direction. Of course, Kanban is a frequent topic on DZone. I won&amp;rsquo;t waste your time by describing it, but hopefully I can find a fresh insight or two, or at least say something stupid enough to make people want to comment.</description></item><item><title>The Case for Lean: Presenting Status</title><link>https://alanhohn.com/posts/2016/case-for-lean-4/</link><pubDate>Mon, 27 Jun 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/case-for-lean-4/</guid><description>I&amp;rsquo;ve found myself advocating for Kanban methodologies as I&amp;rsquo;ve advised agile teams, and I&amp;rsquo;m working through my reasoning in the hopes of understanding it better myself. In the first article I talked about program oversight, in the second I talked about team dynamics, and in the third I talked about principals and agents.
This time I want to talk about presenting status to management. I recognize I just lost half of what audience I hadn&amp;rsquo;t already chased away, but I just could not come up with a way to make that sound more interesting.</description></item><item><title>The Case for Lean: Team Dynamics</title><link>https://alanhohn.com/posts/2016/case-for-lean-2/</link><pubDate>Mon, 27 Jun 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/case-for-lean-2/</guid><description>Since I&amp;rsquo;ve found myself advocating for Kanban more often as I&amp;rsquo;ve advised teams on agile, I decided to write down some of my reasoning. I started by discussing how sprints can become counter-productive in the context of program oversight. This time I want to talk about the dynamics within an agile team, and how some kinds of teams thrive on the flexibility that comes from a lean agile approach.
Hopefully everyone has had the experience of working on a really good team.</description></item><item><title>The Case for Lean: The Principal Agent Problem</title><link>https://alanhohn.com/posts/2016/case-for-lean-3/</link><pubDate>Mon, 27 Jun 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/case-for-lean-3/</guid><description>I&amp;rsquo;ve found myself advocating for Kanban methodologies as I&amp;rsquo;ve advised agile teams, and I&amp;rsquo;m working through my reasoning in the hopes of understanding it better myself. In the first article I talked about program oversight, and in the second I talked about team dynamics. This time I&amp;rsquo;m admitting to the fact that I went to business school as I talk about the principal agent problem.
At the University of Minnesota Carlson School of Management (Ski U Mah), I had a professor who wrote a book on franchising.</description></item><item><title>Agile on a Fixed Scope Contract</title><link>https://alanhohn.com/posts/2016/fixed-scope-agile/</link><pubDate>Sun, 22 May 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/fixed-scope-agile/</guid><description>I spent a recent week working with a program that is starting up some work using an agile methodology, but has a mixed team, both in terms of time on the program and time with agile. So it was an interesting week, because I picked up a bunch of new ideas from people with experiences different from mine. It also means I&amp;rsquo;ve done a lot of thinking about agile, which hopefully will result in a few interesting thoughts to write down.</description></item><item><title>Alpine Linux Desktop</title><link>https://alanhohn.com/posts/2016/alpine-laptop/</link><pubDate>Fri, 20 May 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/alpine-laptop/</guid><description>I recently resurrected an older but relatively small laptop to use in cattle class on an airplane, where a full size laptop is eternally in danger of being crushed by the seat in front. Unfortunately, the laptop was running Windows Vista, a curse inflicted on many laptops of its era, when Microsoft went through one of its phases of pretending that people seek deeper meaning from an operating system as opposed to just hoping it will keep running and not break their applications.</description></item><item><title>Dynamic Programming: Branch and Bound</title><link>https://alanhohn.com/posts/2016/branch-and-bound/</link><pubDate>Mon, 16 May 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/branch-and-bound/</guid><description>Reducing Unhappiness Imagine yourself in the role of a city planner. Your job is to find a place for some new undesirable thing, like an electrical substation (potential eyesore) or a treatment plant (potential nosesore, if that were a word). You want to choose a site that will irritate the smallest number of people, because irritated people tend to show up at city council meetings, and that makes the people you work for irritated with you.</description></item><item><title>Priority (Story) Boarding</title><link>https://alanhohn.com/posts/2016/prioritization/</link><pubDate>Mon, 16 May 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/prioritization/</guid><description>I was thinking over the weekend about how to present certain aspects of agile to non-technical people. One aspect of agile that is particularly difficult to get across is the idea of accepting change. It feels wrong, at least in an industry like the defense industry, with carefully negotiated contracts and a history of cost overrun, to say that agile prefers accepting change over following a plan.
At the same time, I firmly believe that agile, much of the time, reflects the way we really do engineering when we do it right.</description></item><item><title>Design Patterns Are Accidental</title><link>https://alanhohn.com/posts/2016/design-patterns-accidental/</link><pubDate>Sat, 30 Apr 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/design-patterns-accidental/</guid><description>Henrik Warne&amp;rsquo;s list of programming quotes was recently published on DZone. One great quote was from Fred Brooks, longtime head of Computer Science at the University of North Carolina, just around the corner from DZone itself. The quote was: &amp;ldquo;Much of the essence of building a program is in fact the debugging of the specification.&amp;rdquo;
&amp;ldquo;Essence&amp;rdquo; is a word we use every day to mean &amp;ldquo;the heart&amp;rdquo; or &amp;ldquo;the center&amp;rdquo; of something, but as he explains in &amp;ldquo;No Silver Bullet&amp;rdquo;, the essay from which this quote comes, Brooks himself uses that term in the same way that Aristotle used it.</description></item><item><title>Design Patterns Are Not Blueprints</title><link>https://alanhohn.com/posts/2016/design-blueprints/</link><pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/design-blueprints/</guid><description>Zone: Java
Recently I needed to put together some code to perform autowiring of dependencies using Java annotations. The annotation had an optional parameter specifying a name; if the name was missing, the dependency would be wired by type matching.
So of course the core logic ended up looking like:
private void wireDependency(Field field, Class&amp;lt;?&amp;gt; annotation, Object o) { if (!wireByName(field, annotation, o)) { wireByType(field, annotation, o); } } This falls under the category of &amp;ldquo;as simple as possible, but no simpler&amp;rdquo;.</description></item><item><title>Looking Along the Beam: Analysis and Insight</title><link>https://alanhohn.com/posts/2016/looking-along-the-beam/</link><pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/looking-along-the-beam/</guid><description>I&amp;rsquo;ve been doing some work on team organization lately, and it&amp;rsquo;s caused me to return to an idea I had about &amp;ldquo;defining&amp;rdquo; &amp;ldquo;process&amp;rdquo;. Working in the defense industry, of course I&amp;rsquo;ve seen a lot of plans and procedures for writing software. One of my favorite things to do is to spot what I call the &amp;ldquo;magic happens here&amp;rdquo; step.
It&amp;rsquo;s a fun game to play. Take a design process like this one.</description></item><item><title>Collaborators and Libraries: Java Design Patterns for Success</title><link>https://alanhohn.com/posts/2016/collaborators-and-libraries/</link><pubDate>Fri, 22 Apr 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/collaborators-and-libraries/</guid><description>My fellow Zone Leader Sam Atkinson wrote an excellent article on Beautiful Constructors. While I definitely agree that the constructors in his article are beautiful, I wasn&amp;rsquo;t as sure that his prescriptions could be universally applied. He graciously allowed me to use his piece as a springboard for a counterpoint, in the hope of some good discussion. Of course, the opinions in this article are my own.
Collaborators The style of design Sam describes seems to me to work best for a collaborator class.</description></item><item><title>Reducers: Workhorses of Parallel Programming</title><link>https://alanhohn.com/posts/2016/reducers/</link><pubDate>Fri, 22 Apr 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/reducers/</guid><description>Like jelly in the PB&amp;amp;J, or Art in Simon and Garfunkel, the reducer gets second billing in the term MapReduce. But it really is the more mathematicaly interesting function of the two, as I hope to demonstrate.
The secret to big data is of course the ability to do work in parallel. Modern Big Data engines like Hadoop don&amp;rsquo;t rely on the invention of clever new algorithms or artificial intelligence to produce impressive results; instead, they are based on the idea of taking lots of input, working on little pieces of it in lots of places at the same time, then bringing together the results.</description></item><item><title>Working in Parallel</title><link>https://alanhohn.com/posts/2016/sorting-in-parallel/</link><pubDate>Tue, 12 Apr 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/sorting-in-parallel/</guid><description>Moving from a sequential to a parallel implementation of an algorithm usually means that something has to change, and it may mean that the whole algorithm has to be rethought. There are some important concepts that help us predict what kinds of changes will make an algorithm perform well when run in parallel. This article is a brief introduction.
Simple Performance In the sequential case, we typically talk about algorithms in terms of the order of the algorithm (typically called Big O).</description></item><item><title>Spring Annotation Processing: How It Works</title><link>https://alanhohn.com/posts/2016/spring-annotation-processing/</link><pubDate>Fri, 08 Apr 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/spring-annotation-processing/</guid><description>One of the things I emphasize when I teach Java classes is the fact that annotations are inert. In other words, they are just markers, potentially with some properties, but with no behavior of their own. So whenever you see an annotation on a piece of Java code, it means that there must be some other Java code somewhere that looks for that annotation and contains the real intelligence to do something useful with it.</description></item><item><title>Expected Utility and Agile</title><link>https://alanhohn.com/posts/2016/expected-utility/</link><pubDate>Wed, 30 Mar 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/expected-utility/</guid><description>Selling Agile When convincing others to adopt agile practices, I have often found it useful to discuss those practices in terms of risk reduction. For example, we can talk about continuous integration in terms of reducing the &amp;ldquo;schedule risk&amp;rdquo; that results from performing all the integration at the end.
Unfortunately, selling agile in this way has a major disadvantage, which is that people tend to associate reduced risk with reduced cost, even though that is not really a valid association.</description></item><item><title>ANTLR 4 with Python 2 Detailed Example</title><link>https://alanhohn.com/posts/2016/antlr-python-arithmetic/</link><pubDate>Tue, 29 Mar 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/antlr-python-arithmetic/</guid><description>Zone: Integration
TLDR: ANTLR 4 introduced a handy listener-based API, but sometimes it&amp;rsquo;s better not to use it.
In a previous post I showed a very simple example using ANTLR 4 with Python 2. While this example gave the basic framework necessary, it didn&amp;rsquo;t delve very deeply into ANTLR&amp;rsquo;s API. In this article, I&amp;rsquo;ll give a little more detail.
Grammar To get started, we need a grammar that is more complex than the basic &amp;ldquo;Hello&amp;rdquo; grammar.</description></item><item><title>Using ANTLR 4 with Python</title><link>https://alanhohn.com/posts/2016/antlr-python/</link><pubDate>Tue, 15 Mar 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/antlr-python/</guid><description>ANTLR (Another Tool for Language Recognition) is an established tool for writing parsers. It is written in Java, but generates code in a variety of languages, including Python.
There seemed to be a dearth of examples out there using ANTLR 4 with Python, and having used ANTLR only with Java, I was interested to explore how difficult it would be to use. You can see the results in a GitHub repository.</description></item><item><title>User Interface Joys and Follies</title><link>https://alanhohn.com/posts/2016/ui-to-avoid/</link><pubDate>Sat, 12 Mar 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/ui-to-avoid/</guid><description>Zone: Web Dev
TLDR: How can a tool with a great concept and a great user interface ultimately fail in its promise? By taking the wrong path in just a couple big ways.
Markdown All the Things In my effort to convert all my documents to Markdown, I have been looking for a tool that would allow the use of Markdown for larger technical documents (the kind of thing traditionally done in Microsoft Word).</description></item><item><title>Publishing JSON Schema Documentaton with Docson</title><link>https://alanhohn.com/posts/2016/json-schema-docson/</link><pubDate>Wed, 09 Mar 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/json-schema-docson/</guid><description>For systems that have JSON data that&amp;rsquo;s published as part of an API, there are tools such as Swagger / OpenAPI and RAML that can be used to define REST endpoints and the data types for requests and responses. However, for cases where JSON data isn&amp;rsquo;t part of a REST API, such as documents in MongoDB, files on a disk, or messages, JSON Schema provides a way to specify what the JSON will look like in a way that covers all the possibilities better than making example documents.</description></item><item><title>iPhone and DVD: Encryption versus Security</title><link>https://alanhohn.com/posts/2016/encryption-and-security/</link><pubDate>Fri, 26 Feb 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/encryption-and-security/</guid><description>The Internet has been transfixed by the story of San Berdardino, Cupertino, and Quantico in the FBI&amp;rsquo;s attempt to access data from a terrorist&amp;rsquo;s smart phone. I won&amp;rsquo;t take a position, other than to point out that this is why the lawyers say, &amp;ldquo;Hard Cases Make Bad Law&amp;rdquo;. Instead, I&amp;rsquo;m interested in the discussion about what the idea of back doors to access an encrypted device really tells us about security.</description></item><item><title>Algorithms: The Assignment Problem</title><link>https://alanhohn.com/posts/2016/assignment-problem/</link><pubDate>Tue, 23 Feb 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/assignment-problem/</guid><description>One of the interesting things about studying optimization is that the techniques show up in a lot of different areas. The &amp;ldquo;assignment problem&amp;rdquo; is one that can be solved using simple techniques, at least for small problem sizes, and is easy to see how it could be applied to the real world.
Assignment Problem Pretend for a moment that you are writing software for a famous ride sharing application. In a crowded environment, you might have multiple prospective customers that are requesting service at the same time, and nearby you have multiple drivers that can take them where they need to go.</description></item><item><title>Docker and User Namespaces by Trial and Error</title><link>https://alanhohn.com/posts/2016/docker-userns/</link><pubDate>Mon, 22 Feb 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/docker-userns/</guid><description>Included in the recent release of Docker 1.10 is a feature destined to become more important with future releases: support for user namespaces. At the moment, it&amp;rsquo;s not enabled in a fresh install, and it still feels a little bleeding edge compared to more established Docker features, but it does work and is worth getting to know.
I spent a little time getting familiar; by no means enough to claim expertise, but enough to make it work.</description></item><item><title>About Transactions</title><link>https://alanhohn.com/posts/2016/about-transactions/</link><pubDate>Fri, 12 Feb 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/about-transactions/</guid><description>Zone: Integration
TLDR: Transactions are important but can be complex and confusing when getting started. This article provides an introduction to the terms and thinking behind transactions.
Transactions Are Important The famous &amp;ldquo;pennies for everyone&amp;rdquo; scheme in the movie Office Space was based on transferring fractions of a cent to an account with every transaction a bank performs. So obviously transactions are important, at least to the plot of that movie.</description></item><item><title>Fully Dynamic Classes with ASM</title><link>https://alanhohn.com/posts/2016/dynamic-classes-asm/</link><pubDate>Fri, 12 Feb 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/dynamic-classes-asm/</guid><description>Zone: Java
TLDR: ASM is a Java bytecode manipulation library. Mocking frameworks and runtime code generators use it to dynamically generate Java classes. Here is an introduction to how it works.
In two previous articles, I discussed Java&amp;rsquo;s built in dynamic proxy support and using CGLib to proxy concrete classes. In both cases, we provided some regular Java code, then dynamically generated classes that would wire up that Java code to any arbitrary interface or class.</description></item><item><title>Writing for the Web in Markdown with Strapdown</title><link>https://alanhohn.com/posts/2016/strapdown/</link><pubDate>Fri, 12 Feb 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/strapdown/</guid><description>Zone: Web Dev
TLDR: Writing in Markdown is more enjoyable than writing in HTML, and Markdown files are easier to version control and backup than content in a CMS.
As a Zone Leader here at DZone, I try to contribute as many interesting articles as time permits. So I spend a lot of time writing with a Web page as my target.
By the way, there are a lot of fun parts to being a Zone Leader, including getting to know the great people at DZone and in the Zone Leader Program.</description></item><item><title>String Builders and Smart Compilers</title><link>https://alanhohn.com/posts/2016/string-concat-java/</link><pubDate>Wed, 03 Feb 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/string-concat-java/</guid><description>TLDR: We&amp;rsquo;ve all been trained to stay away from string concatenation. The Java compiler stays away from it, too, even when the source code doesn&amp;rsquo;t. /TLDR
Concatenation, Oh No A friend of mine discovered &amp;ldquo;something&amp;rdquo; in a Java file recently; it looked about like this:
String s1; // etc. about 20 String combined = s1 + s2 + ... + s20; For a long time, this has been seen as a bad practice, because of the nature of strings in the Java programming language.</description></item><item><title>Puppet or Ansible: How to Choose?</title><link>https://alanhohn.com/posts/2016/puppet-ansible/</link><pubDate>Tue, 26 Jan 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/puppet-ansible/</guid><description>TLDR: When choosing between Puppet and Ansible, understanding the design choices can get us past wondering which is better, so we can make an informed decision. /TLDR
For people who are new to DevOps, it can be difficult to understand how tools are intended to be used. The basic examples in the documentation are intentionally simplified to show the tool, but that makes it more difficult to envision real-world usage. Since I&amp;rsquo;ve spent a lot of time recently using multiple tools, I thought it would be worth writing a little about my experiences.</description></item><item><title>Beyond Beginning Git: Exclude and Interactive Add</title><link>https://alanhohn.com/posts/2016/git-exclude-and-interactive-add/</link><pubDate>Sat, 23 Jan 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/git-exclude-and-interactive-add/</guid><description>This article is the second of a series describing tips and tricks on the way to mastery. The first article described how Git uses the index to track changes ready for commit and what it means when we need to back out changes before commit. This time, I want to describe a couple different things I&amp;rsquo;ve found useful: negative exclusions and interactive add.
Negative Exclusion In Git, we use a .</description></item><item><title>Inside an Algorithm: Dijkstra's</title><link>https://alanhohn.com/posts/2016/algorithm-dijkstra/</link><pubDate>Sat, 23 Jan 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/algorithm-dijkstra/</guid><description>One of the most famous algorithms in computer science is Dijkstra&amp;rsquo;s algorithm for finding the shortest path through a graph to one node or to all other nodes. This article walks through an example implementation to describe the algorithm in detail.</description></item><item><title>Beyond Beginning Git: Working Tree, Index and HEAD</title><link>https://alanhohn.com/posts/2016/git-index-and-tree/</link><pubDate>Sun, 17 Jan 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/git-index-and-tree/</guid><description>TLDR: Once you get past the first few commands, you learn Git by solving the next problem. This article describes a common problem that helps us learn a little about how Git works. /TLDR
Every team using Git has that person who is an expert; the person that everyone asks when some strange thing goes wrong. That person usually got where they are one command at a time, starting with just a little more knowledge and then building on it by helping other people.</description></item><item><title>Hadoop Sample Application with Vagrant and Ansible</title><link>https://alanhohn.com/posts/2016/hadoop-sample/</link><pubDate>Mon, 11 Jan 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/hadoop-sample/</guid><description>In a previous article I showed an example of using Vagrant and Ansible to deploy a pseudo-distributed Hadoop into a single virtual machine. The idea was, while Hadoop has support for running directly from a regular Java program or IDE, we can better learn how it works by running in a more realistic environment. We can also make something that&amp;rsquo;s useful for testing new applications at small scale.
The last article got a little long and ended a little abruptly, so I wanted to come back and discuss actually running a Hadoop application in the virtual machine.</description></item><item><title>Agile in the Defense Industry: Milestone Reviews</title><link>https://alanhohn.com/posts/2016/agile-3/</link><pubDate>Wed, 06 Jan 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/agile-3/</guid><description>tldrDefense programs have built-in checkpoints, with formal reviews and document deliveries more suitable for waterfall than agile. Agile programs find creative ways to make things work./tldr
This is the third article in a series on the use of agile in the U.S. defense industry. The first article and second article are also available to read.
With characteristic dry aplomb, the Defense Acquisition Portal says, &amp;ldquo;[a]cquisition programs proceed through a series of milestone reviews and other decision points that may authorize entry into a significant new program phase.</description></item><item><title>Quick Hadoop Startup in a Virtual Environment</title><link>https://alanhohn.com/posts/2016/hadoop-environment/</link><pubDate>Sat, 02 Jan 2016 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2016/hadoop-environment/</guid><description>tldrA fully-featured Hadoop environment has a number of pieces that need to be integrated. Vagrant and Ansible are just the tools to make things easier./tldr
When getting started with Hadoop, it is useful to have a test environment to quickly try out programs on a small scale before submitting them to a real cluster (or before setting that cluster up). There are instructions on the Hadoop website that describe running Hadoop as a single Java process.</description></item><item><title>Dynamic Class Enhancement with CGLib</title><link>https://alanhohn.com/posts/2015/cglib-observable-beans/</link><pubDate>Mon, 28 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/cglib-observable-beans/</guid><description>tldrPopular libraries like Spring use CGLib to dynamically generate classes at runtime. Understanding how it works can help you parse those notorious stack traces when something goes wrong./tldr
This is the third article on the subject of dynamic classes in Java. In the first article I discussed proxy capabilities built into the Java standard library. In the second article I discussed using CGLib in order to enhance a concrete class through a dynamic subclass.</description></item><item><title>Dynamic Proxies with CGLib</title><link>https://alanhohn.com/posts/2015/cglib-proxies/</link><pubDate>Sat, 26 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/cglib-proxies/</guid><description>In a previous article I discussed creating dynamic classes using the functionality built into the standard Java library. However, it suffers from an important limitation, as it can only create dynamic classes that proxy interfaces. In order to provide services such as container-managed transactions (as done by the Spring Framework) or transparent lazy fetching of data (as done by Hibernate) it is necessary to create dynamic classes that appear to be an instance of a concrete class.</description></item><item><title>Agile in the Defense Industry: Organizing Teams</title><link>https://alanhohn.com/posts/2015/agile-2/</link><pubDate>Fri, 18 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/agile-2/</guid><description>This article is the second in a series on how agile is being adopted in the U.S. defense industry. The first article discussed challenges specific to using agile in the defense industry, and why it is being adopted.
For any effort that uses the agile methodology, deciding &amp;ldquo;who is on the team&amp;rdquo; is a key step. The agile manifesto prioritizes individuals and interactions; for most users of agile, those interactions occur within a team.</description></item><item><title>Java Dynamic Proxies</title><link>https://alanhohn.com/posts/2015/jdk-proxies/</link><pubDate>Fri, 18 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/jdk-proxies/</guid><description>tldrA lot of modern Java frameworks use dynamically generated code. This article is designed to demystify a little of what is happening behind the scenes./tldr
When I&amp;rsquo;ve worked with new users of the Spring framework and Java EE, I&amp;rsquo;ve seen a lot of initial confusion over why injection works in some places but not others, or at some times but not others. My theme when teaching this material is to repeat, &amp;ldquo;there is no magic&amp;rdquo;.</description></item><item><title>Building and Testing Go with GoClipse, Drone.io and Coveralls</title><link>https://alanhohn.com/posts/2015/go-code-coverage/</link><pubDate>Wed, 09 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/go-code-coverage/</guid><description>In a previous article I showed building table-driven tests in Go. I then added another article to cover testing error conditions. Now that we have tests that cover all the cases, we deserve to get some green badges on our GitHub repository.
To help illustrate these articles with a simple example, I&amp;rsquo;ve posted a repository on GitHub that converts Roman numerals in string form into the numeric equivalent. I&amp;rsquo;ve added build support using drone.</description></item><item><title>Covering Error Cases in Go Unit Tests</title><link>https://alanhohn.com/posts/2015/error-case-testing-go/</link><pubDate>Mon, 07 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/error-case-testing-go/</guid><description>In a previous article I showed table-driven tests in Go, which are a compact way to run lots of test cases. In this article I will show another way to improve unit tests in Go: table-driven tests with invalid values.
To illustrate this, I&amp;rsquo;ve created an example library in Go that converts Roman numerals in string form to their numeric value. Of course, not all strings are valid Roman numerals. In Go, functions typically return an error value rather than throwing an exception.</description></item><item><title>Table Driven Tests in Go</title><link>https://alanhohn.com/posts/2015/table-driven-test-go/</link><pubDate>Sun, 06 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/table-driven-test-go/</guid><description>tldrFor a Java programmer, transitioning to Go can evoke &amp;ldquo;Where&amp;rsquo;s My JUnit?&amp;rdquo; Fortunately Go has both a built-in testing library and a very smooth way to write tests idiomatically./tldr
I&amp;rsquo;ve started working in Go both professionally and personally and have enjoyed the experience. One reason is that Go takes a quite different approach to Java in some areas, which makes switching between the two a mind-expanding experience.
One such area is in unit testing.</description></item><item><title>Models for 3D Printing with OpenSCAD</title><link>https://alanhohn.com/posts/2015/open-scad/</link><pubDate>Tue, 01 Dec 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/open-scad/</guid><description>Like many others, I have recently acquired the hobby of maintaining and using a 3D printer (in my case from Printrbot). I was initially impressed with the wide array of models available from various sites, but that feeling wore off quickly. Being restricted to models made by others feels more like observer status rather than a real participant.
I spent a little time with SketchUp, but I&amp;rsquo;m a programmer, not an artist.</description></item><item><title>Agile in the U.S. Defense Industry, Part 1</title><link>https://alanhohn.com/posts/2015/agile-1/</link><pubDate>Mon, 23 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/agile-1/</guid><description>tldrThe U.S. defense industry is the inventor of numerous software processes and even a programming language. This series discusses the challenges to using agile in the U.S. defense industry and some ways agile has had an impact./tldr
Introduction I was having a conversation with some of DZone&amp;rsquo;s Zone Leaders and the topic turned to how agile is used by defense contractors, especially in the United States. Allen Coin, with his eye out for interesting articles, was nice enough to suggest I try writing out some of those experiences and my thoughts.</description></item><item><title>Developing Atlassian Plugins with Vagrant</title><link>https://alanhohn.com/posts/2015/vagrant-atlassian/</link><pubDate>Sun, 22 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/vagrant-atlassian/</guid><description>tldrDevOps tools are great for teams, but they are great for one-person efforts too. A basic knowledge of Vagrant and Ansible makes it much easier to create and maintain custom development environments./tldr
I&amp;rsquo;ve been a user of various Atlassian tools for several years, and have developed a couple plugins along the way to make things easier. Atlassian has a substantial SDK with toolkit available for use, but since I use Maven every day for work, I&amp;rsquo;m very sensitive to anything that wants to add new Maven configuration to my everyday machine, even as a separate set of commands and configuration file.</description></item><item><title>Presentations with Remark and Mermaid</title><link>https://alanhohn.com/posts/2015/remark-mermaid/</link><pubDate>Sun, 22 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/remark-mermaid/</guid><description>tldrBrowser-based presentations are portable, easy to edit, and they convert easily to PDF. Plus embedded code snippets are a lot easier./tldr
Browser-based presentations seem to have taken over conferences, and for good reason. They can be hosted on the Internet, there&amp;rsquo;s less concern about portability between operating systems, and file sizes are very reasonable. However, in big companies PowerPoint is still the norm. Since I tend to split pretty equally between the two, I thought the story of how I moved toward browser-based presentations might be interesting.</description></item><item><title>Docker X11 Client Via SSH</title><link>https://alanhohn.com/posts/2015/docker-x11-ssh/</link><pubDate>Mon, 16 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/docker-x11-ssh/</guid><description>tldr Running a GUI program in Docker takes a little work. So does running a GUI program using SSH X11 forwarding. Putting the two together is the most fun of all. /tldr
Docker is an interesting technology to work with, because sometimes it feels like just regular coding, and sometimes it feels like typing with oven mitts on. Today was an oven mitt day.
The goal was to get a GUI program to run, in Docker, with the X server on the other side of an SSH tunnel.</description></item><item><title>Posting at DZone</title><link>https://alanhohn.com/posts/2015/zone-leader/</link><pubDate>Mon, 16 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/zone-leader/</guid><description>Since this blog was new, the content has been syndicated at DZone through their Most Valuable Blogger (MVB) program. Most of the people who have read what I&amp;rsquo;ve written have read it there, so it&amp;rsquo;s been advantageous to me, especially when I was starting as a new blogger.
Recently I was invited to join their Zone Leader program. As a result, I am joining a number of others posting original content at DZone and helping to syndicate the work of MVBs.</description></item><item><title>Agile Tools?</title><link>https://alanhohn.com/posts/2015/agile-tools-talent/</link><pubDate>Thu, 12 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/agile-tools-talent/</guid><description>tldrThe agile manifesto says to emphasize individuals and interactions over processes and tools. So why do we spend so much time on tools?/tldr
The very first of the four values in the agile manifesto is, &amp;ldquo;[i]ndividuals and interactions over processes and tools&amp;rdquo;. The agile mentors I have worked with emphasize this value when teaching agile; for example, they use only flipcharts and sticky notes to teach new teams how to write user stories and do sprint planning and daily standups.</description></item><item><title>Environment Variables with Ansible and Vagrant</title><link>https://alanhohn.com/posts/2015/vagrant-ansible-env-vars/</link><pubDate>Thu, 12 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/vagrant-ansible-env-vars/</guid><description>One of the joys of working in a big corporate environment is the use of a Web proxy server for connection to the Internet. When provisioning a virtual machine with Vagrant and Ansible, this means that sometimes the VM has to go through the proxy and sometimes it doesn&amp;rsquo;t. I&amp;rsquo;d rather this was as seamless a transition as possible. The solution I came up with can be extended to other cases where different Ansible behavior is needed at different times.</description></item><item><title>Situational Test Driven Development</title><link>https://alanhohn.com/posts/2015/test-driven/</link><pubDate>Wed, 11 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/test-driven/</guid><description>I was thinking today about Test Driven Development (TDD) in the context of Code I Have Known. I think I found a couple examples that illustrate what I think is great and not so great about TDD. Both are examples of code I wrote, and of which I am proud, which I think is important for the example.
The first was a message parser I wrote to support a strange packed binary format.</description></item><item><title>Minimal Docker Container</title><link>https://alanhohn.com/posts/2015/minimal-docker-container/</link><pubDate>Tue, 10 Nov 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/minimal-docker-container/</guid><description>Most Docker images start from the Docker Hub, with its set of base OS images and application images built from them. With Docker&amp;rsquo;s layered architecture for images, the fact that typical images are 50MB to 100MB is not a major issue.
At the same time, there are uses for Docker where building from scratch is desirable, and when building from scratch, the image might as well be as small as possible.</description></item><item><title>Java REST Web Service</title><link>https://alanhohn.com/posts/2015/jaxrs-server/</link><pubDate>Sat, 04 Jul 2015 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2015/jaxrs-server/</guid><description>Introduction I&amp;rsquo;ve built a small example of running a standalone Java application that both serves static HTML, JavaScript, CSS content, and also publishes a REST web service. The example uses Jersey and Jetty. This example probably deserves a few posts to allow enough time to explain how the pieces fit together, so I&amp;rsquo;ll start with the primary Java pieces that make a JAX-RS application.
A couple years back, while I was working through some slides to teach a Java class (mostly Java EE and Spring) I created a REST web service using Spring WebMVC.</description></item><item><title>Logging Performance</title><link>https://alanhohn.com/posts/2014/log-string-performance/</link><pubDate>Thu, 16 Oct 2014 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2014/log-string-performance/</guid><description>Introduction I had an interesting conversation today about the cost of using string concatenation in log statements. In particular, debug log statements often need to print out parameters or the current value of variables, so they need to build the log message dynamically. So you wind up with something like this:
logger.debug(&amp;#34;Parameters: &amp;#34; + param1 + &amp;#34;; &amp;#34; + param2); The issue arises when debug logging is turned off. Inside the logger.</description></item><item><title>Generics and Capture Of</title><link>https://alanhohn.com/posts/2014/good-old-capture-of/</link><pubDate>Sat, 25 Jan 2014 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2014/good-old-capture-of/</guid><description>I taught an introductory Java session on generics, and of course demonstrated the shorthand introduced in Java SE 7 for instantiating an instance of a generic type:
// Java SE 6 List&amp;lt;Integer&amp;gt; l = new ArrayList&amp;lt;Integer&amp;gt;(); // Java SE 7 List&amp;lt;Integer&amp;gt; l = new ArrayList&amp;lt;&amp;gt;(); This inference is very friendly, especially when we get into more complex collections:
// This Map&amp;lt;String,List&amp;lt;String&amp;gt;&amp;gt; m = new HashMap&amp;lt;String,List&amp;lt;String&amp;gt;&amp;gt;(); // Becomes Map&amp;lt;String,List&amp;lt;String&amp;gt;&amp;gt; m = new HashMap&amp;lt;&amp;gt;(); Not only the key and value type of the map, but the type of object stored in the collection used for the value type can be inferred.</description></item><item><title>Concurrent Random in Java SE 7</title><link>https://alanhohn.com/posts/2014/concurrent-random/</link><pubDate>Sun, 12 Jan 2014 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2014/concurrent-random/</guid><description>Introduction Last year I wrote a series of posts (Part 1, Part 2, Part 3) on the use of the new Java fork/join framework for a Monte Carlo simulation.
First, an update. Going back through the code I discovered a bug in the way the triangle distribution was implemented. Fortunately this is a toy example, as it made the results inaccurate. My fault for not unit testing. I would still not suggest using this code for anything other than learning about fork/join.</description></item><item><title>Spring Static Application Context</title><link>https://alanhohn.com/posts/2013/spring-static-context/</link><pubDate>Sun, 10 Nov 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/spring-static-context/</guid><description>Introduction I had an interesting conversation the other day about custom domain-specific languages and we happened to talk about a feature of Spring that I&amp;rsquo;ve used before but doesn&amp;rsquo;t seem to be widely known: the static application context. This post illustrates a basic example I wrote that introduces the static application context and shows how it might be useful. It&amp;rsquo;s also an interesting topic as it shows some of the well-architected internals of the Spring framework.</description></item><item><title>Conversational Git</title><link>https://alanhohn.com/posts/2013/conversational-git/</link><pubDate>Sun, 20 Oct 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/conversational-git/</guid><description>This post is an excerpt from my new book, Conversational Git. The entire book is available on-line and its source is on GitHub. It&amp;rsquo;s designed to be a quick, accessible introduction for experienced developers. I&amp;rsquo;d be delighted to hear what others think.
I recently had some close friends talk about their hesitation in adopting Git as opposed to continuing to work with Subversion. I&amp;rsquo;ve used Subversion for many years, and advocated for its use.</description></item><item><title>Spring Custom XML Namespaces</title><link>https://alanhohn.com/posts/2013/spring-custom-xml/</link><pubDate>Tue, 15 Oct 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/spring-custom-xml/</guid><description>Introduction One of the nice recent features of Spring (2.x era) is support for custom XML. This is the way that Spring itself has added all kinds of new tags such as &amp;lt;util:list&amp;gt; and &amp;lt;mvc:annotation-driven&amp;gt;. The way this works is pretty elegant, to the point that it makes an interesting alternative for configuring Java using XML, particularly if the application already uses Spring.
I&amp;rsquo;ve written an example application to try to give an easily-copied example of how it&amp;rsquo;s done.</description></item><item><title>Embedded Jetty Executable JAR</title><link>https://alanhohn.com/posts/2013/embedded-jetty-executable-maven/</link><pubDate>Wed, 09 Oct 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/embedded-jetty-executable-maven/</guid><description>Previous posts such as this one have shown using embedded Jetty to REST-enable a standalone Java program. Those posts were lacking an important feature for real applications: packaging into a JAR so the application will run outside of Eclipse and won&amp;rsquo;t be dependent on Maven and jetty:run. To make this happen, we will use Maven to build an executable JAR that also includes all of the Jetty and Spring dependencies we need.</description></item><item><title>Jetty Proxy Servlet</title><link>https://alanhohn.com/posts/2013/jetty-proxy-servlet/</link><pubDate>Sun, 06 Oct 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/jetty-proxy-servlet/</guid><description>Introduction I&amp;rsquo;ve talked before about Jetty as an embedded servlet container. Jetty also includes some useful utility servlet implementations, one of which is ProxyServlet.
ProxyServlet is a way to create an HTTP or HTTP/S proxy in very few lines of code. Even though it&amp;rsquo;s part of the Jetty project, it&amp;rsquo;s modularized to be independent of the Jetty server, so you can use it even in cases where the servlet won&amp;rsquo;t be run in Jetty.</description></item><item><title>Embedded Jetty and SSL</title><link>https://alanhohn.com/posts/2013/jetty-ssl-server/</link><pubDate>Sat, 05 Oct 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/jetty-ssl-server/</guid><description>As I discussed in a series of four posts (see Part 1, Part 2, Part 3, and Part 4), I recently taught a class on Spring WebMVC and how it can be used to REST-enable a standalone Java application. As part of that discussion, I talked about using Jetty as an embedded servlet container, which let us create and access servlets without having to package our existing application as a WAR.</description></item><item><title>Java Fork/Join Example</title><link>https://alanhohn.com/posts/2013/monte-carlo-npv-2/</link><pubDate>Tue, 01 Oct 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/monte-carlo-npv-2/</guid><description>Introduction In a previous post I discussed the fork/join framework introduced with Java SE 7 and how it can be used to perform simple parallelism of certain types of tasks; that is, those that operate within a single JVM and involve a large piece of work that can be broken up into smaller pieces through a divide and conquer strategy. To illustrate this, I introduced an example of using fork/join to perform a Monte Carlo simulation of the Net Present Value of an investment with uncertain profits and discount rate.</description></item><item><title>Tuning Java Fork/Join</title><link>https://alanhohn.com/posts/2013/monte-carlo-npv-3/</link><pubDate>Tue, 01 Oct 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/monte-carlo-npv-3/</guid><description>This post continues a series discussing the new fork/join features added to Java SE 7. Part 1 and part 2 introduced an example application that performs a Monte Carlo simulation of the Net Present Value of an investment with uncertain profits and discount rate. The example application is available on GitHub.
The previous post glossed over an important question: what is the &amp;ldquo;right&amp;rdquo; way to divide up the work? Of course, the answer is dependent on the type of work being performed and the machine on which it is run.</description></item><item><title>Fork/Join in Java</title><link>https://alanhohn.com/posts/2013/monte-carlo-npv-1/</link><pubDate>Sun, 22 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/monte-carlo-npv-1/</guid><description>Introduction This is the first of a series of posts that will discuss an example application that uses the Java Fork/Join framework to do a Monte Carlo simulation of the Net Present Value of a prospective investment. This first post discusses the purpose of the example application as well as the purpose of the fork/join framework and the kinds of problems it can best solve.
Fork/Join and Divide and Conquer The fork/join framework introduced with Java SE 7 is based on a specific model of parallel programming, similar to what is implemented in languages such as Intel&amp;rsquo;s Cilk Plus.</description></item><item><title>Reflection Method Matching</title><link>https://alanhohn.com/posts/2013/reflection-method-matching/</link><pubDate>Fri, 20 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/reflection-method-matching/</guid><description>Even though reflection is used widely in popular libraries such as Spring and Jackson, direct use of reflection is thankfully pretty rare, as it can be challenging to make robust. One issue with reflection is that it can work in ways that break typical assumptions about Java. For example, looking up a method using reflection works very differently from the way Java finds and calls a method in normal code.</description></item><item><title>REST enabled Java app, part 4</title><link>https://alanhohn.com/posts/2013/webmvc-client/</link><pubDate>Thu, 19 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/webmvc-client/</guid><description>This is part 4 of a series discussing a sample webapp that uses Spring WebMVC and Jetty to add a REST API to a standalone Java application. Part 1, Part 2, and Part 3 were posted previously.
This post discusses using Spring WebMVC for the client side, and also discusses some integration options for adding WebMVC to an existing application.
WebMVC Client Of course, one of the largest motivations for a REST API is the ability to use it from any language, especially JavaScript in a browser.</description></item><item><title>REST enabled Java app, part 3</title><link>https://alanhohn.com/posts/2013/webmvc-server-3/</link><pubDate>Wed, 18 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/webmvc-server-3/</guid><description>This post is part 3 of a series that started here and continued here. There will be at least one more post in this series, to discuss Spring WebMVC as a client. All of the code is available as a project on GitHub.
As I discussed previously, the Spring WebMVC example I provided is a complete web application, with the three files web.xml, rest-servlet.xml, and the controller class.
But one of the reasons I wanted to put together this example is to show the class I was teaching the possibility of embedding this into an existing Java program.</description></item><item><title>REST enabled Java app, part 2</title><link>https://alanhohn.com/posts/2013/webmvc-server-2/</link><pubDate>Tue, 17 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/webmvc-server-2/</guid><description>Last time I introduced an example application I wrote to illustrate Spring WebMVC for a Java class. I think the application is a nice example because it also illustrates the ability to add a REST API to an existing standalone Java application using Jetty as an embedded servlet container.
I&amp;rsquo;m presenting this example in a series of posts because I learned from personal experience teaching this that the more &amp;ldquo;under the covers&amp;rdquo; behavior there is, be it classpath scanning, annotation configuration, reflection, or proxying, the harder it can be for new folks to grasp.</description></item><item><title>Google Places client using Spring WebMVC</title><link>https://alanhohn.com/posts/2013/webmvc-googleplaces/</link><pubDate>Mon, 16 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/webmvc-googleplaces/</guid><description>While giving a series of presentations on using Java in a distributed environment (focusing on Java EE and Spring), I got a lot of interest in web programming. I did an extra presentation on servlets, but I didn&amp;rsquo;t want to leave it there, because writing Java servlets directly is not very efficient compared to tools like Spring WebMVC.
So I made an extra presentation on WebMVC, which led me to make a sample application that provides both a client and a server using Spring WebMVC.</description></item><item><title>REST enabled Java app</title><link>https://alanhohn.com/posts/2013/webmvc-server-1/</link><pubDate>Mon, 16 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/webmvc-server-1/</guid><description>This is part 1 of 3. Also see part2 and part3.
There are a lot of tutorials out there about providing REST web services in a servlet container by building and deploying a WAR. There are also cases where someone is looking to put a REST interface on an existing Java application. In that case it isn&amp;rsquo;t always possible to turn the application into a WAR or EAR and adding a servlet container as a separate process just adds a layer of complexity.</description></item><item><title>Menus with Apache Digester</title><link>https://alanhohn.com/posts/2013/digester-menus/</link><pubDate>Sun, 15 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/digester-menus/</guid><description>Apache Digester is a venerable library for parsing XML and turning it into a graph of Java objects. There are a lot of libraries out there for parsing and writing XML, and Digester isn&amp;rsquo;t the most performant at runtime, doesn&amp;rsquo;t support writing XML back out again, and can seem a little inaccessible to new users. But I like it very much, and it&amp;rsquo;s a very powerful tool in my toolbox.</description></item><item><title>Performance of Java Collections</title><link>https://alanhohn.com/posts/2013/collection-performance/</link><pubDate>Sun, 15 Sep 2013 00:00:00 +0000</pubDate><guid>https://alanhohn.com/posts/2013/collection-performance/</guid><description>I&amp;rsquo;m in the midst of teaching an Introduction to Java class. Like most courses of this type, when I introduce the standard JVM collections I intend to provide guidance on which type of collection to use when.
I wanted to show the real-world effects of making the correct or incorrect decision, so I put together an example. I used the excellent Caliper library to create a class that benchmarks pulling data from existing collections.</description></item><item><title>Book</title><link>https://alanhohn.com/books/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/books/</guid><description>The Book of Kubernetes A Complete Guide to Container Orchestration Where To Buy: No Starch Press (Free Ebook!) | Amazon | O&amp;rsquo;Reilly Examples Containers ensure that software runs reliably no matter where it’s deployed, and Kubernetes is the open-source platform that lets you manage all of your containers from a single control plane. In this comprehensive tour of Kubernetes, each chapter includes a set of examples with just enough automation to start your container exploration with ease.</description></item><item><title>Courses</title><link>https://alanhohn.com/courses/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://alanhohn.com/courses/</guid><description>Video Courses Hands-On Auto DevOps with GitLab CI Where To Buy: Publisher | Udemy | O&amp;rsquo;Reilly Developing modern software requires an automated pipeline that builds, tests, and deploys your application, complete with its required infrastructure. GitLab is a Git-based version control server, available at gitlab.com or as a private server. GitLab CI provides automated builds and deployments right from within GitLab. With GitLab CI, it is easy to add build and deployment automation that triggers on every code change, helping you build high-quality, reliable software and deploy it to production at speed.</description></item></channel></rss>