wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Coarse grained and Fine Grained Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Coarse grained and Fine Grained" Watch "Coarse grained and Fine Grained" New topic
Author

Coarse grained and Fine Grained

Sanjay Saxena
Ranch Hand

Joined: Dec 12, 2001
Posts: 81
Can anybody tell me what is meant by Coarse grained and Fine Grained entity beans ?
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Sanjay Saxena
Ranch Hand

Joined: Dec 12, 2001
Posts: 81
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

Joined: Jun 25, 2001
Posts: 15957
    
  19

One table? I thought it was one row in a table.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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

Joined: Nov 26, 2002
Posts: 211
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


Thanks,
Mathews
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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

Joined: Nov 26, 2002
Posts: 211
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

Joined: Aug 10, 2001
Posts: 3892
    
    5
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

Joined: Nov 26, 2002
Posts: 211
Thank You Kyle...
So now the Question is out as ejb 2.0 in the market...
George Jay
Greenhorn

Joined: Dec 11, 2002
Posts: 3
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
 
 
subject: Coarse grained and Fine Grained
 
Similar Threads
Coarse grained v/s fine-grained objects
coarse-grained objects vs. fine-grained objects
FineGrained Objects vs Coarse Grained Object
fine-grained and coarse grained
coarse grained and fine grained