<commit_before>#Task 13: Microsoft Unity And Invalid Dependencies Between Parent And Child Container

## Dependencies between parent and child container

* In general you can have setup anything in child container to depend on
  anything on parent container which is perfectly valid.
* Unfortunately it is possible to get into oposite situation when you setup
  a dependency in parent container which will get injected a child container
  depedency.

  This has some related issues:

  * If you resolve the parent depedency the injected reference depedens on used
    child container and its configuration.
  * In the case that such depedency is a singleton the injected dependency will
    come from first used child container.
  * And even more - if the dependency in child container is a disposable object
    the injected object may become invalid during the child container disposal.

* You may check [https://github.com/voloda/UnityRegistrationValidator](https://github.com/voloda/UnityRegistrationValidator)
  to see how you can try prevent this.

## How to start?

1. The project is currently using constructor injection.
   * Since the registrations are very simple project does not have 
     any ```Bootstrapper```.
2. Get familiar with project 130_UnityDependencyOfRootOnChild.
3. The project sets several thread to run some complex operation using a remote
   service which construction takes a lot of time.<commit_msg>Fixed wording in README.md<commit_after>#Task 13: Microsoft Unity And Invalid Dependencies Between Parent And Child Container

## Dependencies between parent and child container

* In general you can have setup anything in child container to depend on
  anything on parent container which is perfectly valid.
* Unfortunately it is possible to get into oposite situation when you setup
  a dependency in parent container which will get injected a child container
  depedency.

  This has some related issues:

  * If you resolve the parent depedency then the injected reference depedens on used
    child container and its configuration.
  * In the case that such depedency is a singleton the injected dependency will
    come from first used child container.
  * And even more - if the dependency in child container is a disposable object
    the injected object may become invalid during the child container disposal.

* You may check [https://github.com/voloda/UnityRegistrationValidator](https://github.com/voloda/UnityRegistrationValidator)
  to see how you can try prevent this.

## How to start?

1. The project is currently using constructor injection.
   * Since the registrations are very simple project does not have 
     any ```Bootstrapper```.
2. Get familiar with project 130_UnityDependencyOfRootOnChild.
3. The project sets several thread to run some complex operation using a remote
   service which construction takes a lot of time.
{'fraction_non_alphanumeric': 0.037820957668285915, 'fraction_numerical': 0.005551700208188758, 'mean_word_length': 4.241818181818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2354801', 'n_tokens_mistral': 686, 'n_tokens_neox': 642, 'n_words': 387}