Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

coarse-grained

 
bird cao
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone explain the concept for me?
 
Jeff Walker
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by bird cao:
Can someone explain the concept for me?

Well, I don't know what you mean in regards to web services, but it generally means the subject is in larger chunks, as opposed to fine-grained, meaning smaller chunks.
E.g. MVC is a coarse grained design pattern because it at a high level, really an application level design pattern covering multiple tiers, whereas DAO is a fine grained pattern, because it's down in the resource tier, just making database accessing more generic to clients.
 
Dhiren Joshi
Ranch Hand
Posts: 463
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the Transfer object as coarse grained
If you are using just simple sets and gets and passing String that would be a fine grained method call.
setCustomer(String cust) {
..
}
setCustomeNumber(String custNumber){
..
}
As opposed to coarse grained where you send the transfer object called Customer which is a java object
public class Customer {
String customer ;
String custNumber ;
setCustomer(String customer){
}
setCustNumber(String custNumber) {
}
getCustomer(String customer){
}
getCustNumber(String custNumber) {
}
}
//coarse grained call
setCustomer(Customer cust) {
}
Mainly used with EJB to send coarse grained object to reduce network calls.

HTH
Dhiren
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!