Axon-trader example: no implementation of unique username constraint

326 views
Skip to first unread message

Paweł Mendelski

unread,
Mar 10, 2013, 3:13:36 PM3/10/13
to axonfr...@googlegroups.com
Hi,

First, thanks for great CQRS framework. 
I really admire your work.
 
On wiki page of Axon-trader example: 
there is said that: 
"When receiving a command to create a new user, 
we first check against a special collection to see if the username is still available. 
After validation we actually create the user."

... but there is no such a logic in related command handler:

Maybe I missed something but I could really use a reference solution for this problem.

Regards,
Paweł

bui...@gmail.com

unread,
Mar 10, 2013, 4:07:21 PM3/10/13
to axonfr...@googlegroups.com
Hi Pawel,

I think you're right about the check missing there. Looks like we forgot to implement that. 

To apply set validation, as this type of 'uniqueness check' is called, you need to create a simple table of used values, in which you add a value when an aggregate is changed. This table is your uniqueness guarantee. 

There is an example in the Addressbook sample. The UnitOfWorkListerner is not needed if you use a transactional datasource. 

Cheers,

Allard
--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages