- From DZone: The Soon-to-Be-Hated Object Locator presents a pattern for a type of God Object, except possibly restricted in scope enough to not earn the full derision that a God Object deserves… maybe.
- Also from DZone: The Genius of the Law of Demeter, an article with far less controversy than a God Object would create. The short form of the Law of Demeter says that you call methods on objects that your class owns directly:
this.getFoo().bar()is okay, but
this.getFoo().getBar().baz()is not (and, as usual, there’s more to it than this.)
- Stack Overflow: Helping One Million Developers Exit Vim documents the usage patterns for questions that … help developers exit
Vimisn’t especially common for Java developers (although it happens) – but still! What a great editor! How user-friendly does an editor have to be that one in 20000 visits to Stack Overflow is specifically about how to exit the editor? (And now I wonder how many visits are about exiting Emacs, too…)
- Java 9 expert group minutes: http://openjdk.java.net/projects/jigsaw/spec/minutes/2017-05-18 – it’s good to keep up on the current status, because the implications of every choice made are pretty serious. The second set of minutes are also available.
- vJUG24 is back! (… I didn’t know what this was until someone sent it to me.)
- Excellent advice for developers who design APIs, no matter who is consuming those APIs: “Building for Builders: Stripe’s 8 Tips for Designing APIs and Supporting Developers“
- Artificial intelligence is everywhere these days. Here’s “Every single Machine Learning course on the internet, ranked by your reviews“
- A cool discrete mathematics library, written in Kotlin: KotlinDiscreteMathToolkit.
- From DZone: Understanding When to Use RabbitMQ or Apache Kafka. Short form: RabbitMQ is for lazy developers; AMQP message queues does most of the work for you at the cost of throughput (which is still high for most projects!), and Kafka does almost none of the work for you but can support much higher throughput. Your humble editor’s advice, earned by experience: if you’ve got the right developers and the time to put into it, Kafka can handle much more throughput than RabbitMQ can, but .. be prepared to make sure you have the right developers and the time to put into it. Otherwise, RabbitMQ (or equivalents) will do fine.
- Druid is a high-performance, column-oriented, distributed data store. Haven’t tried it, it just looked interesting.
- Not Java, but relevant: MP3 licensing has changed! The MP3 format is now available for use by pure open source applications. Woo! Now if we could get JPEG unencumbered in the same way…
I was working on an application with DropWizard, and I was having trouble getting my own metrics to show up in the display. The Metrics Getting Started is useful, and it actually showed me what I needed, but didn’t make it obvious enough for me.
What I needed was, in DropWizard Metrics parlance, a “meter.” This gives me performance data over time; basically, every time an event happens, I’d
mark it and thus be able to see how busy the system was in the last minute, the last five minutes, and the last 15 minutes.
I followed the Metrics Getting Started:
- I got a
- I created a
register.meter(name)if necessary (and stored the
Meterin a map so I could retrieve it again at will)
- I marked an event by calling
But at no point was I able to see the meter displayed in the DropWizard servlet.
The reason is because I created my own
MetricsRegistry. One right way to do it is documented; it’s to use
SharedMetricRegistries.getDefault(); instead (which gets you a
MetricsRegistry that is displayed automatically).
Note that the DropWizard documentation is not wrong – it just steps past something that most people probably want by default.
- Crafting perfect Java Docker build flow, which addresses the “bare minimum you need to build, test and run my Java application in Docker container.”
- Also relevant: manorrock/maven, a docker container that delivers a specific version of Maven / OpenJDK for Continuous Integration purposes.
- From DZone: Using Java 8? Please Avoid Functional Vomit
- “The Complete Beginners’ Guide to Artificial Intelligence” is a very high-level view of AI. It won’t teach you much about AI if you know much, but it’s a good starting point in case you’re wondering where what you think of AI fits in.
- Another from DZone, appropriate after “LinkedList vs. ArrayList“: Learning Big O Notation With O(n) Complexity
- Not Java-related, but development-related: Teamwork and mental illness in the workplace. Important note: one in four people suffer from mental illness. If you’re in a team of eight, that means that statistically at least two of your coworkers suffer from something that can’t be seen.
If you have a teammate who suffers from mental illness, I’d encourage you to champion (heart and balance) within your team. Be an ally. Help create a safe and inclusive space. Not only because it’s the right thing to do, but because being around people different from you broadens your horizons and builds empathy. And empathy for others makes you better at just about every job.