Справка, получающая DI/МОК в доме

Сообщения Erlang являются чисто асинхронными, если Вы хотите синхронный ответ на свое сообщение, необходимо явно кодировать для этого. То, что было возможно сказано, было то, что сообщения в окне сообщения процесса обрабатываются последовательно. Любое сообщение, отправленное в процесс, идет, находится в том окне сообщения процесса, и процесс добирается для выбора одного сообщения от того поля, обрабатывают его и затем идут дальше к следующему, в порядке это считает целесообразным. Это - очень последовательное действие, и получить блок делает точно это.

Похож на Вас, перепутали синхронный и последовательный как chris упомянутый.

7
задан Jon Seigel 18 May 2010 в 03:00
поделиться

2 ответа

I'm working on a project where I can see at least three benefits to Dependency Injection and Inversion of Control:

  1. The flexibility DI and, to a lesser extent, IoC allow as it pertains to unit testing. We can zero in on a particular aspect of code (or system under test) and test this bit of functionality without needing to prep a database table or be subject to the whims of sections of code we're not concerned with at the moment.

  2. Injecting dependencies via IoC is a fairly seamless, automatic thing, and it allows people to work on logic without requiring that the underlying support classes are complete. For example, I can write a web page that shows a list of users without having written any code to retrieve that information from the database. That can be written by someone else, possibly in parallel, so more work can get done in less time.

  3. On one of my current projects, I want to have the ability to demo the web user interface and back-end processing to one of the stakeholders. This is made so much easier by DI and IoC because I can have a collection of fakes that supply the exact data I need to conduct the demo. This way, I'm not freaking out the day before with making sure database tables are populated the way I expect them to be.

DI encourages a loose coupling between a particular class and its dependencies, while IoC allows us to dynamically configure which implementations of these dependencies are injected into classes that use them. The latter is important with respect to #3, because my web application will most be configred with IoC based on settings I've made to the web.config file. I will need to change only that file when we go to production and begin to use non-fake classes.

6
ответ дан 6 December 2019 в 21:17
поделиться

Чтобы назвать несколько конкретных преимуществ:

  • Более чистый код, который несет в себе суть вашей бизнес-логики, а не инфраструктурную толщину
  • DI позволяет вам создавать больше модульных приложений, обеспечение механизма разделения уровней приложения
  • . IoC позволяет осуществлять внешнее подключение / загрузку приложений и обеспечивает централизованное (своего рода) управление ресурсами (в некоторой степени). Вывод - у вас есть больше времени, чтобы сосредоточиться на фактической функциональности / бизнес-логике

Некоторую полезную информацию о IoC и DI можно прочитать здесь: http://www.theserverside.com/tt/articles/article.tss ? l = IntrotoSpring25

Конечно, речь идет о Spring Framework, общие концепции DI все еще применимы.

6
ответ дан 6 December 2019 в 21:17
поделиться