devconnector_2.0 icon indicating copy to clipboard operation
devconnector_2.0 copied to clipboard

Adding more backend encapsulation for User model

Open NguyenDa18 opened this issue 4 years ago • 5 comments

Inspired by Brad's design in his NodeJS API Masterclass with Express & MongoDB.

NguyenDa18 avatar Aug 16 '20 07:08 NguyenDa18

Hi @NguyenDa18 looks good to me but I'm wary of changing code from course code that doesn't need fixing. The code as is works just fine and has no issue. I think unless it's solving some issue in the Udemy course then the code should probably stay closer to what the students see in the course?

bushblade avatar Aug 16 '20 09:08 bushblade

@bushblade I thought that was what the originalcoursecode was for, and there are some examples of refactoring in the master branch that make the app better -this change also demonstrates good practices that Brad used in his Node API class.

NguyenDa18 avatar Aug 17 '20 02:08 NguyenDa18

True but all of the refactors so far have solved issues or bugs. If we refactor to represent the node course then how far do we go? Should we implement separate controllers? Error handling middle ware? I'm not sure. I think the code still needs to be kept reasonably close to the course. I know Brad is planning on updating the course at some point so I'm sure he would adopt the architecture from the node course then. I won't close though as I don't feel I can make a solid decision here, perhaps it should be left to Brad to decide?

bushblade avatar Aug 17 '20 06:08 bushblade

@bushblade Sounds good. Those suggestions sound good as well -implementing separate controllers and middleware like we do in the Node API course. You can just keep the PR open -thanks

NguyenDa18 avatar Aug 17 '20 17:08 NguyenDa18

No worries.

bushblade avatar Aug 17 '20 18:08 bushblade