Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Course grained objects? Fine grained Objects ?

 
Fozan Zaidi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchars
Will some body plz explain what is granuality? What objects r called "Course grained" and what r "fine grained" ?Thanx in advance
Fozan Zaidi
 
Burk Hufnagel
Ranch Hand
Posts: 814
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll take a whack at it...
From what I've read, the idea is that due to the overhead of remote calls you want your EJB methods to return large chunks of data (coarse grained) like an Address (street number & name, city, state, zip) rather than have a separate method to get each piece separately (fine grained).
I'm sure that if I've got it wrong, someone will correct me...
Burk
 
Sridhar Raman
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding to what you have said...
coarse grained approach :
1. Service based approach. The client gets to work with a thin interface of the objects. For example, in a credit card validation the client will in all probabilities work with a CreditCard bean and invoke 1 or 2 methods to get the job done.
adv :
1. fewer object references at teh client
2. less network overhead
3. lets you focus on the 'requesting a service' as opposed to 'building a service'
EJBs follow the coarse grained approach.
2. Fine grained approach. The client works at a very detailed level with the objects. In the above example the client might work with a whole bunch of other objects and organize the service dynamically. may be organizing is not the word....it'll involve more method calls and conditional checking....
1. lots of objects refefences to play with ( not really a good idea)
2. involves a lot of network overhead ( each service invoked over the network will add to the overhead)
3. Obviously deviates from the thin client paradigm...at least thatz what Iam incliend to think
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic