The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by karldjemal]

Hi

I've just started to read the Bitter EJB book. Having completed chapter 2,
I'm a little bit confused by what you mean by a coarse grained service Vs a
fine grained one (see table 2.4). Could you pls. provide a bit more detail
(May be its just my brain not working this morning).

Thanks

Karl
import-bot (20211) [Avatar] Offline
#2
Re: Understanding service granularity
[Originally posted by crazybob]

> Hi
>
> I've just started to read the Bitter EJB book. Having completed chapter 2,
> I'm a little bit confused by what you mean by a coarse grained service Vs a
> fine grained one (see table 2.4). Could you pls. provide a bit more detail
> (May be its just my brain not working this morning).
>
> Thanks
>
> Karl

Fine grained:

setFirstName(String value);
setLastName(String value);
setAge(int value);

Coarse grained:

setData(String firstName, String lastName, int age);

A fine grained interface is more flexible in use and reuse whereas the coarse
grained interface requires
fewer method invocations. The fine grained interface is more desirable from a
design standpoint
however the coarse is sometime necessary for performance reasons, i.e. network
round trips.