Techniques for dependency injection into a domain model -


I have a domain model type I

Can I use the ITRs service in the domain model type constructor I will inject (thereby changing everywhere in such a way ITRanslationService requires one of its many properties. I should be concerned about beginners and it should be obtained through NHibenet), even if it is a type of Small portions (many One of the properties); Or can I use any other functional patterns?

Do anyone have any relevant experience that they can share?

Should I inject the ITRanslationService in the manufacturer of the domain model type

< / Blockquote>

Yes, it may be depending on your situation. If you always avoid injections of services in institutions, then this may have an anti pattern.

Code which needs to be created instantly, using a factory can be saved from additional manufacturer logic. , Which takes care of dependency injection.

NHibernate can also inject services in a single unit through the Creator:


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -