Reflective programming (or reflection) happens when your code changes itself on the fly. For example, a method of a class, when we call it, among other things adds a new method to the class (also known as monkey patching). Java, Python, PHP, JavaScript, you name it—they all have...
Wednesday, June 29, 2022
Monday, June 27, 2022
Programming lightweight IoT messaging with MQTT in Java
MQTT is an open message protocol perfect for communicating telemetry-style data from distributed devices and sensors over unreliable or constrained networks.MQTT is an open message protocol for Internet of Things (IoT) communication. It enables the transfer of telemetry-style data in the form of messages from distributed devices and...
Friday, June 24, 2022
Bruce Eckel on Java modules, text blocks, and more
Bruce wraps up his series by examining Project Jigsaw, triple double quotes, try-with-resources, and NullPointerException.ModulesBefore JDK 9, a Java program required the entire Java library. This meant that the simplest program carried an enormous amount of library code that was never used. If you used component A, there...
Friday, June 10, 2022
Java Hashtable, HashMap, ConcurrentHashMap – Performance impact
There are a good number of articles that articulate functional differences between HashMap, HashTable and ConcurrentHashMap. This post compares the performance behavior of these data structures through practical examples. If you don’t have patience to read the entire post, here is bottom line: When you confront with the...
Wednesday, June 8, 2022
Bruce Eckel on Java pattern matching guards and dominance
Pattern matching guards let you refine the matching condition beyond simply matching on the type.The previous article in this series, “Bruce Eckel on pattern matching in Java,” introduced pattern matching and this article delves into the details. Keep in mind that, at the time of this writing, pattern...