From: "Jacopo Cappellato" <
[hidden email]>
> Always use runSync: there is a small overhead but several advantages,
> one the most important ones is that you just refer to the service
> definition and not on the actual implementation details (Java method,
> Minilang method etc...).
Also direct Java calls are not ECA aware and this is a very important part of OFBiz : its business workflow.
Jacques
> Jacopo
>
>
> On Sep 10, 2008, at 7:59 AM, ian tabangay wrote:
>
>> Hi. If I have a service written in java, why or why should I not call
>> another service (also written in java) directly?
>>
>> -- start code --
>> public static Map serviceA(DispatchContext dctx, Map context) {
>> ...
>> }
>>
>> public static Map serviceB(DispatchContext dctx, Map context) {
>> ...
>> }
>> -- end code --
>>
>> For example, to call serviceB from serviceA, is it more advisable to
>> access
>> it via
>> dispatcher.runSync("serviceA", context)
>> or can I just call it directly like so:
>> serviceB(dctx, context)
>>
>>
>> Thanks
>>
>> ~ ian
>
>