I know that this argument is well covered here on S.O., especially in
Why not use an IoC container to resolve dependencies for entities/business objects?
but also in other questions; but doubts remain.
I've used the wording type that collects data and not entity or business object to keep the question focused on principles.
So, if I've a type like this that depends on primitive data like this (or even with more fields):
public class Animal {
private readonly string name;
private readonly string nickname;
private readonly int weight;
private readonly int heightAtWithers:
private readonly Color mainColor;
private raadonly bool isMale;
private readonly bool isAggressive;
public Animal(string name, string nickname, int weight,
int heightAtWithers, Color mainColor,
bool is Male, bool isAggressive)
{
// remainder omitted
}
public string Name { get { return this.name; } }
// remainder omitted
}
is this a case of constructor over-injection?
In Mark Seemann book is suggested to keep low the number of dependencies, 2 to 4 (if I am not wrong).
Is possible that for type of this kind that this anti-pattern does not apply?