76

Re: About "naive" DI and about architectural powerlessness

Hello, Sinix, you wrote: Curious arguing. S> why on the real scenario ? So your councils do not approach. The context does not have behavior, it on determination  Prompt , and what you here understand "context" as a word?

77

Re: About "naive" DI and about architectural powerlessness

Hello, IQuerist, you wrote: IQ> Prompt , and what you here understand "context" as a word? A class (classes) which store a state of current logical session. The current user, the current transaction, leaking  etc. It was considered the Author: LWhisper Date: 30.05 13:51.

78

Re: About "naive" DI and about architectural powerlessness

Hello, Sinix, you wrote: S> Hello, IQuerist, you wrote: IQ>> Prompt , and what you here understand "context" as a word? S> a class (classes) which store a state of current logical session. The current user, the current transaction, leaking  etc. It was considered the Author: LWhisper Date: 30.05 13:51 recently. Thanks. Clearly. And business of operation you somehow "organize" a context?

79

Re: About "naive" DI and about architectural powerlessness

Hello, IQuerist, you wrote: IQ> Thanks. Clearly. And business of operation you somehow "organize" a context? Depends on the project. Somewhere the variant "all business objects is used form through DI-service, DI-service  in property Manager", DI-service as a matter of fact  by a context. Somewhere implicit dragging of a context through AsyncLocal <T> is used. Beautifully, conveniently, but it is necessary to be very attentive in the infrastructural code unintentionally not to lose a context. In the critical code I such variant yet would not risk to use. Well and in CodeJam. Perftests the variant with dragging by pens of object and storage of services in the dictionary in this object is used.

80

Re: About "naive" DI and about architectural powerlessness

Hello, Sinix, you wrote: S> Hello, IQuerist, you wrote: IQ>> Thanks. Clearly. And business of operation you somehow "organize" a context? S> Depends on the project. Somewhere the variant "all business objects is used form through DI-service, DI-service  in property Manager", DI-service as a matter of fact  by a context. S> implicit dragging of a context through AsyncLocal <T> Somewhere is used. Beautifully, conveniently, but it is necessary to be very attentive in the infrastructural code unintentionally not to lose a context. In the critical code I such variant yet would not risk to use. I thought I one such fan "Local Context" all waited that someone comes and sticks me into it with a nose and tells how to do better but came nobody.

81

Re: About "naive" DI and about architectural powerlessness

Hello, IQuerist, you wrote: IQ> About "naive" DI and about architectural powerlessness yes all is simple, read fashionable books about silver-bulet technologies,  rushes to apply them, without understanding, the end result. The project  to develop  and probably to leave backlogs beforehand in architecture and design. Nothing can appear simply and only at will of creators, all should be justified and confirmed by practical usage. Any technology has restricted area of applications. There are no tests or replaced components,  this DI and all hierarchy of interfaces. And so everywhere. And that in practice is necessary two screw-drivers, and people buy a dial-up  kraftool, with  it is more than subjects 200, in services it use, and we that are worse?

82

Re: About "naive" DI and about architectural powerlessness

