This may be a tutorial question, but I'm considering how to develop some classes that abstract the database connection from the RESTful service, which receives the query results.
My thoughts are that to create an interface for the data access layer, then create a top-level class that implements it, and includes any operations that will be used by all databases. Then I will implement specific subclasses of this superclass (adapter).
It seems simple to me, but some of the people I bounced around think it might be harder.
For context, this is Java, and two DBs are MySQL and HBase. We already have data access layer (DAL) classes for MySQL. They do not use hibernation or spring; they build db queries and create POJO instances from the results manually.
So my question has two parts:
1) is it as simple as I think?
and
2) is there a better approach?
source share