4 ms·
Here's an example from the Wolkenkit brochure: > user.login({ login: 'user', password: 'secret'}); > const isUserLoggedIn = user.isLoggedIn(); If you look at
by victorNicollet 9y ago
Here's an example from the Wolkenkit brochure:
> user.login({ login: 'user', password: 'secret'});
> const isUserLoggedIn = user.isLoggedIn();
If you look at this purely from an API design point of view, this stinks: by forcing the command to return void, the code ends up twisting its design to return the result of the command through an artificial channel (the state of the 'user' object). In the end, we are still interested in "the result of the login attempt", and the easiest way to do this would be a function that returns a value:
> const isUserLoggedIn = user.login({ login: 'user', password: 'secret' });
- gregyoung1 9y agoWhy are you using CQRS for logins? Nothing says derp like "we rolled our own security system"
- victorNicollet 9y agoThat is a question worth asking, but I don't think it changes the underlying point.