Class that calls initiates the validation of itself and then initiates the assignment of offers Please see the code below:

public class Customer
{
    public int _iD { get; set; }
    public decimal _salary { get; set; }
    public List&lt;String&gt;_assignedOffers { get; set;  }
    private AbstractValidator&lt;Customer&gt; _validator;
    private IRulesOfferCalculator _rulesOfferCalculator;

    public Customer(AbstractValidator&lt;Customer&gt; validator, IRulesOfferCalculator rulesOfferCalculator)
    {
        _validator = validator;
        _rulesOfferCalculator = rulesOfferCalculator;
    }

    public void AssignOffers()
    {
        ValidationResult results = _validator.Validate(this);
        if (results.IsValid)
        {
            _assignedOffers = _rulesOfferCalculator.CalculateOffers(this);
        }
        else
        {
            _validator.ValidateAndThrow(this);
        }
    }
}


It is a Domain Layer class in a rich domain model.  I have used FluentValidation for the validation. The Service Layer (WFC) creates an instance of Customer and initialises it.

The concern I have is that the class has two responsibilities:


Validate the customer.  If validation fails then thrown an exception.  Validation can fail if the customer is under 21 years old etc  
If validation fails then throw an exception with reason for failure in the exception string.  If validation is successful then assign offers (_assignedOffers  is an instance variable)


I have two questions:


Is it bad practice to throw an exception if validation fails? Is there a better way to notify the user if validation fails?  
Does this class have too many responsibilities i.e. 


validate and 
assign offers.  



Alternatively the Service Layer could call: Validate and then call AssignOffers if Validate is successful.  However, I believe this would make the domain model anemic.

Please be aware that I am building a rich domain model.
Is it bad practice to throw an exception if validation fails? Is there a better way to notify the user if validation fails?


It depends but usually validations return some kind of a validation result.




  Does this class have too many responsibilities i.e. validate and assign offers.


Actually not. They are not the responsibilities of this class. Validation is injected and provided via a service so it's fine.

I would worry more about its design.

The constructor requries two parameters but their corresponding properties are not readonly so you could just use them. More appropriate would to use fields or make the properties get only and private.




public void AssignOffers()
{
    ValidationResult results = _validator.Validate(this);
    if (results.IsValid)
    {
        _assignedOffers = _rulesOfferCalculator.CalculateOffers(this);
    }
    else
    {
        _validator.ValidateAndThrow(this);
    }
}



It's a weird process. It first validates the object and then calculate the offer. The Offer property should be a getter-only property and use the calculator to get the value and the validation should take place where the other properties necessary for the calculation are set because they need to be validated as apparently they can be invalid.