# Extension methods for various backends

**URL:** <https://discourse.julialang.org/t/extension-methods-for-various-backends/129401>\
**Category:** Visualization\
**Tags:** plots, makie, package-extensions\
**Created:** [May 28, 2025, 9:17am UTC](https://discourse.julialang.org/t/extension-methods-for-various-backends/129401 "2025-05-28T09:17:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weymouth](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/weymouth/32/15839_2.png) [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Post date:** [May 28, 2025, 9:17am UTC](https://discourse.julialang.org/t/extension-methods-for-various-backends/129401/1 "2025-05-28T09:17:02Z")

</div>

We are using Makie to build up some plotting extensions for a few packages, but we have older extension methods for Plots as well. If the user only have Plots or only has Makie, everything works, but what if they have included both in the session? Is there a way to set a default?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [May 28, 2025, 10:00am UTC](https://discourse.julialang.org/t/extension-methods-for-various-backends/129401/2 "2025-05-28T10:00:08Z")

</div>

I would say the methods that you extend should not be exactly the same in both extensions, overwriting each other if both are loaded. You could put one more argument in which is just a singleton like `Val(:Plots)` or `Val(:Makie)` and then you have a `Ref` or so in your main module which the extensions set to their own symbol on init. Then if both are loaded, it depends on the loading order which one is active, but at least the user could still do `YourPackage.use!(:Makie)` or something. So `someplot(args...)` that the user calls would dispatch first to `someplot(ACTIVE_BACKEND[], args...)`.
