c# - Constructor over-injection with types focused to collect data -


I know that this argument is well here, especially

< P> But in other questions too; But to be suspicious is to stay suspicious.

I have typed the words which collects data and unit or business objects for questions The focus is on principles.

So, if I have one type that depends on it (or even with more fields):

  public class animal {private redone name string; Private redone alias string; Private readonly visceral weight; Private readonly ext. Atwithhers: Private redone color main collar; Private Redoni Bull Malé; Private Redoni Bull is grateful; Public animal (string name, string nickname, int weight, intuitive extractor, color is main color, bull male, boole is absent) {// left omitted} public string name {get {this return.name; }} Left left   

Is this a case of constructor over-injection ?

There are suggestions to keep the book low, the number of dependencies, 2 to 4 (if I'm not mistaken).

Is it possible for this type of anti-pattern not applicable?

IIRC, when the mark negotiator talks about over-injection, then it is in light of violation .

A class that relies on many and many other services which most likely works more than one.
It is not necessary for a class that depends on a lot of antiquities.

After saying this, the data of a primitive data type dependency and "data holder class" are two different things.

Compare your class with the class described in the linked article:
needed top To be able to do your job - this is dependency.
Animals No work The data passed through the constructor is basically the is - the constructor parameter is only this: the data.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -