import-bot (20212) [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 (20212) [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.