Feedback for "DDD Chapter 5: Implementing Simple Business Logic - Part 1"

Background

I have recently released a video about the Transaction Script, and I use Elixir for the code samples and to get the point across:

I would like to get some feedback and opinions on how to improve it and if there was anything extra you think I could add in order to make it more appealing to both the Elixir community and general public.

Next chapter will be about Active Record, so if you also have something you think is relevant to it, I would be happy yo give it a read and see if/how it fits with the general concept.

I only skimmed over it, because TBH 20+ minutes on transaction script is a lot to ask - but also I’m probably not a target audience. Here are my comments:

  • The usage of Elixir seems largely irrelevant. You just use Ecto as a database connection proxy, but actually you run SQL statements as strings.
    • But kudos for using Repo.transact over Repo.transaction
  • The central section on how database transactions work IMO blur the message about the design pattern and where to use it
  • The final section with the paper and metrics… I did not catch what the message is. There are some numbers, some “system before adapting transaction script” (but what was the system using before?). The conclusion seems to be that transaction script is bad (?; but then again - compared to what?).
  • Transaction script as anti-corruption layer? This got me intrigued. But it was just mentioned.
  • Overall this feels AI-generated

TBH 20+ minutes on transaction script is a lot to ask - but also I’m probably not a target audience

The target audience is:

  • anyone who wants to learn about DDD
  • anyone who is actively reading the book
  • anyone who may be interested in reading the book but is unsure if the topics covered are relevant
  • anyone how has already read the book, and is now distilling what they learn into “short summaries” because they are getting old and they know that one day they will forget everything, so they pour hours of their lives trying to summarize everything they learned so one day they have an easier way of “remembering”, while still holding hope that someone else in the outer space will find this useful and learn a thing or two.

As you can probably guess, I fit in the last group :stuck_out_tongue:

This is the core of transaction script. It is not Elixir specific. If you were to apply it, this is how you would do it. The book itself uses another language, but the approach is similar. It is true I could have used C# or Java or JavaScript for this, the code would be similar, because the focus is the pattern, not the tool used. This said, I still find value in exposing others to Elixir, and I do think Elixir with its ecosystem can be a good tool to explain such concepts.

I focused on explaining what a transaction is because unless you completely understand it, you wont get the examples. In the video I mention you can use Transaction Script in ECL applications, but I take it from your feedback that perhaps some code would help?
I understand the feedback is that even though I “told you where to use it” I did not “show you”. Right?

In the final section I mention a complex application that is then refactored using 4 different patterns (Transaction Script being one of them). On the top of my head I cant remember what the original structure of the application from the University was, but the message I try to convey is: “If you use this on systems with complex logic, you will make it worst!”

I use the K&C metrics to make this point clear, and I double down on the conclusion, where I re-iterate where to use the pattern and where not to use it.

Transaction Script is good in some cases, not all cases !

I am not sure how I could have made the points clearer.

Correct. In the section where to use it, I even mention that you can use it as an ECL. Transaction Script is mainly for system with little to no business logic. What would you like to see in this case?

There is no way to say this nicely, my human voice is bad. As in, most people I have ever talked to genuinely dislike my voice, and it is usually an uphill battle. Not only that, using my human voice would make it easy to identify who I really am, and where I live this brings a host of other issues.

I use AI to generate the voice. I tried looking for voice-actors, but I cannot pay them enough to read my long scripts.

Overall, the process I follow is simple:

  1. I study the book
  2. I complement said study with papers and blogs
  3. I write a script, usually 10k-15k words long
  4. I create a presentation using slides as an “idea” of that the video and the flow will look like (lecture style)
  5. I use and AI to read the script, line by line
  6. I spend countless hours editing the whole thing in a video editor

I honestly also fear that the “ai genreated” feeling pushes people away. I do not know how to fight it, since I see no other option than to use an AI voice.

Thank you for the feedback. I really appreciate it. I don’t have it clear on what actions I can take to improve the quality though. If I could do 1 thing differently, what would you suggest I do?

1 Like

My thinking here is that you probably should use Ecto to construct the query too, instead of just using it to execute a string statement. This way IMO is a bigger “exposure to Elixir”. It’s readable enough for everyone to follow (IMO; might be biased).

I mean, I think you can assume that majority of people picking up a DDD book already know what a database transaction is. Maybe not distributed transaction. But the way I consume content - I like it to be about transaction script and if other concepts are mentioned, just a link to resource about them. In this case, I don’t need to understand distributed transactions to understand transaction script. But I might want to know how to handle it in a distributed environment.

Just some kind of link to learn about it more. But I think you will cover it in the upcoming videos, so it’s fine.

May I suggest being open about it upfront? Just note in the video description: the voice is AI-generated, but it follows a script written by human. I think the reception would be different for many people.

Using Ecto that way would go against the pattern I am trying to show. Ecto builds heavily on ActiveRecord, which coincidentally is the next pattern the book covers :stuck_out_tongue:

To showcase the pattern properly, I decided to take the same approach the author took and use SQL statements directly, as this is the heart of the Transaction Script. You can however use Transaction Script with ActiveRecord (but that is in the future!)

Rest assured my friend, there will be more Ecto in the future :smiley:

I personally disagree with that statement. Most people I know “think they know what a transaction is”. But then, as you correctly noticed, once you go into distributed and implicit transactions, most people are surprised.

This said, it may very well be that you and I have different experiences and consume content in different ways. That is totally normal, different people have different processes to learn. As you can probably tell, I try to be as thorough as possible.

However, and I want to be very clear in this regard, I try to be a loyal to the book as I possibly can. In the book the author does go into these topics, and I feel that not covering them would be a de-service to the audiences I have identified previously (specially 2 and 3).

As a rule of thumb, if the author makes a chapter on a specific topic, I will not only cover it, but try to expand on it with my own research and opinions (which I hope adds value).

This is interesting. I always provide the bibliography in the description of the video and in most of the images I show (check the top corners of the images, where I usually post the links). By checking the description you can check my sources and find more information about the topics at hand.

But I take it that perhaps this is too hidden to be effective? How would you like for me to suggest the links? Perhaps by making a stop after each section and saying “These are my sources, please check them out!”. Or do you have some other idea?

I always held hope that a human would hear the script and think “these jokes and transitions are so abysmal, clearly a human did them :P”

I will take this advice to heart. In my next video, after the intro and before the initial citation, I will put some kind of disclaimer that makes it clear. Thanks !