I'd like to start DDDDomain-Driven-Design, but there are several problems I'd like to solve before starting :)
Let's imagine I have a Groups and Users and when user wants to join a group, I'm calling groupsService.AddUserToGroup(group, user) method. In DDD I should do group.JoinUser(user), which looks pretty good.
The problem appears if I there are some validation rules for adding a user, or some external tasks need to be started when user is added to the group. Having these tasks will lead to the entity having external dependencies.
An example could be - a restriction that user can only participate in 3 groups max. This will require DB-calls from inside group.JoinUser method to validate this.
But the fact that an Entity depends on some external services/classes doesn't seem so good and "natural" to me.
What's the proper way to deal with this in DDD?