# Dry-system: adding aliases for components

**URL:** <https://discourse.dry-rb.org/t/dry-system-adding-aliases-for-components/1189>\
**Category:** Support\
**Created:** [January 28, 2021, 1:13pm UTC](https://discourse.dry-rb.org/t/dry-system-adding-aliases-for-components/1189 "2021-01-28T13:13:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rickenharp](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/rickenharp/32/12_2.png) [@rickenharp](https://discourse.dry-rb.org/u/rickenharp)\
**Post date:** [January 28, 2021, 1:13pm UTC](https://discourse.dry-rb.org/t/dry-system-adding-aliases-for-components/1189/1 "2021-01-28T13:13:30Z")

</div>

After reading the dry-container docs, especially [the part about customization](https://dry-rb.org/gems/dry-container/0.8/registry-and-resolver/#customization), I wanted to add something similar to the CustomResolver example.  
The idea behind that was, that if you have multiple different implementations for a dependency that can be swapped out, it would be nice to have something like an alias, so that you can write `include Import["strategy"]` in your class, and have a configuration in the container that has a map from “strategy” to “strategies.depth\_first” or “strategies.breadth\_first”.  
The naïve approach I tried was just using the CustomResolver, but it seems as though this only works for a finalized container. Diving a bit deeper into the code, it looks to me as if the Booter might be the best place to put this logic?  
Or is there maybe already a way to this with the existing code, that I have just overlooked?

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [February 4, 2021, 5:51am UTC](https://discourse.dry-rb.org/t/dry-system-adding-aliases-for-components/1189/2 "2021-02-04T05:51:56Z")

</div>

I’d hold off until @timriley is done with his recent refactorings because chances are, it’s gonna be easy to implement in the next version of dry-system. We’re getting very close to 1.0.0!

---

<div class="post-metadata">

**Author:** ![rickenharp](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/rickenharp/32/12_2.png) [@rickenharp](https://discourse.dry-rb.org/u/rickenharp)\
**Post date:** [February 4, 2021, 10:01am UTC](https://discourse.dry-rb.org/t/dry-system-adding-aliases-for-components/1189/3 "2021-02-04T10:01:45Z")

</div>

I just looked at that refactoring, and it looks _amazing_. Thanks for the pointer, this might make a lot of things I wanted to try with dry-system easier/possible!

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [February 12, 2021, 6:05am UTC](https://discourse.dry-rb.org/t/dry-system-adding-aliases-for-components/1189/4 "2021-02-12T06:05:08Z")

</div>

@rickenharp yes exactly, this is an unexpected turn of events because originally we thought dry-system 1.0.0 will be more-or-less the same but @timriley absolutely killed it and so 1.0.0 release will be epic 😃
