Re: About "naive" DI and about architectural powerlessness
Hello, Tom, you wrote: IQ>> Sounds epically and how to be with stateless objects in which one logician and there is no state? For what it DI, if potential time of their life - from start of system to its most finish? Tom> sounds not epically and logically. Whether Statefull or Stateless absolutely does not influence in any way that it is necessary . The only thing on what it influences - lifetime . If it Stateless - it is safely possible to do it singleton th. As to Statefull that it is necessary to understand that for and to whom it belongs. And at you in a head porridge, you mixed different concepts - State, and DI. On a question for what - already , for this purpose what to have possibility to substitute in tests, for this purpose what to make dependence explicit. Again these tests... Incomplete technology of testing in the answer for destruction of brains of a large quantity of developers. Today already there are technologies allowing not to break architecture proceeding from needs of testing. If you read a post undoubtedly would see that I describe a situation when tests in the project is an unrealizable imagination. IQ>> it is amusing))) here for example lifetime db entity is defined it as a rule by a context in one method from loading from a DB before saving in a DB. Here for example there is a lots static methods not having a state. Here for example there are whole services dependence from which and which lives operation business is defined by a context since strongly depends from logic business... Tom> to Ask that of that wanted. And once again I will specify, here your position of the neophyte funny looks. I can argue you the age programmer of years after 40 which simply not could in DI. And already never can. I in a post wrote all - I personally did not meet projects where DI has been used. Alas to me, alas to my office. We rivet business the logic, tons. It can somewhere differently, my post not against DI, and against its usage in the religious purposes. IQ>> it seems To me or your position is more connected to faith questions, than with software development questions? Tom> it seems to you. My position is connected to principles and development experience mission critical systems of operating 24/7 and spread under circuit PaaS. Quality for us crucial. A covering tests for us crucial. I will ask directly - you on what course of institute? Tom>>> 2. Usage DI allows you to define accurately all object dependencies, dependences become explicit and receives them normally in the designer. Differently I would not need to climb on the object code what to understand and on what it depends. It is enough to look in the designer and all becomes clear. Tom>>> 3. At total usage DI in all project in all project the approach is used same standard. Such code to read simply and clearly. And here when here here we make a reverse case new, and here there a static method and here it here we here cause because it is a service (and that such nobody knows service). It precisely delirium. IQ>> at me it is full of experience in area DI. I DI already in three projects therefore as with it architecture of type big ball of mud to become absolutely unsupported. Tom> on what you also I congratulate. further. And to architecture DI has no relation. DI it is small private practice along with a heap of others an expert which are necessary for that what to write the qualitative code. And that you does that is called "macaroni" If you read a post thought what exactly about it there and is written And actually a problem about which I declare that "small private practice DI" owing to the formality, dominates over all other experts. That usage DI does not do architecture automatically good And here . . The code does on the order more verbose and difficult. PS and to architecture DI has no relation. I.e. on yours usage of mechanisms DI does not influence in any way a system architecture?