Let's say we have a table of users which stores: - First name, -
Last name, - Phone, and And let's assume that our client needs
the following information, at separate points: - User name, -
User name and email, - User postal address, and - User phone
number We can obviously develop a set of functions (in the
service layer) like: - getUserName(id), which would return first
and last names, - getUserNameAndEmail(id), which would return
first and last names, plus - getUserPostalAddress(id) ..., and -
getUserPhone(id) ... or we could develop just one function: -
getUserInformation(id), which would return all user information
regardless of what is needed where. There isn't any obvious
technical reason to choose one method over the other as both
have clear merits: The first way, we only transfer the data we
need from server to client, but the second way we only build one
function and reuse it every time we need any user information.
It's a question of data volume and bandwidth. If the client and
the server are conne