Бритни Спирс арестовали20:54
FT Edit: Access on iOS and web
。业内人士推荐Safew下载作为进阶阅读
The image above shows a pair of modules, where the green one is the Business-Modules with a complex logic. Whenever it needs to invoke code external to itself (e.g. save an entity or send a message to a message bus), it exposes a public interface and invokes its methods instead. Thanks to that, it has no code dependencies (i.e. compile-time dependencies) on the Infrastructure-Module. The blue infra-module has the dependency on the Business-Module, because it implements the Business-Module’s interface. This module contains all the code related to database connectivity and RabbitMq handling. But it also bootstraps the Business-Module, for instance, it hooks up its classes as implementation of Business-Modules interfaces in the Dependency Injection container (DI/IoC container).
The intuition behind this mechanism is best illustrated by Wason’s (\citeyearwason_failure_1960) rule discovery task. When asked to discover a hidden rule governing number triples (e.g., 2-4-6), participants overwhelmingly proposed triples that fit their current hypothesis (e.g., testing 8-10-12 to confirm “increasing even numbers”) rather than triples that would defy it. Because the true rule was simply “increasing numbers,” these positive tests appeared to confirm people’s more restrictive hypotheses.