logoalt Hacker News

ajx1001last Wednesday at 4:48 PM0 repliesview on HN

Yes, this is a good description. The way I explain it is that "Ash is a declarative, composable application framework."

It is the middle layer between DB (Ecto) and Phoenix (with or without LiveView) -- where your actual application lives.

The difference between a Resource and a Model (or ActiveRecord) is Models typically define attributes and relationships vs a Resource defines attributes, relationships, actions (read, write, destroy, custom...), behaviours (i.e. multi-tenancy, jobs) and what I call facets (i.e. JSON api, GraphQL).

When you read the code for a Resource, you grok all of this in a nice, consistent way (we have 100* resources - all are consistent). This is because of the DSL.

When compiled, it all boils down to a Struct that you can easily inspect. That Struct enables all kinds of stuff.