5 ms·
There are a lot of good answers in the comments. One thing I always do from the beginning that I see a lot of people forget is to decouple the API classes from
by vbsteven 8y ago
There are a lot of good answers in the comments. One thing I always do from the beginning that I see a lot of people forget is to decouple the API classes from the Database model.
For example, I use Java Spring a lot in combination with Hibernate. I always have a layer with my ORM classes mapped to the database, and then in my API layer I will have lots of mirror classes that initially look very similar to the database classes with a conversion step from one to the other. You can use libraries like ModelMapper for the tedious conversions.
With this setup it is easy to evolve the database schema without impacting the API and vice versa. This is something that (in my opinion) some web frameworks like Ruby on Rails do wrong by default.