| 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
|
 |
 |
|
|
subject: fine /coarse grained
|
|
|