Why we can create a lot of modules when making a new application?

can we just use 1 module for the application? and whats the difference between home and not set as a home for the module?

Hey Calvin,

You can create multiple modules, so you can seperate logic, screen and data.

This way you can have 1 module which contains your data model and some logic (though you might even choose to seperate these also). And 1 module for your screens, this way of building is also featured in the lessons.

Besides that it is a general principle in programming.

The up side of this is that you can easily reference your logic and data in other modules, without having to expose your screen module (so that your screen module might consume data or logic from other modules), this is all to prevent cyclic references.

A module set to home will be the default module for this application, in ServiceCenter, when you open your application, there is a button that says, open in browser. This button will open the module that you selected as home.


Cheers,


Joey.

Joey Moree wrote:

Hey Calvin,

You can create multiple modules, so you can seperate logic, screen and data.

This way you can have 1 module which contains your data model and some logic (though you might even choose to seperate these also). And 1 module for your screens, this way of building is also featured in the lessons.

Besides that it is a general principle in programming.

The up side of this is that you can easily reference your logic and data in other modules, without having to expose your screen module (so that your screen module might consume data or logic from other modules), this is all to prevent cyclic references.

A module set to home will be the default module for this application, in ServiceCenter, when you open your application, there is a button that says, open in browser. This button will open the module that you selected as home.


Cheers,


Joey.

so, if I'm comparing like Java, the modules is like classes in java?


Hi Calvin,

Application modules should separate concerns as defined by OutSystems four layer canvas.

For examples and more insights you can take a look into this document:

https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/Designing_the_architecture_of_your_OutSystems_applications/02_Translating_business_concepts_into_application_modules

Regards,


Shashi kant Shukla wrote:

Hi Calvin, 

Please go through the below 4 layer canvas for more detail 

https://success.outsystems.com/Support/Enterprise_Customers/Maintenance_and_Operations/Designing_the_architecture_of_your_OutSystems_applications/01_The_4_Layer_Canvas


Regards

-SK-

whats the difference if I make the 4 layers to 1 module? no difference right? I can make a lot web screen in 1 module


Calvin Adi wrote:

Joey Moree wrote:

Hey Calvin,

You can create multiple modules, so you can seperate logic, screen and data.

This way you can have 1 module which contains your data model and some logic (though you might even choose to seperate these also). And 1 module for your screens, this way of building is also featured in the lessons.

Besides that it is a general principle in programming.

The up side of this is that you can easily reference your logic and data in other modules, without having to expose your screen module (so that your screen module might consume data or logic from other modules), this is all to prevent cyclic references.

A module set to home will be the default module for this application, in ServiceCenter, when you open your application, there is a button that says, open in browser. This button will open the module that you selected as home.


Cheers,


Joey.

so, if I'm comparing like Java, the modules is like classes in java?



Yeah pretty much and the application would be the namespace.
But creating a module for every class might be a bit overkill. Outsystems is a low code platform after all.

Calvin Adi wrote:

whats the difference if I make the 4 layers to 1 module? no difference right? I can make a lot web screen in 1 module

Hi Calvin,

Modularity is the reason needed for large applications architectures. 

A very small app could be inside a single eSpace ofcourse, but eventually with growth you'll need code organization.

Regards,

Hi Calvin


In fact there isn't one unique answer to your question. That will depend deeply of the application complexity.


But I suggest  you learning session about architecture:


for example: hhttps://www.outsystems.com/learn/paths/8/architecting-sustainable-applications/


Best Regards

We had 1 main module (screens, database, actions...) (lets call here Base) and because it became too heavy, for new features we started o split in 'modules'.

Now that we are moving to 4LC, last month I created a new module called Portal which should be on top of all and redirect the user to the correct module (via buttons in portal home screen).

So we have when first login:

                   Portal 

      v                v                  v

Module 1    Module 2     Module 3

     v                 v                  v

                    Base 


'Base' is the very first eSpace so it has all database and permission roles (which I made them public) and because of history I can't create them elsewhere.

When I login I end up in Portal, which is correct. Then when I click in any button to enter other modules I get many invalid permissions in Service Center (xxx role required) and the message:

'There was an error processing your request. Please try again later... '

I'm not sure anymore what could be happening because last week everything was working fine, but now I doubt if was my cache or if I missed something on the way.

Is it related to the 'Set as home'? Because it was the 'Base' and now is the 'Portal'.

Question: how can I guarantee that permission roles from Base are persistent on all other modules?

Thank you in advance!

Carolina

Hi !!

Might have indeed relation to 'Set as home' because I changed it from 'Portal' back to the 'Base' (eSpace that has the public permission roles), published all again and then the application itself (Factory > Application > button Publish) and everything is working again.

:D

Carolina Bessa wrote:

We had 1 main module (screens, database, actions...) (lets call here Base) and because it became too heavy, for new features we started o split in 'modules'.

Now that we are moving to 4LC, last month I created a new module called Portal which should be on top of all and redirect the user to the correct module (via buttons in portal home screen).

So we have when first login:

                   Portal 

      v                v                  v

Module 1    Module 2     Module 3

     v                 v                  v

                    Base 


'Base' is the very first eSpace so it has all database and permission roles (which I made them public) and because of history I can't create them elsewhere.

When I login I end up in Portal, which is correct. Then when I click in any button to enter other modules I get many invalid permissions in Service Center (xxx role required) and the message:

'There was an error processing your request. Please try again later... '

I'm not sure anymore what could be happening because last week everything was working fine, but now I doubt if was my cache or if I missed something on the way.

Is it related to the 'Set as home'? Because it was the 'Base' and now is the 'Portal'.

Question: how can I guarantee that permission roles from Base are persistent on all other modules?

Thank you in advance!

Carolina

:D