Hello, Sinix, you wrote: S> Hello, maxkar, you wrote: S> Why on the real scenario ? So your councils do not approach. The context does not have behavior, it on determination  (we want to give other dial-up of services - we substitute a context) and can give as  dependences, and difinienda in . Disorder otherwise begins: a part we transfer through a context, a part - through DI. Faugh-faugh-faugh And I unless stated, what on the business scenario ? The business task (main objective) just also it is necessary. But here a statement "it is necessary to create service depending on a context" the business task is not. Necessity of transmission of service is an artifact of specific implementation and before the accepted decisions. I suggest not to be focused on how it now poured out in the code. I suggest to look at the business task. And to solve it so that at level of implementation we had not "to create services depending on a context" at all. Yes, it demands sharing revising  and refactorings. Probably, good DI. As a result the task turns out "to provide the necessary dynamic behavior depending on the data without application service lookup or transmissions of services". It is possible to replace "Dynamic behavior" with specific behavior from the program specification. Well and a context... context.logger.info ("Hello, world!" ) Is a behavior of a context or the service transferred through it? I here consider that if it is possible to reach service through a context its behavior is also behavior of a context (or context parts). And transmission of services through a context just adds "" to a context. Disorder in practice normally just also is not present. / the data inherent in a context, it is not enough behavior. It , the user/session. And all remaining  through DI. M>> Well here all is banal. Here directly to the given code refactoring "Tell, Don't ask" is applied. Also it turns out  mentioned S> Well so it angrily in the cleanest type. Instead of explicit sharing  (all initialization - in one method) at us turns out a mash from S> * Actually implementations S> * Wrappers SmartConfirmationService, S> * Substituted factory which will select specific implementation. Not to do copy SmartConfirmationService for other method, say, for GetAdvancedConfirmationService And here last whence? Just in case I will specify that at me services stateless, are created in the beginning of operation of application and more never are deleted. And the dynamic behavior is reached by dispatching. Within the limits of this model the factory just is not necessary. For other method I will transfer another ConfirmationSerivce in the designer of the object containing a method. It can be both in another way configured SmartConfirmationSerivce, and other implementation. I.e. yes, at us through DI can  various copies of one type. And almost any "DI Framework" that's it is not able to do it. The factory normally arises just in this case - many copies are necessary, but  all objects identify only on types. There it is necessary to do one factory which will solve this () a problem. And me it is not necessary to solve it, at me in methods those services which are necessary to them are accessible exactly. Without everyones lookup. S> Here this approach "we do not look at a real problem, we can in patterns" is initially vicious, since it leads to wild recomplication of the code out of the blue. On the same example I will explain. No, is not present so. I am not engaged in activity in a type "we here to myself invented problems and now heroically them we solve". I prefer to cut at once a source of problems and to solve business tasks a convenient method. If a source of problems DI Framework - the worse for it. S> Besides a heaping of types we have one more jamb: we prolong lifetime of dependences - in original code Consumer was necessary only for obtaining of specific implementation, it is possible to transfer only implementation further. S> at you consumer it is necessary to drag further. , we remember consumer through designer SmartConfirmationService. No. We do not remember. Normally all services are created on start of application and live before its end. All remaining (including Consumer) - parameters. Services whenever possible effectively immutable/stateless. They do not have methods "to see their internal state". Just immutable, more difficult things like caches - yes, there it is necessary to do absolutely typical service accurately. Parameters of methods normally too immutable. And all changeable state - only in persistense services (it is not important, basis there or in memory service). Therefore parameter dragging - not the big trouble. Plus all artifacts in sharing  it is visible. If we need to drag somewhere transitively dependence, at us possibly problem with determination  various components and it is necessary . S> All? : at us a bug: consumer  if it to change not that service suddenly comes. S> Ok, we define the necessary service at once, in the designer... And we appeared in an idiotic situation: The recomplicated code which as a matter of fact hides call GetConfirmationService in separate object. Hurt architecture. Here such there it will not be exact. At services lifetime is normal much more, than lifetime of parameters (requests, etc.) . Therefore through designers to them only other services are transferred. And here interfaces of services and the general sharing  become so that superfluous parameters it was not necessary to transfer and that superfluous parameters transit through services not to drive. Closings on parameters  sometimes for difficult algorithms, but they always  a detail of implementation of a component also are not a part public API. If it was legacy, it rises in queue on refactoring. To immutable and a construction of services only on application start. M>> and here to get interfaces in a place "implementation insertions" - good. Well, there will be many small interfaces, will be Interface Segregation. S> Well, that's it about it I also spoke. Accurately to think over API - is not present,  the "correct" code wrappers in a place, even breaking architecture - yes. Not,  a taste question certainly, therefore even I will not argue And what "correct" means? Here is how it turned out, what at "accurately thought over API" the component had a duty which it cannot fulfill without the crutches nobly transferred to it in a call? Perhaps with allocation of duties (well and change API, yes) something not and should be changed it? I agree that "if because of architecture at us turns out difficult/not intuitive/causing questions API - in a fire chamber such architecture". By the way, even "architecture" in the given place can be treated differently. If it "rules , writing of classes and other ceremonies" - yes, it has no special value. For me the architecture is first of all high-level allocation of duties between components. Therefore any problems and nonoptimality at level API is only a consequence of problems with the selected architecture. Well and yes, it needs to be changed in that case because it does not correspond to real tasks.

