Learner’s Library – building the ubiquitous language part 1 – talking with the business

Well, I certainly didn’t expect this post to take this long to write… but OK, I’ll forgive myself. This is the next step I am taking in my learning trip.

Ubiquitous language – what is my app all about?

For this blog post, I’m going to try to put on the hat of a domain expert in order to describe the problem space that I’m trying to solve. Here I’m not trying to define software “requirements” in the general consulting/contracting sense. Instead, I’ll try to talk in terms of the problems that I can solve by using this library software. That means “I” am in charge of a library where books are lent and collected, with everything in between. (Do I know everything about what it takes to run a library? In my dreams, maybe, but that isn’t the point of this blog post.)

I’m going to be building a ubiquitous language for my app. A couple of tenets regarding the ubiquitous language for review:

  • The application MUST name its components using the ubiquitous language. Don’t refer to a book as a “book” in describing the domain and then represent it as a class named “LendableEntity” or something.
  • The ubiquitous language is NOT set in stone – it must evolve with the project. The developer must constantly update it to reflect the improved understanding of the problem space.

One corollary to that second point is that I must continuously update words used in both the code AND the ubiquitous language. For this particular endeavor (i.e. this blog series), that means I will be continuously updating the ubiquitous language and the code as I gain more understanding and flesh out more ideas.

Onto the task at hand, then.

Learner’s Library – Louis Kossuth, the owner

I have a library. Obviously, the library has books that patrons can check out, but that’s not all. There are other types of media, like CDs and DVDs. Naturally, any media can only be checked out by one patron. More precisely, a medium can be loaned to exactly one patron’s account. All checked-out media has a due date by which it must be returned to the library. A loan can be renewed 0 or more times, depending on the type of media. An overdue loan will start accruing fines to a maximum fine, which is equal to the original value of the un-returned media.

Learner’s Library – me, the software developer

Let’s examine the above section a bit closer and pick out some key terms. I will bold words that Louis, the library domain expert, would use in his library day to day. I will italicize rules by which Louis runs his library. Our goal is to identify class and object names and business rules that will govern how these elements will interact to solve the problem that have been presented by Louis (because why not), the business owner.

I have a library. Obviously, the library has books that patrons can check out, but that’s not all. There are other types of media, like CDs and DVDs. Naturally, any media can only be checked out by one patron. More precisely, a medium can be loaned to exactly one member’s accountAll checked-out media has a due date by which it must be returned to the library. A loan can be renewed 0 or more times, depending on the type of media. An overdue loan will start accruing fines to a maximum fine, which is equal to the original value of the un-returned media.

Now that is all fine and dandy, but I’m sure Louis didn’t want to hire me to build software to manage only the assets of his library. Now that we’ve done this parsing thing once, I’ll now do a bit of role-playing to find out more about what I’m dealing with.

Learner’s Library – the back and forth

Me: What services are provided to members to more easily and effectively use the library?

Louis: Well, I did come up with a neat way to organize my library, but I do have a ton of books here. I’d like our patrons to be able to more easily find the books they want.

Me: Sorry, Louis, I need you to back up there. Patrons? Are they different from users?
* Notice that not only did I diverge from the original word “patron” pretty much right from the get-go, I don’t even use consistent words for myself. This may not look like much – after all, is it so bad to use “member” and “user” interchangeably? Maybe, maybe not. But this subtle but insidious bug in the ubiquitous language building session can potentially really complicate things down the road. And yes, as far as I am concerned, not using the right word is a bug.

Louis: That’s a bit of a… technicality, but we librarians do have an ongoing discussion about what to exactly call the people who visit and use our libraries.

Me: OK, that’s quite interesting, and I would definitely like to talk more about that at some point. But for now, can we get back to how we can let your… members? search for your books?
* I’m still doing it. It feels so weird to say “library patron”, but I’m going to persist. Two reasons: 1) it’s somewhat interesting to me, and 2) it feels useful for driving home the point that I, the developer, must do my best to accommodate the language used by my domain expert.

Louis: Patrons.

Me: Of course, sorry, I’ll keep that in mind.

Louis: So like I was saying, the most important thing is for our patrons to be able to find the books they want to read. So they should be able to search for books by the usual parameters, like the title, author’s name, genre of books, that sort of stuff.

Me: Sure. Could we flesh out what you mean by “that sort of stuff”? What other ways do you want to let your patrons search by?

Louis: Good question. One question our staff get all the time is – “what’s a good book to read”? My staff are all very knowledgeable and helpful, but they don’t have too much time to sit down and help everyone who wants recommendations. And since we’re getting so many visitors, it seems to make more sense to put different recommendations on our website regularly so more people can easily find books that may be interesting.

Me: We’re talking recommendations made by your staff?

Louis: Yes, but it would be nice to show recommendations from the community, too.

Me: Are you thinking something along the lines of “likes” and reviews?

Louis: Yes, that’s the direction we want to head in. We hope that these recommendations from our patrons will help the rest of our library community discover many great books.

Me: Sounds great. Is there anything else would you like to do?

Louis: Yes – renewing loans and paying fines. Our patrons can already do this in person, and we would like to extend these services online as well. A long-term goal we have is to establish an inter-library loan system – we could offer even more material to our patrons. I would love for them to search and request media from other libraries all over the county, state, country… Oh, the possibilities will be endless..! Oh, excuse me, I let myself get carried away there…

Me: No worries! I can easily geek out on tech-y stuff if you gave me the chance.

Louis: Thanks for understanding. Well, like I said, that would definitely be a long-term project with a tremendous amount of work with many affiliates… One other thing that comes to mind, however – I would like to offer some sort of chat support from our staff for the patrons. I do quite enjoy using these services from Amazon and other online stores, and I definitely see potential in serving our patrons who can’t be here in person or call.
(Did someone say, “chat bots”?)

Me: Sounds like we can do some interesting things there. Anything else?

Louis: We’ve covered a lot of ground, and I can see that we have much work ahead of us. I think we can end the conversation here for now.

Me: You’re right, we did go over a lot of things. I’m looking forward to work on all these interesting projects together, but I will definitely need to process all that we talked about today. We’ll definitely keep in touch throughout the project as we understand all that we’re getting into together. Thanks for chatting with me today, Louis!

Some quick thoughts

Oh, man, I’m reaching waaaaay too far with all this stuff… but I do see ample opportunity to try out few things. Chat bots, for one, from that last “requirement”. So. Many. Buzzwords. That I can hit (think microservices, CI/CD, payments, event sourcing, CQRS… “Oh, the possibilities will be endless!” :P)

Wrapping up

The actual parsing of the exchange above will be in a subsequent post. This post has been rotting in purgatory for waaay too long already, and at the rate I’m going, this will never see the light of day (not to mention that I lost content because of WordPress auto-logout more than once). I’ll go through an exercise of building a ubiquitous library in a code-AND-user-friendly format.

Leave a Comment

Your email address will not be published. Required fields are marked *