Do Abstract Factories Occur in the Wild?
Cay Horstmann's unblog
by
1w ago
Abstract Factory is one of the 23 “Gang Of Four” design patterns. So it's got to be important. But when I was asked to produce an actual use case, I came up blank. Your favorite search engine will find you any number of examples, but all of the ones I inspected were bogus. Is it time to put this pattern to pasture ..read more
Visit website
Linux High DPI Settings
Cay Horstmann's unblog
by
2w ago
I recently got a laptop with a High DPI screen. These notes document what I had to do to make it usable with OpenBox. They should be relevant to other window managers as well. If you aren't using Linux, move along...nothing to see here ..read more
Visit website
Happy 0x7E7!
Cay Horstmann's unblog
by
1M ago
Happy new year! Is there anything interesting about the number 2023? I asked Open AI chat and was told no, it's just a number like any other. So I had to do the creative work myself. Here are some fun facts about 2023 (hex 7E7) of which the chatbot was unaware. I include some ideas for programming assignments, together with an analysis of the answers that the chatbot offered ..read more
Visit website
Tidbits #3 from JCrete 2022—Loom
Cay Horstmann's unblog
by
6M ago
This is the last of three articles about tidbits that I learned at the JCrete unconference. Here is an elevator pitch about Loom for those who aren't familiar with it, followed by a couple of observations that shine some light on the essence of Loom ..read more
Visit website
Tidbits #2 from JCrete 2022—TimSort
Cay Horstmann's unblog
by
6M ago
At JCrete, I learned that the sort methods in the Java standard library can throw an exception with the curious message “Comparison method violates its general contract!”. Of course I had to dig into the gory details ..read more
Visit website
Tidbits #1 from JCrete 2022 - Puzzlers
Cay Horstmann's unblog
by
6M ago
Every year, Heinz Kabutz and his merry band of disorganizers run the fantastic JCrete conference. Well, except for the last two years, when COVID-19 put a stop to it. This year, JCrete was back with a limited number of attendees to avoid a superspreader event. This is the first of a three-part series of tidbits that I learned ..read more
Visit website
Record Patterns (JEP 405)
Cay Horstmann's unblog
by
7M ago
This article, also posted on http://javaalmanac.io, describes record patterns, a preview feature of Java 19. A record pattern lets you “deconstruct” a record value, binding each component to a variable. Record patterns work with instanceof and switch pattern matching. Guards are supported. They are particularly compelling with nested deconstruction and sealed record hierarchies ..read more
Visit website
Pattern Matching for Switch (JEP 427)
Cay Horstmann's unblog
by
9M ago
This article, also posted on http://javaalmanac.io, describes pattern matching for switch, in its third preview iteration in Java 19. Type patterns allow you to match on the type of the selector value and analyze the value further in a variable of the appropriate type. There are fiddly rules about null, fall through, and case ordering. At the end of each section is a “sandbox” with somewhat contrived code to try out the syntax variations ..read more
Visit website
Virtual Threads and Tomcat
Cay Horstmann's unblog
by
9M ago
Virtual threads are the ideal mechanism for running mostly blocking tasks, providing a high level of concurrency without requiring asynchronous acrobatics from business logic programmers. I show that it is easy to configure Tomcat for virtual threads, provided one makes a small change to the Tomcat source code ..read more
Visit website
Loop Patterns (Java Edition)
Cay Horstmann's unblog
by
9M ago
In a presentation about teaching new Java features, I casually mentioned that my textbooks for beginning students include a list of common loop patterns (counting matches, maximum, and so on). After all, students can't realistically be expected to invent them on the spot each time they are needed. Attendees asked me about that list. Here it is ..read more
Visit website

Follow Cay Horstmann's unblog on Feedspot

Continue with Google
OR