Real software sees entities (Customer, File etc) involved in multiple interactions. Simple OO examples model behavior in entity classes directly, but this becomes tangled as behaviors & interactions increase; and results in broken inheritance structures.
Instead of modelling these all in the entity, a more advanced OO approach considers separating behavior from the entity. We’ll consider key principles in this multi-part series. Continue reading →
HttpClient has long been popular for implementing outbound HTTP in Java. URL requests, HTTP remoting & service access are all common usecases.
For developers of HTTPS client applications, one scenario is common: wanting to test HTTPS connectivity, without needing a CA-signed certificate on each developer’s local appserver. Continue reading →
Oracle 12c’s new feature is pluggable databases (PDBs). This has been introduced to improve support for cloud & multi-tenancy, and keep up with SQL Server. However, our trial found Oracle’s PDBs less than ready for production use. Continue reading →
Exception handling in Java is crucial for reliability, but a common source of bloat & prone to miscoding. However, dealing with exceptions correctly can be surprisingly easy.
We cover 10 “foundation” best practices to simplify your coding & help you handle exceptions correctly. Continue reading →
With the move to annotations for use of Spring, many projects have become based on component-scanning, auto-wiring and property-placeholder injection — an ‘implicit’ approach to configuration.
However, it can still be very useful to specify ‘explicit’ configuration. This gives us control of top-level application config & enables extensible configuration using the Strategy pattern.
Gaining control of configuration is crucial to enable per-customer/ per-application customization. Continue reading →
Java 8’s ForkJoinPool & parallel streams are receiving some serious attention now. They seem a sophisticated concept to parallelize work, but some are warning of serious limitations.
Edward Harned of CoopSoft, in particular, has analyzed the Fork/Join design implemented in Java. Continue reading →
Checked exceptions have always been a controversial feature of the Java language.
Advocates claim they ensure checking & recovery from failures. Detractors say “catch” blocks can almost never recover from an exception, and are a frequent source of mistakes.
Meanwhile, Java 8 and lambdas are here. Are checked exceptions becoming obsolete in the Java world? Continue reading →
Threading is easy in Java, but today I was reminded of another of its pitfalls.
In Java- or container-provided threads, unhandled exceptions from our code will be printed or logged to the console. Create your own Thread or use SwingWorker/ ThreadPoolExecutor, and it’s a different story..
Threaded code tends to die silently. Nothing on the console or logs. Unhandled exceptions are invisible, and leave very few clues. Let’s look at why.
Rossen Stoyanchev at Spring Framework is finally ready to tackle the thorny issue of @ModelAttribute inter-dependency.
The new annotation-based handlers allow easy definition of simple controllers, but when combined with JDK 7’s unpredictable ordering of reflected methods, problems could occur..