You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by Dan Pettersson <da...@gmail.com> on 2020/01/04 18:48:21 UTC

Stateful functions and modules

Hi,

What is the preferred way to expose functions (FunctionTypes) between
modules?

For example lets say i have the following maven modules:

-> common
-> statistics
-> persister
-> tradematching

and I have some FunctionTypes in common and persister module that should be
reach
from all modules.

common module is included everywhere so I thought about creating
a helper class, CallableFunctions, and there specify the FunctionTypes that
can
be called from all modules. Is this the right approach or is there a better
way?

Regards
Dan

Re: Stateful functions and modules

Posted by Dan Pettersson <da...@gmail.com>.
Ok, good. Thanks for your response.

/Dan

Den sön 5 jan. 2020 11:52Igal Shilman <ig...@ververica.com> skrev:

> Hi Dan,
>
> Having a class that defines only the function types indeed makes sense,
> this would lower the coupling between the (maven) module that contains the
> function implementation and the (maven) module that uses it.
> You can peek here for example:
>
>
> https://github.com/ververica/stateful-functions/blob/master/stateful-functions-examples/stateful-functions-shopping-cart-example/src/main/java/com/ververica/statefun/examples/shoppingcart/Identifiers.java#L28
>
> Igal.
>
> On Saturday, January 4, 2020, Dan Pettersson <da...@gmail.com>
> wrote:
>
>> Hi,
>>
>> What is the preferred way to expose functions (FunctionTypes) between
>> modules?
>>
>> For example lets say i have the following maven modules:
>>
>> -> common
>> -> statistics
>> -> persister
>> -> tradematching
>>
>> and I have some FunctionTypes in common and persister module that should
>> be reach
>> from all modules.
>>
>> common module is included everywhere so I thought about creating
>> a helper class, CallableFunctions, and there specify the FunctionTypes
>> that can
>> be called from all modules. Is this the right approach or is there a
>> better way?
>>
>> Regards
>> Dan
>>
>

Re: Stateful functions and modules

Posted by Igal Shilman <ig...@ververica.com>.
Hi Dan,

Having a class that defines only the function types indeed makes sense,
this would lower the coupling between the (maven) module that contains the
function implementation and the (maven) module that uses it.
You can peek here for example:

https://github.com/ververica/stateful-functions/blob/master/stateful-functions-examples/stateful-functions-shopping-cart-example/src/main/java/com/ververica/statefun/examples/shoppingcart/Identifiers.java#L28

Igal.

On Saturday, January 4, 2020, Dan Pettersson <da...@gmail.com>
wrote:

> Hi,
>
> What is the preferred way to expose functions (FunctionTypes) between
> modules?
>
> For example lets say i have the following maven modules:
>
> -> common
> -> statistics
> -> persister
> -> tradematching
>
> and I have some FunctionTypes in common and persister module that should
> be reach
> from all modules.
>
> common module is included everywhere so I thought about creating
> a helper class, CallableFunctions, and there specify the FunctionTypes
> that can
> be called from all modules. Is this the right approach or is there a
> better way?
>
> Regards
> Dan
>