Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [handly-dev] Doing work in Handle or in Body

Hi Vlad,
 
I think the distinction between handle and body is mostly about data,
not computation. As far as I can tell, JDT usually puts computation
in handles, and treats bodies as data holders. However, there is no
hard rules here, and I would suggest following common OOP sense
when deciding this question. Anyway, clients initiate computation
through handles, regardless of where it is actually implemented
(as a rule).
 
If you could come up with some code snippets or pointers to
source code in your git repository, I might be able to provide
more guidance (if needed).
 
Best regards,
Vladimir
 
 
Hi!

On Fri, Dec 19, 2014 at 3:59 PM, Vladimir Piskarev <pisv@xxxxx> wrote:
There is no rule that non-handle-only methods must delegate their work to a body (if I understand you correctly). I think what's really important here is the distinction between "handle only" and "other" methods for model elements; contract rather than implementation details.

Well, not a rule, but the whole point of the framework is to separate the lightweight functionality from the heavier one. There is a cache for bodies, so implementing heavy things in the handle might lose some efficiency.

Using "throws CoreException" as a discriminator is a good idea. Thanks!

regards,
Vlad



Back to the top