O'Reilly logo

Qt 5 Projects by Marco Piccolino

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

From usecases to business objects

To write the usecase test test_one_or_more_grocery_items_available(), we had to define some of the entities::GroceryItems business object's API, namely a list method returning the list of items (which in turn should expose a count method), an isSortedBy method checking that the list is sorted according to a specific field and direction, and a setRepository method defining a store, or repository, from where the data should be fetched.

In addition, by implementing the usecase class, we also figured out we would need a retrieveAll method to retrieve the data from the repository into the list, as well as two signals ( allRetrieved and allNotRetrieved) to notify the usecase and any other interested party of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required