Hello.
I have a node typescript back-end.
I am trying to build an angular application, following SOLID principles.
I am wondering, how would you architect logic based around http calls. This
is how I did for the fonctionality below
User Login processus:
- *UserHttpClient* performs JWT request on back-end
- Is placed next to a *JwtRegisterRequestBody*, and a
*JwtRegisterResponse*, which are copies of what back-end waits for /
returns.
- *UserConnector*, calls *UserHttpClient* to send the request, then
register user in application state
- Waits for a *UserLogin*, which is a class with username/password
fields (just as my *JwtRegisterRequestBody*)
- *UserLoginComponent* presents the form and uses UserLogin as form data.
- Will call *UserConnector* to connect
This seems strongly use-case-typed and therefore flexible to any
particularity i would encounter. Like having to add a field in UserLogin
which would be unnecessary for the back-end.
*What do you think about this ? Would you do it (for every http call you
will have to make), otherwise how would you architect it ? *
I am also thinking that in my processes, I could get ride of the custom
HttpClient, and build something generic. If it doesn't present too much
cons.
Thank you,
(Also, version 6 of Angular used)
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.