Answer the question
In order to leave comments, you need to log in
Is this architecture correct?
Prompt, please, who understands patterns and DDD.
In the context of Symfony.
situation:
It is necessary to work with comments. Create comments on the API, give on the API
in order to create a comment, you only need the text of the comment, and the id of what we are commenting on, 2 fields.
To do this, I created a model
CommentNew {
text;
commentable;
}
CommentView {
text;
commentable;
id;
author: UserObject;
time;
files: LinksList;
}
Answer the question
In order to leave comments, you need to log in
And the symphony has some kind of tactics and it must be followed. ("best practices Symfony API").
CommentNew is not needed at all, according to this ideology, then it will be necessary to create both CommentUpdate and CommentDelete and even CommentLike with CommentDislike - as you can see, these are all API methods, they just need to be validated for the required fields and passed to the required Comment method. And Comment will already return CommentView.
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question