83

Re: About "naive" DI and about architectural powerlessness

84

Re: About "naive" DI and about architectural powerlessness

Hello, Cyberax, you wrote: a C> I inside Amazon' work in cloud computings. One and a half-two years ago just read about a player  under , there were huge branches at forums with  users and an estimation in  . Then it was possible to take in hands one of , with the color screen on which this player could be tortured. In five minutes I "broke" it - ceased to display posters to descriptions of films and still something fell off. Then asked at  which supervised over one of projects on development of this player as they test - the answer was that only a unit tests and any manual tests. At that point in time this information sufficed to generate judgement why at  it is is specific this player such .... <<RSDN@Home 1.0.0 alpha 5 rev. 0>>

85

Re: About "naive" DI and about architectural powerlessness

Hello, ilvi, you wrote: I> Hello, Cyberax, you wrote: a C>> I inside Amazon' work in cloud computings. I> One and a half-two years ago just read about a player  under , there were huge branches at forums with  users and an estimation in  . Then it was possible to take in hands one of , with the color screen on which this player could be tortured. In five minutes I "broke" it - ceased to display posters to descriptions of films and still something fell off. Then asked at  which supervised over one of projects on development of this player as they test - the answer was that only a unit tests and any manual tests. At that point in time this information sufficed to generate judgement why at  it is is specific this player such . I had an acquaintance,  from a birth, in his hands the software simply burned  with a flame "dialogue" with it when it simply tore, already repeatedly  UI to parts, caused powerless fury and a worship for genius simultaneously.

86

Re: About "naive" DI and about architectural powerlessness

Hello, IQuerist, you wrote: IQ> I had an acquaintance,  from a birth, in his hands the software simply burned  with a flame "dialogue" with it when it simply tore, already repeatedly  UI to parts, caused powerless fury and a worship for genius simultaneously. This Author (: Anton Zlygostev aka Sinclair Date: 6/24/2004 This Thursday differed nothing from the normal. Hours with 12 I started to feel simply intolerable desire to find an occasion . Therefore when in  the question of the chief "floated do not want  testers?", I long did not think...?

87

Re: About "naive" DI and about architectural powerlessness

88

Re: About "naive" DI and about architectural powerlessness

Hello, Sinclair, you wrote: S> Hello, IQuerist, you wrote: IQ>> I had an acquaintance,  from a birth, in his hands the software simply burned  with a flame "dialogue" with it when it simply tore, already repeatedly  UI to parts, caused powerless fury and a worship for genius simultaneously. S> this Author (): Anton Zlygostev aka Sinclair Date: 6/24/2004 This Thursday differed nothing from the normal. Hours with 12 I started to feel simply intolerable desire to find an occasion . Therefore when in  the question of the chief "floated do not want  testers?", I long did not think...? Well nevertheless not on so much brutal))) however... Once it opened  a keg of beer with an axe ignoring the regular easel, to admit then I did not give it value.

89

Re: About "naive" DI and about architectural powerlessness

90

Re: About "naive" DI and about architectural powerlessness

I understand now that shit liters on me from those who pour down did not master and did not understand sense DI but I will try to answer. Personally for itself drew a simple output, DI it is not required only for objects in which there are no logicians, i.e. POCO. All remaining - DI. The reasons here a little and all of them are obvious enough and chewed not by me and in darkness of video describing which problems solves DI but I once again oh will describe. 1. When tell about usage DI that in 99 % of cases DI use together with the container. And sense of the container not only in provision of dependences and in control of object lifetime. Delegation of control of life  to the container - one of the most basic things. 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. 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. As a whole at the author while usage DI is simple not enough experience and DI for it the new concept at passage to which absolutely naturally arises a heap of questions and normal tearing away. So at everything, it is normal.

91

Re: About "naive" DI and about architectural powerlessness

