Asume these two bounded contexts:
Book Management: manages the creation of books and its attributes:
Book(id, name, author, summary, ISBN, length, cover photo)
Book Order: creates orders related to books.
Order(orderId, List<Book>, deliveryDate, status, etc.)
The Book Order context has an independent web application that allows each buyer to order books and check their status.
This application needs to show a subset of the Book info (name, ISBN, cover photo).
There are two options here:
The book order context stores only a reference to the book ids.
Order(1, [bookId1, bookId2, ...], 2023-12-12, PENDING,...)
Order(2, [bookId5, bookId1, ...], 2023-10-12, PENDING,...)
Whenever it needs to display an order it will have to ask the book management context for the details of each of the books that the order contains, for instance using an Open Host Service.
The book order context could store a subset of the book entity in its own model.
Order(1, [Book(bookId1, "The Book", "ISBN1, "http://image.png), ...], 2023-12-12, PENDING,...)
The book info could be created/updated based on events published from the Book Management context (BookCreated, BookUpdated,...). This prevents it from making an HTTP call per book. However, a downside is that we're duplicating some information from the book entity in different contexts.
Assuming each order could contain between 9 and 20 books, and buyers place at least an order per week, what would be the more sensible approach?