Two Laptop Bag*
The moose likes EJB and other Java EE Technologies and the fly likes fine /coarse 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 "fine /coarse grained" Watch "fine /coarse grained" New topic
Author

fine /coarse grained

james edwin
Ranch Hand

Joined: Nov 22, 2001
Posts: 393
Hi,
Can some one tell what is fine/coarse grained entity beans(definition,difference and example).
B'coz my net research says everything different,no two same matched are found,everyone says something different.

Thanks,


Regards,
James
Stu Glassman
Ranch Hand

Joined: Jul 01, 2002
Posts: 91
The terms fine-grained and coarse-grained describe how data is passed. Let's say that you need to pass an ID number, first name, and last name to an EJB named foo. Here's an example of doing it fine-grained:

This works fine in most programs, but when these methods are called remotely (which is the case with all EJBs), it takes a really long time. A better way of passing this data is to use a coarse-grained approach. Put the data into a class and pass it with a single method call. Here's how:

Then you would make the method call like this:
foo.setData(new DataClass(id, firstName, lastName));
Instead of three method calls, you are only making one. Like I said, this is only useful if the method calls cost a great deal in performance, and therefore perfect for EJBs.
Hope my incoherent ramblings made some sense,
-Stu
Mahesh Devendran
Greenhorn

Joined: Dec 23, 2002
Posts: 3
Hi Pals,
There is a better discussion on this at
http://www.coderanch.com/t/310678/EJB-JEE/java/Coarse-grained-Fine-Grained
Mahesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fine /coarse grained
 
Similar Threads
Coarse grained v/s fine-grained objects
FineGrained Objects vs Coarse Grained Object
Coarse grained and Fine Grained
fine-grained and coarse grained
coarse grained and fine grained