Hello everyone!
There’s a common concern/ discussion I have with my peers and I’d like to collect insights from the community regarding this topic which is: how are you splitting the code between your contexts and schemas?
I’m a little bit more familiarized with DDD applications from my previous experiences as a software architect while the majority of my peers seem to come from a “classic” Rails MVC background. Because of this, I’m facing some challenges trying to articulate properly some architectural concerns regarding our application domain that are not usually implicit to them.
I acknowledge that DDD practices sound sometimes too conservative for people accustomed to a less structured way of building applications. Besides that, it goes without saying that the whole decision-making process becomes a lot harder than it should be because there’s too much convincing going on most of the time (IMHO, this wouldn’t happen if there were more overlapping knowledge in this specific area).
I framed some questions that might help us get this sorted out:
- Are you using schema’s functions to return only Ecto changesets?
- Where are you currently placing your domain/ model/ entity logic?
- Do your schemas deal with “domain/model” concerns or not?
- Are your contexts the only public interface between outside code and your schema?
As a side note: I’m looking for some objective and concrete techniques or concepts you’ve been applying to identify and organize your application logic with Elixir. I say this because I think this information would resonate better with more pragmatic people.
I think you got the gist. Please, feel free to elaborate further if necessary.
My best regards to everyone.