IQ> Imho of the main thing is not written - the maniacal passion to IOC imposed by early implementation DI provokes violation of all principles SOLID. You with SOLID would understand and did not write bosh. Tell to me as DI at us spoils S or I I any more do not speak about D

92

Re: About "naive" DI and about architectural powerlessness

93

Re: About "naive" DI and about architectural powerlessness

94

Re: About "naive" DI and about architectural powerlessness

95

Re: About "naive" DI and about architectural powerlessness

Hello, Tom, you wrote: IQ>> Imho of the main thing is not written - the maniacal passion to IOC imposed by early implementation DI provokes violation of all principles SOLID. Tom> you with SOLID would understand and did not write bosh. Tell to me as DI at us spoils S or I I any more would not tell about D you a post,  esteemed...

96

Re: About "naive" DI and about architectural powerlessness

Hello, Tom, you wrote: Tom> I Understand now that shit liters on me from those who pour down did not master and did not understand sense DI but I will try to answer. Tom> personally for itself drew a simple output, DI it is not required only for objects in which there are no logicians, i.e. POCO. 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> All remaining - DI. The reasons here a little and all of them are obvious enough and chewed not by me and in darkness of video describing which problems solves DI but I once again oh will describe. Tom> 1. When tell about usage DI that in 99 % of cases DI use together with the container. And sense of the container not only in provision of dependences and in control of object lifetime. Delegation of control of life  to the container - one of the most basic things. Funny))) 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... It seems To me or your position is more connected to faith questions, than with software development questions? 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. . Accurately to define dependences it is exceptional within the limits of specific implementation DI which qualitatively more primitive, than there can be frames operation business. Actually, when DI it ceases to be used by beginners only for  methods, problems with it connected and start to float. 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. And you did not reflect whence the understanding what there is a service and what is not present on project start can undertake? And after all DI religious fanatics start to use right at the beginning. Ah yes... Tom - "All remaining - DI." I.e. generally all directly from the start also is the purpose for DI... Colonoscopy Injection  in general my post just about it. Tom> as a whole at the author while usage DI is simple not enough experience and DI for it the new concept at passage to which absolutely naturally arises a heap of questions and normal tearing away. So at everything, it is normal. 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.

97

Re: About "naive" DI and about architectural powerlessness

98

Re: About "naive" DI and about architectural powerlessness

99

Re: About "naive" DI and about architectural powerlessness

Hello, IQuerist, you wrote: IQ> Hello, Tom, you wrote: IQ>>> Imho of the main thing is not written - the maniacal passion to IOC imposed by early implementation DI provokes violation of all principles SOLID. Tom>> you with SOLID would understand and did not write bosh. Tell to me as DI at us spoils S or I I any more would not tell about D IQ> you a post,  esteemed... I read a post, in difference from you. To you clamped a specific question what exactly and how from SOLID breaks DI. You merged...

100

Re: About "naive" DI and about architectural powerlessness

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? 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. Tom>> All remaining - DI. The reasons here a little and all of them are obvious enough and chewed not by me and in darkness of video describing which problems solves DI but I once again oh will describe. Tom>> 1. When tell about usage DI that in 99 % of cases DI use together with the container. And sense of the container not only in provision of dependences and in control of object lifetime. Delegation of control of life  to the container - one of the most basic things. 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... 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. IQ> it seems to me or your position is more connected to faith questions, than with software development questions? 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. 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. IQ> . Accurately to define dependences it is exceptional within the limits of specific implementation DI which qualitatively more primitive, than there can be frames operation business. Actually, when DI it ceases to be used by beginners only for  methods, problems with it connected and start to float. . You learn to write harmonously and clearly. And that at you porridge not only in a head and and in messages. And when write be accurately defined what exactly want to tell. 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> and you did not reflect whence the understanding what there is a service and what is not present on project start can undertake? And after all DI religious fanatics start to use right at the beginning. Ah yes... Tom - "All remaining - DI." I.e. generally all directly from the start also is the purpose for DI... Colonoscopy Injection  in general my post just about it. Tom>> as a whole at the author while usage DI is simple not enough experience and DI for it the new concept at passage to which absolutely naturally arises a heap of questions and normal tearing away. So at everything, it is normal. 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. 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"