10
Views
4
Comments
Solved by AI
Which module I can use to store the structure that will show the Data on UI?
Question

I have a table like this for example

User: username, password, name, age, phone is CS Module

My application architecture include these module: 

CommonUI, CS
BL
UI

=> I only want to show some not private info like: name, phone

So I'm thinking about create a structure for only those attribute to show on UI, but I don't know where to store it. In CommonUI? CS? BL?


2023-12-26 10-35-28
OutSystems Neo
Staff
Solution by AI
AI Generated

In your case, the best approach would be to store the structure in a module where it best fits its responsibility. Based on the standard architecture of OutSystems applications and best practices:

  1. Store the structure in the CS (Core Services) module: Since the structure is tied to the entity in the Core Services module (User entity in the CS module), it makes sense to define the structure here. This ensures that all related data and structures are stored in the same logical module. CS is the module responsible for encapsulating the core business entities and their associated logic, such as structures and logic for exposing or transforming data.

  2. Expose the structure to the BL (Business Logic) or CommonUI module: Once you've defined the structure in the CS module, you can expose it as a public structure (via the Public property). This will allow it to be used in other modules, such as BL or UI, to fetch and display only the necessary data (e.g., name and phone).

  3. Why not CommonUI? The CommonUI module is typically focused on shared visual components (e.g., widgets, themes) and not core data structures. It’s better to keep such structures closer to where the actual data is stored and managed, which in this case is the CS module.

To summarize:

  • Define the structure in the CS module, as it relates directly to core data.
  • Mark the structure as public and use it in the BL module for business logic processing and/or the CommonUI module for presentation.

This follows the principle of keeping data and logic as close as possible to its source while maintaining a clear separation of concerns Module count and module bifarcation according to best practices.

This answer was AI-generated. Please read it carefully and use the forums for clarifications
2016-04-22 00-29-45
Nuno Reis
 
MVP

Hello.

To clarify the answer, think on the structure as the sharable version of the entity. Instead of making the entity public, you make the equivalent structure public. So they stay on the same module.

Makes no sense to place it in modules above as they consume the CS. A structure above CS that CS needs, would create a circular dependence.

UserImage.jpg
Huy Le

Ok I get the idea, put the structure inside the CS then expose structure outside, noice

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Why you create a users entity with password?  Will it be used to login to an outsystems app? In that case you should use the built in User identity provider of outsystems.

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