karsto / glew

A glorified project generator. Give it some models, out comes a low level api and vue admin ui.
0 stars 0 forks source link

Add service layer in between dal and controller #2

Closed ashtonian closed 4 years ago

ashtonian commented 4 years ago

Refactor the code as it stands and introduce a service layer that services as glue between the dal and controller. Goal is to make the layers more independent and responsible for less, making it easier to change things out and increasing testability. DAL code should just be to fetch data from in/out of store. Controller ideally should just be dealing with input / decoding and basic type validation. Service layer should be glue code and business validation.

[db] -> [dal] -> |service| -> [controller] -> user