3 ms·
Servlets, for example, is a little gem of coherent abstraction It's a little gem of a memento of Sun's 'write an API for everything in a hurry and hope it stic
by pvg 9y ago
Servlets, for example, is a little gem of coherent abstraction
It's a little gem of a memento of Sun's 'write an API for everything in a hurry and hope it sticks' insanity and greed back in the day. The very 'Servlet' interface is supposed to be some sort of generic (possibly stateless) server-side component. All it is actually good for and used for is http, the 'Servlet' interface itself is a completely pointless layer of abstraction.
Servlets are the widely deployed and used standard with multiple high-quality implementations but let's not kid ourselves that the thing itself is some kind of pinnacle of sensible, let alone good API design.
- HelloNurse 9y agoCalling the Servlet interface "a completely pointless layer of abstraction" only because in practical use nobody ever cared for anything but HttpServlet is unfair. It's a reasonable, natural and correct abstraction that, at the very least, helps distinguishing HTTP specific features from general purpose ones.
- pvg 9y agoHow is it unfair? The fact that nobody uses it and that it has found no use for the decades it's been around is the very definition of 'pointless layer of abstraction'. It was written in a period of an API land grab. A reasonable and natural thing is to be suspicious of an abstraction that has no use or precisely one real use.