Star Trek Anti-Pattern
In previous installments, we tried to limit the number of Threads to the minimum, even to one. But what happens if you go the opposite way? Often, we try to parallelize some process, but do not want to...
View ArticleTreeMap misuse
TreeMap is a very practical class when you want your Map to keep its keys ordered. Unless you don't know how it works. I noticed this code recently in one of our projects:private Map<Double,...
View ArticleZebra Pattern
Last time I explained the One Ring Pattern, where only one thread handles data coming from a queue. I also explained the reasons why such a pattern might be preferred.One of those reasons is when...
View ArticleFormat Date with java time
An advantage of the DateTimeFormatter class from the java time package over the old DateFormat is that it is thread-safe. But if the only thing I have is a Date, how can I proceed? The...
View ArticleOne Ring Pattern
Last time, I finished talking about all my Queue Patterns. Now I’ll start with my Thread Patterns. Once you have your queues filled with tasks, the question that arises is: how many Threads do I need...
View ArticleQueue Patterns
This is just a summary of all my Queue Patterns:PatternDescriptionRocket Anti PatternData cross layersParatrooper ModelSeparate threads for separate layersMarsupilami PatternIntroduce queuesIndian...
View ArticleOpera Lift Pattern
In my last part, I presented the Godzilla Anti-Pattern, where you would merge so many messages that a monster size packet would be sent and have negative effects.In this part, I would like to present...
View ArticleCreate Temporary Files with NIO 2 on Linux
We have an application that had problems with memory consumption. One type of object that we were keeping in memory was kept there only in case a user would start an administration client and connect...
View ArticleGodzilla Anti-Pattern
Last time, I presented the Santa Claus Pattern, where you would send several messages wrapped up in the same packet to lower payload and increase performance.However, if you create your packets without...
View ArticleSanta Claus Pattern
In a previous post, I talked about the Water Drop Anti-Pattern, where the ratio of payload to data was leading to poor performances.A way to alleviate this problem is to introduce the Santa Claus...
View ArticleNegating a Predicate
Often, when using Java streams, I try to replace my lambdas with Method References. For instance, when I have this code: mystream.filter(mystring -> mystring.isEmpty()) ... I tend to replace it with...
View ArticleWater Drop Anti-Pattern
In my previous entries, I presented two patterns that allow you to limit the number of messages sent over a queue: the Indiana Jones Pattern and the Hamburger Pattern. The first one filters data while...
View ArticleHamburger Queue
In my last entry, I presented the Hamburger Pattern and talked about how you can reduce the number of events on a queue by merging them. However, I feel that I should have presented at least one way to...
View ArticleHamburger Pattern
Last time, I introduced the Indiana Jones Pattern, where you would filter your messages in order to send less data on your overcrowded queue.Another way to reduce the number of messages is to use the...
View ArticleIndiana Jones Pattern
In my previous entry, I presented the Indian Train Anti-Pattern, where we added without discrimination data to be handled on our queues, leading to overcrowded queues.One possibility to alleviate the...
View ArticleIndian Train Anti-Pattern
Last time, I talked about the Marsupilami Pattern, where we introduced queues to transport data between application layers.Now you’ve been using these queues for some time, conveying all sorts of data,...
View ArticleMarsupilami Pattern
In my previous entry, I described the Paratrooper Model, where each application layer would have its own thread pool for handling data. And the way to implement that is to use the Marsupilami...
View ArticleParatrooper Model
In my previous entry, I was describing the Rocket Anti-Pattern, where one thread would handle too much work across several application layers, leading to communication buffer overflow and message...
View ArticleRocket Anti-Pattern
At my presentation at Devoxx Paris this year, The Thread Awakens, I introduced several Patterns related to multithreading. Since it was a quickie, I had only 15 minutes to talk about 15 Patterns. That...
View ArticleJava 8 might kill doclint
Since Java 8, javadoc doclint became a lot stricter. Up to now, we had some warnings here and there. But since we moved to Java 8, our Jenkins releases are failing because doclint would throw HTML...
View Article