3 ms·
You don’t need to introduce a network boundary as an excuse to write better code. This obviously should be true (and for many programming languages it is) but
by xg15 10y ago
You don’t need to introduce a network boundary as an excuse to write better code.
This obviously should be true (and for many programming languages it is) but I feel thanks to the perfect storm of Java class resolution, gratuitous use of reflection and Maven dependency rules, this isn't actually the case anymore in the Java world.
If you work on a large Java project with lots of 3rd party dependencies, you can experience some odd interactions of libraries that you'd assume should know nothing of each other - e.g. because they pull in conflicting transitive dependencies or perform classpath scanning to "simplify" configuration.
In cases like this, it's a huge help if you can keep the interactions in bound by splitting an application into several different VMs or WARs.
- lmm 10y agoJava is the one ecosystem that I think has this sorted, because Maven gets releases/versioning right and makes multi-module projects easy. You need to align yourself on consistent versions of your transitive dependencies, but how many of your modules would not use most of your dependency libraries (especially the all-encompassing frameworks that tend to have transitive dependency issues) anyway? And of course all your modules have to depend on the same versions of things, but that's a good idea anyway - even in a microservice world using two different versions of a framework for different modules will lead to a confusing debugging experience. Classpath scanning would be an issue if done blindly (e.g. not scoped to specific packages), but who's actually doing that? And if you absolutely have to have multiple different versions of a dependency, OSGi, while a massive pain, is more lightweight than an actual network boundary.
- lnanek2 10y agoNot only that, but big iron level Java app servers like OracleAS have long been able to have "hidden" dependencies. So your Hibernate dependency can depend on one version of, say, commons-lang, and your Spring dependency can depend on a different version. For many years this had to be done with tools that change the package names, but in modern app servers you can just specify this using configuration and they implement it with special class loaders. Only really causes a problem if your dependency returns instances of its dependency to callers and then your app needs a different version...