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.
Joined: Jul 01, 2002
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