Skip to main content
20 events
when toggle format what by license comment
Jul 9, 2023 at 9:22 vote accept Fred Hors
May 2, 2023 at 12:00 history bumped CommunityBot This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Apr 2, 2023 at 11:10 answer added amon timeline score: 3
Apr 1, 2023 at 15:13 comment added user1937198 @RikD Where rust becomes specifically relevant is that its generally considered a smell in rust to have mutable state. So having a mutable field for current transaction in your repository would be discouraged for example.
Apr 1, 2023 at 14:25 comment added user1937198 @rikd if you just have addplayer check of it's allowed, there's a possibility for RMW interleaving to allow 2 players to be added to a team. Something has to ensure that when writing back to the persistence layer we still have a view consistent with when we read it.
Apr 1, 2023 at 14:21 comment added user1937198 @RikD so are you suggesting that the answer is have a a single global repository? Or one respository per combination of datasets needed? How does that scale to more complex apps?
Apr 1, 2023 at 11:56 review Close votes
Apr 6, 2023 at 3:03
Apr 1, 2023 at 11:33 comment added Rik D I’ve read all text but not the Rust code and external links. That shouldn’t be necessary to understand the question. Perhaps you can rewrite the question so it’s clear what you’re actually asking?
Apr 1, 2023 at 10:25 comment added Fred Hors @user1937198 do you know how can I do?
Apr 1, 2023 at 10:25 comment added Fred Hors I think you didn't even read the question, @RikD. You're repeating things I've already written. I just don't know HOW to do them.
Apr 1, 2023 at 8:38 comment added Rik D So basically, remove the business logic from services and move it up a layer to domain.
Apr 1, 2023 at 8:37 comment added Rik D The application service is responsible for handling a command, by fetching the appropriate aggregate from the repository, then invoke a method on the aggregate and finally save the changes.
Apr 1, 2023 at 8:34 comment added Rik D An Aggregate is a consistency boundary, for example Team. Within team there is a collection of players. When AddPlayer is invoked on Team, check if it’s allowed. Team can be tested without database. The TeamRepository returns a team, fully loaded with players.
Apr 1, 2023 at 2:46 comment added user1937198 @RikD Taking the example, how would you test that if two players are added to the team at once, only one gets added? Lots of properties are pretty heavily tied into the persistence layer.
Apr 1, 2023 at 0:13 comment added Fred Hors Do you have any solution?
Mar 31, 2023 at 23:40 comment added Fred Hors Yeah. Your sentence is exactly the reason for my question! LOL
Mar 31, 2023 at 23:20 comment added Rik D Testing business logic will be a lot easier if it does not depend on the database, either directly or indirectly using an interface.
Mar 31, 2023 at 22:22 comment added cafce25 This has been crossposted on Stack Overflow
S Mar 31, 2023 at 22:06 review First questions
Apr 3, 2023 at 7:04
S Mar 31, 2023 at 22:06 history asked Fred Hors CC BY-SA 4.0