ListBookmarksCommand is a business-logic command that retrieves saved bookmarks and makes their ordering explicit. It accepts an ordering column, stores it, passes it to the database query, and returns all rows. section 6.3.2
List bookmarks by date
class ListBookmarksCommand: def __init__(self, order_by='date_added'): self.order_by = order_by def execute(self): return db.select('bookmarks', order_by=self.order_by).fetchall() The default lists bookmarks by date added; callers can provide another column, such as title. section 6.3.2
Figure 6.7. The business logic layer determines when and how data is read from or written to the persistence layer.
The business logic layer decides when and how bookmark data is read from the persistence layer. section 6.3.2
