David_W (70) [Avatar] Offline
Personally, I would have created a Product class that contains the finder methods, and passed the Product object to Order's add and remove methods. This also improves type safety in Order. You would probably need various finder methods in the Product class anyways, in order to allow the user to pick the products to be ordered.
ramnivas (171) [Avatar] Offline
Re: product repository in order issues listing 16.17
That is a valid approach, too. With the approach in 16.17, the client needs to call only one method (with the theme of producing humane interfaces).

BTW, Spring Roo uses a similar arrangement (static finder on a class).