• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Coarse grained and Fine Grained

 
Sanjay Saxena
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody tell me what is meant by Coarse grained and Fine Grained entity beans ?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Usually fine-grained means each Entity bean refers to one table -- coarse-grained means each Entity bean refers to > 1 table.
The "coarse-grained vs. fine-grained" argument is one of the oldest ones in EJB's. It's mostly gone away with EJB 2.0 and better tools, since most people agree that local EJB 2.0 Entity beans can be fine-grained without much problem.
Kyle
 
Sanjay Saxena
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kyle, I'm clear on it now.
Is it the same 'Kyle Brown' whose book I'm reading now a days for WebSphere certification ??
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One table? I thought it was one row in a table.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim -- if you have to be precise -- each Entity bean type maps to one table. Thus each Entity bean instance maps to one row in that table.

Kyle
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai Kyle,
You mean to say coarse grained is not possible with single table. are you sure about it..Can you pleae give a piece of code for coarse-grained and fine grained
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's exactly what I mean. What use would code do? It's a simple matter of definition...
Kyle
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kyle..
Still I am not getting a clear picture abt coarse grained and fine grained..Here in the forum it self it is given a different opinions. for that search for the Coarse grained and fine grained in the search or pleas go to this url in this forum.
http://www.coderanch.com/t/309954/EJB-JEE/java/fine-coarse-grained
Hope the same idea has discused in different threads.Hope will come back soon...
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sigh.
Stu (in the other thread) was not really talking about coarse-grained vs. fine-grained. He was really discussing an idiom called bulk update that Richard Monson-Haefel introduced in his EJB book.
The fine grained vs. large grained approach refers to the fact that some of the earliest versions of the EJB servers had a very inefficient CMP support. Thus, to get around this limitation, the vendors suggested that you not use CMP (which naturally maps one Entity bean to one table) but that instead you build BMP's that represent a JOIN of several tables and that return value objects representing the information in those tables. They called this "coarse-grained" BMP's and recommended it as the best approach for Entity bean use.
However, with the introduction of EJB 2.0 and the vast improvements in the CMP implementations from the vendors, this is no longer necessary. It is now perfectly acceptable in most cases to use CMP's that each map to one table since automatic container-controlled joins and caching mechanisms can make this more efficient than the coarse-grained BMP case.
As a result, newer books (like Floyd Marinescu's EJB Design Patterns book) refer to coarse grained BMP's as an anti-pattern, rather than a pattern to be followed.
Kyle
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You Kyle...
So now the Question is out as ejb 2.0 in the market...
 
George Jay
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oke then,
SO when we are left with the choices of implementing an Internet Banking Solutions based on J2EE, on the Business Tier, which one are more effective to be used: Session EJB or Entity One?
Since the Database Tables in Banking are pretty huge. Is Session EJB pretty safe for Internet Banking Like applications.
Rgds
GJ
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic