Quantcast
Channel: Scratch Where It's Itching
Browsing all 73 articles
Browse latest View live

Hamburger 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 Article


Image may be NSFW.
Clik here to view.

Water 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 Article


Negating 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 Article

Image may be NSFW.
Clik here to view.

Santa 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 Article

Image may be NSFW.
Clik here to view.

Godzilla 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 Article


Create 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 Article

Image may be NSFW.
Clik here to view.

Opera 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 Article

Queue Patterns

This is just a summary of all my Queue Patterns:PatternDescriptionRocket Anti PatternData cross layersParatrooper ModelSeparate threads for separate layersMarsupilami PatternIntroduce queuesIndian...

View Article


Image may be NSFW.
Clik here to view.

One 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 Article


Format 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 Article

Image may be NSFW.
Clik here to view.

Zebra 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 Article

TreeMap 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 Article

Image may be NSFW.
Clik here to view.

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 Article

Browsing all 73 articles
Browse latest View live