-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] (Server) Decouble DB from routes (from domain logic) #79
Comments
Thanks for the thorough issue, this is a great idea. I just overlooked it while hacking together the initial version /: Do you want to start an initial conversion starting in #76? Or maybe we should do it before more work is done there? P.S. If you want to stay connected in IRC I can give you an account on my thelounge.chat instance. Send me an email at [email protected] if that's something you'd like. |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I actually wanted to propose a slightly different change, and decouple the controller with the database.
Right now tests are very slow because they spool a whole DB, and any new changes will be very
sequilize
bound. Maybe it's because I don't really likesequalize
, but I would like to have the domain logic (e.g.: hashing the password, or failing if there are no file) to live outside theclass Post extends Model
and leave the currentPost
class as a mere DTO to the databaseCurrent implementation
Lets explore how one route would change.
/posts/create
is a big ofender:Proposed implementation
We can then discuss how to implement the dependency injection mechanism of the
postService
.The text was updated successfully, but these errors were encountered: