• Teaser Home

    Clean Code Developer School

    Saubere Softwareentwicklung üben – regelmäßig, fokussiert, individuell, angeleitet

Sharing DVDs

Architecture Kata “Sharing DVDs”

Develop a software system to allow owners of a DVD to share it with others (collaborative consumption). Why buy a DVD when you can get one for free?

DVDs enter the system through their original owner. But they don’t stay with her. Rather they circulate among the users of the system. Whoever borrows a DVD does not send it back, from whom he has borrowed it. Instead he keeps it until someone else wants to borrow it. Once in the system DVDs are constantly given away as presents, so to speak.

For each DVD title in the system there can be several copies/instances. They are distributed among several users. When a user wants to watch a DVD he looks it up in the catalog and orders it. The system however determines which of the current holders of a DVD of the chosen title will become the lender.[1]

The lender will be informed via email and ships the title to the borrower. This will be registered with the system like when the borrower receives the DVD.

While the DVD is on its way it cannot be ordered again, likewise during a period of exclusive use by the borrower, e.g. 2 weeks.

If all goes well the sharing system should work like this:

  1. Original owner registers DVD with the software and becomes a potential lender. That way the DVD catalog grows by title and copies.
  2. Borrowers browse the catalog and order a title.
  3. The system informs a lender to ship the DVD.
  4. The lender ships the DVD and informs the system – which in turn informs the borrower.
  5. The borrower receives the DVD and informs the system.
  6. The borrower automatically becomes a potential lender after a period of exclusive use (or she may put the DVD on offer before that).

But usually something does not work according to plan:

  • The lender does not ship the DVD (because he overlooked the notification or did not receive it in the first place or simply forgot).
  • The lender ships the DVD but forgets to enter that into the system.
  • The borrower does not receive the DVD because it got lost by postal mail. Initially this case cannot be distinguished from the lender not shipping the DVD.
  • The DVD arrives at the borrower and is unusable. This can be caused by shipping or the lender. To distinguish between the two cases might be difficult.
  • The lender does not inform the system about receipt of the DVD.

The system needs to help resolve these issues, e.g.

  • The lender can be reminded via email to ship the DVD until he has informed the system he did.
  • The system can ask the borrower if she received the DVD if this has not be acknowledged within a certain period of time after shipment.

In addition to such reminders there must be a way to remove DVDs from the catalog because they have become unusable or got lost. This can happen automatically, due to missing receipts. Or can be done manually.

Users register with full name, email address, password, and delivery address.

Every user can view the activity stats of others:

  • Number of DVDs introduced to the system
  • Number of orders
  • Number or unsuccessful orders
  • Number of unusable DVDs received and reported
  • Number of shipments
  • Number of unsuccessful shipments
  • Number of unusable DVDs shipped

Such transparency can build trust. That’s why an explicit ranking should not be built in at first. Instead these stats could be aggregated into a score.

As long as the system chooses the lender automatically, though, such transparency is of limited value. There is no choice of who to order from. But the system can use these numbers to select lenders or even to block them.

DVDs can be registered by providing an Amazon link (or an ASIN). The system then grabs the meta data from there. More copies can be registered by selecting the title from the catalog.

Part of the user profile is an overview of orders and shipments and what’s in stock with the user.

A problem to solve: How can a user leave the system? He might have DVDs in stock he did not introduce into the system as an owner.

[1] Different strategies could be used to choose the lender, e.g. the first one in a list could be picked, or the one who has been holding the title for the longest time, or who is holding the most DVDs.