In my domain layer, I have a class called "Client". Normally, I would create properties directly related to this client in the class, for example, "First Name", "Last Name", "Address", etc., As well as methods related to the client.
My question is, will it be a bad OO design to add a method to this class that does work with a collection of clients?
eg. - let's say that there is an operation that I want to perform on the Client, for example, updating my email address. Before I do this, I want to make sure that there are no other clients with the same email address, so I am creating a method from the Client class called ValidateEmail (line emailAddress).
Inside this method, the Clients repository is requested for any existing client with this email address and returns a boolean value.
Would this be considered a poor OO design? I would prefer not to create any other classes or fill in the logic of the UI controller level with this check and it seems to match the Client class, but it seems that performing operations with siblings is not entirely correct.
thanks
Grant source share