5 ms·
As many people seem confused, it seems that this framework is a declarative framework (think: expressing a solution like you would in SQL or Prolog), in Elixir,
by PaulRobinson 1y ago
As many people seem confused, it seems that this framework is a declarative framework (think: expressing a solution like you would in SQL or Prolog), in Elixir, that seems to have the goal of separating out core logic from control flows within web apps, APIs and so on.
Over the course of 15+ years of playing with Rails, I've come to the view of CRUD being a poor choice for most real-world applications and MVC being a useful but often-abused concept. That took me down a bit of a rabbit hole of trying to think about DDD within the constraints of an opinionated framework that thinks CRUD and MVC are the thing that makes you go fast. I, on the other hand, want the thing that makes it easy to extend and maintain. I want actual events to be modeled for all sorts of real-World reasons.
I've been learning Elixir recently because it's something new, the actor model appeals from a concurrency perspective to some of the problems I want to solve, and because Phoenix looks like an interesting and elegant web app framework. However, there was a nag in the back of my head that I'd just end up hitting the same frustrations: I was, and am, ready for that and seeing if anything about Elixir + Phoenix makes life easier than Rails made it.
Ash seems to be a good candidate for part of the puzzle. A declarative framework that brings some packages for useful, often-needed parts of the puzzle (like authentication, authorization, and so on), and it seems to encourage a way of thinking about some key DDD concepts. Resources sound like domains or bounded contexts. Declarative style sounds like it might lend itself to event modeling more easily. Calculated values are a nudge towards "view models".
Never tried, I'm early on my journey, but I think the Ash book will be the first thing I pick up after I've finished the Elixir and Phoenix books I'm reading through. Curious to hear stories from people further down this journey, though!
- evnp 1y agoAppreciate these thoughts. Would you mind sharing what Elixir and Phoenix books you're working through?
- hibbitybibbity 1y agoYou sound a lot like me when I first approached Ash a year ago, especially the part about being new to Elixir and worrying I'd just reproduce my prior MVC frustrations (Laravel in my case) in Phoenix. I've been using Ash for about a year now and it's really hit the spot. Wishing you well on your journey!
- weego 1y agoI'm planning on trying ash at the weekend when I have time, but right now it's still a little nebulous to me. Have you found a boundary where you end up just being constrained and you're just back to normal phoenix dev?
- hibbitybibbity 1y agoNot really because Phoenix handles the web layer while Ash handles the domain/application layer. In other words Phoenix provides one interface, of potentially many, through which users could access an application built in Ash. Which is all to say if there's been something I couldn't figure out in Ash I've tended to put it into a regular Elixir module rather than anything Phoenix-specific. The only exception I can think of is that AshAuthentication doesn't provide support for API keys out of the box, so I have ended up writing my own little plugs for that. If you are just getting started I'd strongly recommend working through tutorials and/or the Ash book (it's in beta but pretty solid) rather than just diving into a project. It's a lot when you're first wrapping your head around it.
- borromakot 1y agoWe just launched an api key strategy `mix ash_authentication.add_strategy api_key`
- hibbitybibbity 1y agoOh baller