Two Kinds of Abstractions
When someone talks about abstractions, they’re usually trying to make the software more flexible. But that’s usually one of two kinds of abstractions. Build an abstraction to hide an implementation Abstractions that hide implementations are more commonly touted as good designs. Ruby’s Faraday abstracts the specific HTTP library implementation. Rails’ ActiveRecord abstracts the SQL you need to write to interface with a relational database. The Data Mapper Pattern abstracts the persistent storage from your application. ...