This question has already been asked a few times at the forum, but I could not find a real answer to this question.
So I am not looking for alternative ways to get things working, but I just want to understand why a service module cannot be converted to a reactive module.
Is there a conceptual, architectural, technical or other reason?
And another question. Why would one want to convert a reactive module to a service module? What advantage does this bring?The answer to this question might as well answer the initial question :-)
Hi Rogier,
Ultimately OutSystems Product Management would need to answer that question.
But here are my thoughts.
Why would one want to convert a reactive module to a service module?
For better reusability, separation of concerns, and performance. Moving business logic out of the UI and into the back-end (Service Module) makes the architecture cleaner and allows for logic to be shared across different parts of the system.
Historically Reactive Module type already existed years before the Service Module type. Also developers tend to start simple with all in one module, then later decide for reusability and separation of concerns. So OutSystems saw a use case that could help developers, and created this option to convert to Service Module.
Why can't a Service Module be converted into a Reactive Module?
Now, the other way doesn't make a lot of sense, as Service Modules are designed to handle the backend logic of an application. They are meant for data models, business logic, integrations, and services that can be reused across multiple applications. They don't deal directly with user interfaces or front-end technologies like JavaScript or CSS.
Hope this helps,
Regards,
Daniel
Thanks Daniel,
Well actually, in some use cases it would make sense to have a service module converted to a reactive module.
I have a service module, defining roles. It is actually also a user provider. It has several public server actions to check roles and throw exceptions with unified exception messages.
But now I want to add client actions/functions, that check roles at client side in order to show/hide UI elements. For this, I use the $public.Security.checkIfCurrentUserHasRole() JavaScript action (This is O11, not ODC).
Of course I can create a separate module for this, but I want to combine them into one module, having this business concept together. But this is not possible. Refactoring to a new module would be heavy because it is also a user provider and there a lot of references to be updated..
I would keep it in separate modules. Not a lot of benefit to refactor this.
Hi Rogier Olde Dubbelink,
Just to add more details info related to the service actions that might help you to clarify some thoughts.
https://johnalvinsalamat.medium.com/understanding-outsystems-service-actions-under-the-hood-cb17f99fbabd
regards
Thanks Alexander.
It is service module, but there are no service actions in this module, only server actions, called from the end user context.