G
G
goodman777072020-06-24 22:11:17
Android
goodman77707, 2020-06-24 22:11:17

What is the best way to divide a project into gradle modules?

Are there best practices for multi-module architecture? How do you divide into modules in your projects?
until I switched to modules, my project is divided into folders as follows:
di
ui
data
domain
I think they should be converted into modules, or divided like this:
login
home
, etc.
Which way is better?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Zagaevsky, 2020-06-25
@goodman77707

We use two types of modules - lib.
1) Feature module. This is a module containing one complete feature, such a module should not be connected to other modules, except for the main and sample app. This module usually has one (rarely more) entry point, conditionally - a fragment.
2) Utility module. This is a module containing some utility code that you want to rummage between different modules. Such a module can be connected anywhere. In such a module, there are usually quite a lot of public classes and functions (although there may be only one large class).
Judging by your breakdown, your project is small. What do you expect from splitting into modules? What for?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question