
Lesson Description
The "Domain Expert Interview Exercise" Lesson is part of the full, Domain Modeling for Humans and AI course featured in this preview video. Here's what you'd learn in this lesson:
Mike introduces an exercise for students to practice identifying core values and avoid unnecessary details. He encourages focusing on building useful software rather than perfectly replicating reality. The discussion covers seed lifecycles, time-based actions, expiration, and reminders for effective seed management.
Transcript from the "Domain Expert Interview Exercise" Lesson
[00:00:00]
>> Mike North: Let's discuss this problem of organizing seed packets. And I've deliberately given you all more information than you should carry forward because I want you to practice this, sort of identifying the core value, teasing that out, building what's necessary without going overboard. So I'm gonna give you a couple pieces of information to use and then I want you to spend a couple of minutes just thinking about questions to ask and then we'll have a discussion.
[00:00:38]
By the way, so let's go through the information. I also have a way you can have a discussion if you're watching this course on video. I've built an LLM prompt for you that can simulate a gardening expert and you can ask ChatGPT or an LLM of your choice the same kinds of questions we're gonna discuss today.
[00:00:57]
And it should give you something useful enough for you to engage with. First, let's look at what a seed looks like in a catalog. This is a huge image for this thing. This is a little snippet of one of those seed catalogs we've got. This is for a tomato.
[00:01:17]
We've got San Marzano Heirloom, 80 days. Then a description and then this is a weight and there's some words here. And then we've got different quantities that you can buy for a price. And here's the front and back of a seed packet. So we've got the front where got some information up here and then in the back this is even information.
[00:01:44]
And then we've got some measure of days, some planting instructions. And then don't forget to look on the side here, this vertical edge information here. Sprouts in 7 to 14 days. There's an ideal, hey, a temperature range, seed depth for planting, whether it's frost hardy, something called plant spacing, right?
[00:02:09]
So do not attempt to model every detail of the real world. You have to keep track of the fact that you are trying to build a useful software product. This is not the matrix where you're trying to create a seed packet and a seed that will actually grow a plant.
[00:02:32]
And that is a perfect representation of this thing as it exists in the real world. And I've given you a seriously overkill data source here that you're going to have to pick and choose from. This represents one seed. So we've got some spacing stuff. We've got some environmental needs, like how much sun does it like, how much water does it like, we've got some soil characteristics that it wants, some temperature ranges, right?
[00:02:59]
So you're gonna wanna look at this and let's say, you had access to a government data source that has a ton of this information about seeds. I want us to work on what do we really need to tease out in order to make this useful? Clearly, there's some stuff back here.
[00:03:18]
This is mostly placeholder stuff. We can tweak it based on our discussion, but you're not gonna fit all of that back here on the back of the seed packet. We'll have to refine that.
>> Mike North: All right, finally, if you're watching remotely or if you're watching this as a video course, this is an LLM prompt that you can plug into a chat AI of your choice and it will be your gardening expert.
[00:03:54]
It'll have a garden that's similar to mine. So you'll get hopefully some kind of similar answers that I would give. But this is a way you can sort of have a discussion even if you're watching this course at home. So with that, let's take a few minutes to sort of look through some of this information I've provided you and then let's come up with some good questions.
[00:04:19]
And what we're gonna do is go back to this tool and we're gonna try to model what exactly is a seed packet and how do we break that down? What are the value objects, etc. There is a file in your repo that I'll give you a path to, packages > server > data > seeds.yml.
[00:04:48]
And that is this path is where you're gonna find a huge data file. That's kind of our source of truth for seed data. If you look at that, here's that tomato plant and VS code makes this nice because you can still see the IDs and the path, but it goes pretty deep.
[00:05:15]
This is a 12,000 line yaml file with a ton of data. All right, let's say two or three minutes and just process some of this and let's prepare to have a conversation.
>> Mike North: I'm now putting my gardening expert hat on. So the scenario is, I have a problem.
[00:05:45]
I have a ton of envelopes of seeds at home, and I have reported to you that it's an unmanageable pile. And that is painful for me, that is difficult. So how can we go from that to identifying kind of a problem to solve, a more specific problem to solve, and then going over here and figuring out how that translates into entities, relationships, values, constraints.
[00:06:23]
>> Male Student 1: Can you describe what specifically you struggle with a little bit? Do you have trouble knowing what seeds you have on hand? Do you struggle with remembering what specific time you need to plant certain seeds and be some more information like that?
>> Mike North: So the question was like, can I go into more detail?
[00:06:41]
Are there specific things that I struggle with? You had some good prompts there. Are there things I need to know at a particular point in time? So you're fishing at like, is there a life cycle here? Is there a sequence of time based operations? And it turns out there are.
[00:06:59]
So when I use a different color here, cuz these are not entities, but I wanna plant stuff in the ground and this happens when the time is right. You should probably ask me more about that. So we plant in the ground and then like before that we harden.
[00:07:26]
Harden plants and this means gradually expose them to the outdoors. They're really delicate when you start them inside and you wanna give them a few hours of real outdoor sun and wind so they get strong. And then there's a part before that, which is grow indoors. And there is time here, right?
[00:07:54]
So I wanna know how long these things take to mature. Well, it's almost like time that works backwards, right? I wanna know when does this plant go in the ground? And this one's pretty known. 7 days, harden for a week. This one depends on the plant. Some things like mint will just shoot up and some things take a really long time to develop.
[00:08:27]
Like peppers. Peppers take a lot longer to grow than squash, which kind of just takes over everything. You start it inside and it's unwieldy as you're carrying it out. So there's a timeline here. There's a sequence of things I wanna do. And because there's a variable here, we can call it t, right?
[00:08:53]
The time it takes to grow and then there's a variable here, let's say that's temp. Sorry, too many Ts. There's a time and there's a temp. And so based on when this goes outside, I'm looking for particular things at different points when I'm growing indoors. It's almost like a work back plan, if that makes sense.
[00:09:15]
We want to launch on a particular date. There's a fixed time thing here. And then I need to work backwards and figure out when do I start this inside. Some things I have to start really early. And then some things I can start later and it'll be fine.
[00:09:36]
So that's one of the things I wanna do. So let's capture this just like that. There's a life cycle, there's a time based sequence. All right, and there's something else, seeds also expire. Sometimes I order too much. Part of it is, I'm legitimately disorganized with this collection of seeds.
[00:10:07]
I forget that I have a thing and I order more of it. And now I have an old seed packet and a new seed packet and I wanna go through the old stuff first. So there's some sense of like, show me if these things are getting close to where the seeds aren't gonna grow as easily.
[00:10:24]
And I wanna go through those, I wanna make sure that I use those up rather than use the new thing. And then finally, if I wanna look through what I have, so I don't double or triple order things. So just being able to easily find what I have quickly rather than rifling through a big box of envelopes, that's pretty important.
[00:10:45]
So there's search by name or plant type, there's a time-based sequence. And so I wanna understand when to start indoors. And then there's sort of a favorites concept here.
>> Male Student 2: Stock, how much you have stock of?
>> Mike North: Yep.
>> Mike North: That's great. How many seeds of a given type do I have?
[00:11:23]
>> Female Student 1: Do seeds tend to expire sort of at the same? Is there different expiration dates for different seeds? How long they'll last?
>> Mike North: Yeah, that's a very good question. I'll give you the first level of insight, which is there's the date that's on the packet. And I'm not sure what the answer to that is, but if we dug deeper, it's something like, well, the way you get seeds is you grow a plant and you wait for it to mature and sometimes it'll fruit, right?
[00:11:59]
You get a pepper, but instead of eating the pepper, well, maybe you also eat the pepper, but you collect the seeds from inside the pepper. And so that's happening at a predictable time. That's usually happening with seasons. And so when I think about expiring, it's usually less about it's on March 27th that this expires.
[00:12:23]
And I don't wanna use it after that point but it's a softer signal there. Look, these are getting old and I'm really looking at expiration dates. Kind of around this part of the time period. When I'm planting things indoors, I will totally plant seeds that are past their expiration date.
[00:12:41]
But I'll put two or three of them in those little hydroponic, those baskets that we talked about. And I don't know, maybe one grows. Sometimes none grow, but I'd say we're kind of honing in on. It's more of a year that it expires on and it's something I only evaluate at the beginning of the season.
[00:13:04]
>> Male Student 3: Someone online said, yeah, reminders.
>> Mike North: I need a reminder, that's great. That's great. So we do want a reminder anytime there's a time based thing. Remember I've got 40 of those raised beds. I keep saying it's like 38 or 40. I legit have lost count, it's a lot to manage.
[00:13:23]
A lot of different plants going on, a lot of things starting at the same time. And really I'm well beyond the point of just putting a calendar event somewhere manually and being like, this is the day where I'm performing this activity for my garden. It's just all these things have different timelines.
[00:13:40]
So, yeah, great. Reminders. Yeah, yeah, there's a time based sequence. This is the reminder right here. I want to understand when to start indoors. I want to understand when to transplant. Okay, I think we're good. I'm gonna stop us here. So back to seed packet. And as we look at these things, what are some pieces of data that we need to associate with the seed packet?
[00:14:05]
And let's think about are they value objects, are they other entities? Let's explore. Okay, maybe you understand the pain. Let's start thinking about how to describe the related concepts here. Not in code yet, but just you're still on the whiteboard with the gardener, or you're using whimsical with the gardener.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops