Skip to content
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

Show real username #14

Open
marein opened this issue Jun 21, 2018 · 0 comments
Open

Show real username #14

marein opened this issue Jun 21, 2018 · 0 comments

Comments

@marein
Copy link
Owner

marein commented Jun 21, 2018

Problem description
Currently the username "Anonymous" is hard coded everywhere. When a user signs up, their chosen username should be displayed instead. An anonymous user should still be called "Anonymous".

Possible solutions
With the first solution, the contexts are independent. Any context interested in usernames must subscribe to the events from the Identity context. These events (UserSignedUp and UsernameChanged) are applied to the local copies of the respective context. The WebInterface context has nothing todo but to forward the request to the respective context and return the response back to the user. I like the independence of this approach, but its a lot of common duplication. The second approach pushes these responsibilities to the WebInterface context (see below). Following is a diagram of how this process looks like with a closer look to the Chat context.
Solution 1

With the second solution, the contexts can't answer the username question themselves. It's the responsibility of the WebInterface context to assign usernames to the responses. The WebInterface is anyway the intermediate in every conversation. While the contexts are not independent, I think it's okay to couple the username question to the WebInterface context to gain a little less code. Of course, the first solution is more explicit and explicitness wins over "Don't repeat yourself". Following is a diagram of how this process looks like with a closer look to the Chat context.
Solution 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant