Slim Skeleton Data Layer

Recently installed slim skeleton and I am curious about how the local data repository is used.

Basically, I am looking for a simple REST API build. I have it already built in Slim v3, but I like how the skeleton structure and routing is much more comprehensive than my simple Slim build years ago.

I see that it basically grabs the pre-defined data and loads it into the respective class (ie Users) as a example route.

Is this a necessary layer of abstraction if you are querying a db everytime?

Meaning is it necessary to create a “User” class with all the DB parameters and then query the DB, then update the class, etc. Or cant I just query the DB and have it JSON respond?

This skeleton is built with more abstraction in mind. Which enables you to easily swap out components. So yes extra steps are necessary to achieve that abstraction.

thanks for the clarification :+1:

I know I gave a bit of a simple answer but it’s hard to explain in depth how Domain Driven Development (DDD) works in depth. I would suggest reading into Hexagonal architecture so your further understand the principles. Keep in mind that the structure in the skeleton is just a springboard for users to get started and not a fully fledged application.