Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

FIne Grained and Coarse Grained Objects

 
Dean Jones
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey wat r fine grained & coarse grained objects.
which of them shud be used and in which condition
Dean Jones
 
Alex Belt
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A fine-grained object is an object that contains a 'small' amount of data, while a coarse-grained object contains a larger amount of data, typically containing several fine-grained objects.
To demonstrate, let's say that we've created a system for entering orders. Typical objects in this system would be Customers, Orders, and Order Items. An Order Item would be a fine-grained object, as it contains the details about a single-ordered item, such as description, qty, price, etc. An Order would be a coarse-grained object, as it contains many Order Items and a Customer object as well.
Which should be used where depends on the application. In the example above, if a customer service rep wants to retrieve data regarding a particular order from a network server, it makes more sense to retrieve the Order object and display that data on the screen rather than retrieve all the Order Item objects individually.
Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic