Choosing between Java and Groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Choosing between Java and Groovy

Tomek
Hi,

I'am browsing the code of OFBiz and I see that the services are written
in multiple languages like Java or Groovy and even XML. Are there some
rules that help me to choose between Java and Groovy?

Tomek

Reply | Threaded
Open this post in threaded view
|

Re: Choosing between Java and Groovy

Danny Trunk
Hi,

you can define the engine of your service in the engine attribute or your service definition: https://cwiki.apache.org/confluence/display/OFBIZ/Service+Engine+Guide#ServiceEngineGuide-ServiceDefinitionserviceDefinition

You can choose between engine definitions configured in your serviceengine.xml: https://cwiki.apache.org/confluence/display/OFBIZ/Service+Engine+Configuration+Guide#ServiceEngineConfigurationGuide-EngineDefinitions

Danny

> Tomek <[hidden email]> hat am 16.04.2021 14:48 geschrieben:
>
>  
> Hi,
>
> I'am browsing the code of OFBiz and I see that the services are written
> in multiple languages like Java or Groovy and even XML. Are there some
> rules that help me to choose between Java and Groovy?
>
> Tomek
Reply | Threaded
Open this post in threaded view
|

Re: Choosing between Java and Groovy

Danny Trunk
In reply to this post by Tomek
Additionally Regarding your question to choose between Java and Groovy: That depends on your personal preferences. You can choose whatever you want.

> Tomek <[hidden email]> hat am 16.04.2021 14:48 geschrieben:
>
>  
> Hi,
>
> I'am browsing the code of OFBiz and I see that the services are written
> in multiple languages like Java or Groovy and even XML. Are there some
> rules that help me to choose between Java and Groovy?
>
> Tomek
Reply | Threaded
Open this post in threaded view
|

Re: Choosing between Java and Groovy

Jacques Le Roux
Administrator
Also Minilang (OFBiz specific DSL language in XML) is deprecated:
https://cwiki.apache.org/confluence/display/OFBIZ/Mini+Lang+Deprecation
https://cwiki.apache.org/confluence/display/OFBIZ/Mini+Language+-+minilang+-+simple-method+-+Reference
https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tutorial+-+From+Mini+Language+to+Groovy

HTH

Jacques

Le 16/04/2021 à 15:49, Danny Trunk a écrit :

> Additionally Regarding your question to choose between Java and Groovy: That depends on your personal preferences. You can choose whatever you want.
>
>> Tomek <[hidden email]> hat am 16.04.2021 14:48 geschrieben:
>>
>>  
>> Hi,
>>
>> I'am browsing the code of OFBiz and I see that the services are written
>> in multiple languages like Java or Groovy and even XML. Are there some
>> rules that help me to choose between Java and Groovy?
>>
>> Tomek

Reply | Threaded
Open this post in threaded view
|

Re: Choosing between Java and Groovy

Tomek
In reply to this post by Danny Trunk
Hi Danny,

Thank you for your response. I prefer Java rather than Groovy. But as
far as I know writing services in Java required restart the server. It
seems that choosing Groovy is better option from productivity point of view.

Tomek

On 16.04.2021 15:49, Danny Trunk wrote:

> Additionally Regarding your question to choose between Java and Groovy: That depends on your personal preferences. You can choose whatever you want.
>
>> Tomek <[hidden email]> hat am 16.04.2021 14:48 geschrieben:
>>
>>  
>> Hi,
>>
>> I'am browsing the code of OFBiz and I see that the services are written
>> in multiple languages like Java or Groovy and even XML. Are there some
>> rules that help me to choose between Java and Groovy?
>>
>> Tomek
Reply | Threaded
Open this post in threaded view
|

Re: Choosing between Java and Groovy

Jacques Le Roux
Administrator
Exactly a very important point, even in production (though on the edge in this case), same with Freemarker and Minilang (deprecated in favour of Groovy)

Jacques

Le 16/04/2021 à 17:03, Tomek a écrit :

> Hi Danny,
>
> Thank you for your response. I prefer Java rather than Groovy. But as
> far as I know writing services in Java required restart the server. It
> seems that choosing Groovy is better option from productivity point of view.
>
> Tomek
>
> On 16.04.2021 15:49, Danny Trunk wrote:
>> Additionally Regarding your question to choose between Java and Groovy: That depends on your personal preferences. You can choose whatever you want.
>>
>>> Tomek <[hidden email]> hat am 16.04.2021 14:48 geschrieben:
>>>
>>>  
>>> Hi,
>>>
>>> I'am browsing the code of OFBiz and I see that the services are written
>>> in multiple languages like Java or Groovy and even XML. Are there some
>>> rules that help me to choose between Java and Groovy?
>>>
>>> Tomek

Reply | Threaded
Open this post in threaded view
|

Re: Choosing between Java and Groovy

Rishi Solanki
Groovy has significant goodies to adopt over java like easy to learn due to
java like syntax, scripting language can be use to develop services faster
than java, default packages and type casting shorten syntax makes it easy
to understand. No build and server restart require.

The only reason to use java instead is performance and accuracy, when we do
longer db operations and precise calculations then java is better
candidate. Like groovy makes some assumptions on data types and the same
applies to decimal precisions.

Additional information, bit late here but it should be helpful.

Best Regards,
--
Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>


On Fri, Apr 16, 2021 at 8:39 PM Jacques Le Roux <
[hidden email]> wrote:

> Exactly a very important point, even in production (though on the edge in
> this case), same with Freemarker and Minilang (deprecated in favour of
> Groovy)
>
> Jacques
>
> Le 16/04/2021 à 17:03, Tomek a écrit :
> > Hi Danny,
> >
> > Thank you for your response. I prefer Java rather than Groovy. But as
> > far as I know writing services in Java required restart the server. It
> > seems that choosing Groovy is better option from productivity point of
> view.
> >
> > Tomek
> >
> > On 16.04.2021 15:49, Danny Trunk wrote:
> >> Additionally Regarding your question to choose between Java and Groovy:
> That depends on your personal preferences. You can choose whatever you want.
> >>
> >>> Tomek <[hidden email]> hat am 16.04.2021 14:48 geschrieben:
> >>>
> >>>
> >>> Hi,
> >>>
> >>> I'am browsing the code of OFBiz and I see that the services are written
> >>> in multiple languages like Java or Groovy and even XML. Are there some
> >>> rules that help me to choose between Java and Groovy?
> >>>
> >>> Tomek
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Choosing between Java and Groovy

Akshay_M
In reply to this post by Tomek
Java doesn't support variable substitution which is allowed by Groovy when quoted. Groovy is a dynamic typing language, while Java is a statically typed language. Thus, with Groovy programming, developers can spend less time writing code.