Code interface vs domain resource block

I’ve read the docs a few times and I can’t tell whether code interfaces are recommended in Ash 3. I seem to remember that they are a vestige of previous versions but I don’t see any mention that they are deprecated or discouraged. Is there something that code interfaces can do that I can’t do in a domain resource block?
Solution:
I don't really use it as well. I mostly just think about them as functions
Jump to solution
6 Replies
sevenseacat
sevenseacat3mo ago
define functions on the domain or resource module for your actions they're not deprecated or discouraged at all
ZachDaniel
ZachDaniel3mo ago
They are both code interfaces. just changes which module you call them on. use the domain one if you aren't sure
barnabasj
barnabasj3mo ago
I use domain for actions that should be callable from outside the domain and resource for actions that should only be called internally of the domain
Terris
TerrisOP3mo ago
I currently don’t use the phrase “code interface” in my code. I know conceptually I’m defining a code interface in the domain module. I’m really asking about the dialect, especially what I can ignore without FOMO
Solution
barnabasj
barnabasj3mo ago
I don't really use it as well. I mostly just think about them as functions
Terris
TerrisOP3mo ago
When I tried to vibe code it with usage rules, Claude literally created a code interface and I changed it to “regular” functions (inside a resource block so not exactly vanilla Elixir), but I didn’t necessarily know what I was doing either

Did you find this page helpful?