MovieMan – wrapping up

Now that we've covered all of the language and standard library features we're going to cover, it's time to add the finishing touches to MovieMan. There are two modules that need to be modified: movieman.db and movieman.menu.display.

The db module

Open up $MOVIEMAN/source/movieman/db.d. We'll start with fleshing out DBTable. At the top of its declaration, add the highlighted line as follows:

T[] _items;
bool _sortRequired;

In order for the movies to display in a sensible order, they'll need to be sorted. We could perform the sort every time a movie is added or every time the movies are displayed. The problem with this is that sorting is going to become an expensive operation as more and more movies are added. There are different ...

Get Learning D now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.