I'm not an experienced programmer. I always browse the source codes to learn some things. ASP.NET Boilerplate is my favorite one. Yesterday, I noticed there is friendship application service (in service/application layer) and friendship manager (in business/domain layer). I didn't understand why there is friendship manager. Friendship service isn't enough?
public interface IFriendshipAppService : IApplicationService
{
Task<FriendDto> CreateFriendshipRequest(CreateFriendshipRequestInput input);
Task<FriendDto> CreateFriendshipRequestByUserName(CreateFriendshipRequestByUserNameInput input);
void BlockUser(BlockUserInput input);
void UnblockUser(UnblockUserInput input);
void AcceptFriendshipRequest(AcceptFriendshipRequestInput input);
}
public interface IFriendshipManager : IDomainService
{
void CreateFriendship(Friendship friendship);
void UpdateFriendship(Friendship friendship);
Friendship GetFriendshipOrNull(UserIdentifier user, UserIdentifier probableFriend);
void BanFriend(UserIdentifier userIdentifier, UserIdentifier probableFriend);
void AcceptFriendshipRequest(UserIdentifier userIdentifier, UserIdentifier probableFriend);
}