4 ms·
After 15 years of Java and a proponent of Java APIs I'm no longer sure this standard APIs are a good idea. 1. Most of them are leaky abstractions 2. If you us
by Uchikoma 15y ago
After 15 years of Java and a proponent of Java APIs I'm no longer sure this standard APIs are a good idea.
1. Most of them are leaky abstractions
2. If you use them, you should nevertheless shield yourself from them (See Uncle Bob), so you abstract over an abstraction
3. Because of 1, you need to rewrite your app to the semantic of each implementation of the abstraction (Portlet API, Java Content API JCR).
Case in point: You can use Derby for development and MySQL for production and you will get into trouble as although you use JDBC, the SQL over the wire has different syntax. And using ORM doesn't help you either (JPA), it has the same problems just one meta-level up.
- fleitz 15y agoFully agree in practice one of the best things for SQL database abstraction is an internationalization library, for when the ORM fails, or you need to tune a query.
- jbooth 15y agoYup, I've never seen a designed-by-committee java API that was announced with a list of vendor implementations be anything besides disastrous. They're trying to sell containers as opposed to solve problems. Probably the last one that was any good was the Servlet API. (I guess JPA is ok but it's like take 4 on that particular problem).