Tuesday, 3 December 2019

New to Node. What is best practice for models in a layered application?

I am a java developer moving some apps to NodeJS v12. In MVC Java, I usually have my API models, Domain models and Dao models within its own service layer (Controller, Service, Dao respectively).The app I am working on is basically just CRUD req/res. The frontend does transformations from my API models to something else as needed in that department. My question is, since Javascript CommonJS does not use classes as Java does, is it necessary to create models for every layer? or should I just return what I find in the DB as JSON and have the frontend transform it? Or have all transformations moved from frontend to the Node app?

Submitted December 03, 2019 at 11:06PM by MAGICPERF

No comments:

Post a Comment