listBooksOfAuthor() ( , BookService), , $authorId, Author .
, . , Author - , , AuthorService::getAuthorById().
, , - Author, , - , - AuthorSummaryInterface - , . Author , , Author, , Author. , Author:getSummary(), AuthorSummaryInterface. - , exmaple - , .
You can also create a set of methods — perhaps on the object AuthorServiceor object AuthorSummaryServicethat creates the objects AuthorSummary. Then, in cases where only AuthorSummaryInterfacefunctionality is required , you can create these limited functionality, less expensive objects.
Just some ideas.
source
share