How is your experience with the OutSystems Community?
22
Views
3
Comments
Monolithic Service Module Exposing Too Many Public Elements – How to Fix?

Hi everyone, I’m getting a warning from my AI mentor that a monolithic service module is exposing too many public elements, but I’m not sure how to properly address it. There aren’t clear details on which parts are problematic, so I’m looking for general guidance on how to reduce unnecessary public exposure and improve encapsulation in such cases. Any suggestions would be helpful.

2026-06-03 12-13-54
Jasper Oudenaarden

Hi,
This issue is likely caused by having too many public elements, which suggests that the module contains multiple concepts bundled together. Consider refactoring the module by splitting it into smaller, well-defined components based on those concepts. But it also really depends on your module and how you set things up.

According to the documentation:
Module providing services with too many public elements

Impact 
A monolithic module with a large number of public elements often indicates that it encapsulates too many responsibilities. This makes the module complex, difficult to maintain, and less efficient to use. Consumers that only need a subset of its functionality are unnecessarily impacted by the module’s size and scope.

How to fix
Identify the distinct concepts within the monolithic module and define clear relationships between them. Ensure these relationships form a dependency graph without cycles. Then, refactor the module by separating it into smaller modules aligned with these concepts, respecting their logical structure and dependencies.

You can find more details in the documentation here: https://success.outsystems.com/Documentation/11/Managing_the_Applications_Lifecycle/Manage_technical_debt/Code_Patterns

2026-06-05 12-38-17
Eduardo Jauch

Hi,

Like Jasper said, if you have multiple business concepts in the same module, you have a potential architecture problem. The solution is the one given by Jasper.

If that's not the case, and all public elements are actually related to the same business concept, something I find less probable (but still possible), you have two alternatives:

1. Resolve the finding as a false positive. Yep, they happen.

2. You may be exposing elements unnecessarily. Check if you really need to expose all those elements, or if some of the elements are always used together in a certain order and you may improve the code creating a wrapper (service action) around them and changing those elements into private elements (turning service actions into server actions, or hiding entities, for example). Many times we are trying to make our code "too much flexible" without need.

Cheers.

2025-01-31 03-15-38
Irfan Ahamed Abdul Shukoor

Hi @Mohammad Iqbal Yusuf Sheikh ,

Try to consume commonly use actions ,entities in a common module, removing it from the current monolithic module, this will have AO counts to be increased but in any other possibility we can  either make it as false positive or reducing the public elements in that module.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.