Application components in modular approach

The modular approach in new version 6.3RC looks promising, suitable for large applications will different modules.

I am testing this currently. I have questions in terms of what I can expect using this options:

I want to create my whole application in few modules e.g. Accounts, Sales, Inventory, HRIS. while I create 4 component projects for those 4 modules, I want one common login from the main project. Once the user has logged in, based on user’s log-in credentials up to 4 of those modules icon will be displayed in a page where each icon will launch respective modules in a separate pages. Is this workable here?

My second question related to this is: is it possible I can use inventory in sales module where both of them are component projects?

1 Like

Hi,

to have multiple components living inside of a shared CUBA application is definitively one of the use cases. Here’s an example of multiple application components within one main CUBA app: https://github.com/mariodavid/cuba-example-application-components

What do you mean by separate page?

Since application components can have other dependencies (other application components) it should be no problem to create a tree of application component dependencies. In the example above, you can add a dependency from the “appointments” component to the “project-management-platform” component - i would assume it works.

Bye,
Mario

Thanks Mario. Let explain a bit more.

  1. Say for example, in your example can I use any service or entity from business management platform into appointment ?

  2. if I want to run appointment and business management apps separately as well as can give users option to use both, then what I want to see is, after Lon-in, users will have two buttons for those two modules to launch. How can we achieve this in CUBA?

Hi,

regarding the first question:
Yes you can. Just add a dependency from the appointments component to the project-management-platform. With this you have a dependency to the global module of the component, which means that you can use the entitties as well as the service interfaces.

regarding the second question:
OK, so you have to be a little more precise about what you mean by “run apps separately”, because this has direct impact on your requirement to have a single login and a single UI starting point. Here’s what you can do:

There are three options to distribute only parts of your software to the customers:

  1. Ship all (put everything in a single war file). You can use application components or not - doesn’t really matter in this scenario because it will not impact the deployment story, only your code structure. But since it’s a general good idea to put a little bit of structure in your monolith, let’s assume you want to use application components. Create an CUBA app like project-management-app. Add you application components like “appointments” to the application. Then you distribute the software.
    The question what installation has what features can be turned on / off dynamically at runtime (through security contstraints, application properties that enable / disable certain features, license keys that will allow certain actions to be executed etc.)

  2. war building switch (create different war files for different scenarios). You can instead of shipping the whole war file, select certain parts through the dependencies part in the build.gradle file and through this switch off / on certain parts of your application (im not really aware of how much this process is automatable)

  3. microservices (ship every component as a war file). The other approach would be that you develop your application as a set of services. These can be deployed independently and therefore you can for every customer only ship the required (or allowed) services. The problem is here - this is distributed computing. Therefore when you want a integrated UX with something like single sign on, single UI entry point etc. you have to deal with doing the integration on a network / web layer (like a central authentication service etc.). Probably this approach would declare itself as something like Self contained System

Bye,
Mario

1 Like

Hi Mario
Thank you for those elaborations, I shall spend some time on those aspects especially shipping in modules.

What I’m thinking of is, after log in, before the menu is displayed, I want to display say 3 buttons in a screen for 3 modules. Based on user click respective module will be loaded and respective menu will be displayed. Those modules are application components but they have their own menu I.e. Like a separate application. Any ideas?

Hi Mortoza,

since 6.3 was released recently, i created a blog post about this feature and different strategies about application components. You might want to take a look: https://www.road-to-cuba-and-beyond.com/decompose-the-monolith/

Bye,
Mario

1 Like