You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
В проектах с чистой архитекторой, чаще всего пакеты формируют по фичам или слоям. Примеры есть в статье http://www.javapractices.com/topic/TopicAction.do?Id=205.<br>
74
74
Примерная структура проекта может быть такой:<br>
75
-
-di<br>
76
-
---app<br>
77
-
---payments<br>
78
-
---operation<br>
79
-
-presentation<br>
80
-
---view<br>
81
-
-----payments<br>
82
-
-------PaymentsView<br>
83
-
-------PaymentsFragment<br>
84
-
-----operations<br>
85
-
-------OperationsView<br>
86
-
-------OperationsFragment<br>
87
-
---presenter<br>
88
-
-----payments<br>
89
-
-------PaymantsPresenter<br>
90
-
-----operations<br>
91
-
-------OperationsPresenter<br>
92
-
-domain (он же business)<br>
93
-
---payments<br>
94
-
-----PaymentsInteractor<br>
95
-
-----PaymentsInteractorImpl<br>
96
-
-----CurrencyHandler (вспомогательный класс для PaymentsInteractor)<br>
97
-
---operations<br>
98
-
-----OperationsInteractor<br>
99
-
-------rubs<br>
100
-
---------OperationsInteractorRubs<br>
101
-
---------RubsManager (вспомогательный класс для OperationsInteractorRubs)<br>
102
-
-------currency<br>
103
-
---------OperationsInteractorCurr<br>
104
-
---------CurrencyManager (вспомогательный класс для OperationsInteractorCurr)<br>
105
-
-repositories<br>
106
-
---payments<br>
107
-
-----PaymentsRepository<br>
108
-
-----PaymentsRepositoryImpl<br>
109
-
---operations<br>
110
-
-----OperationsRepository<br>
111
-
-----OperationsRepositoryImpl<br>
112
-
-data<br>
113
-
---network<br>
114
-
---db<br>
115
-
-models (по сути хранилище всех dto)<br>
116
-
---payments<br>
117
-
-----PaymentsModel<br>
118
-
---operations<br>
119
-
-----presentation<br>
120
-
-------OperationUIModel<br>
121
-
-----domain<br>
122
-
-------OperationsRubModel<br>
123
-
-------OperationCurrModel<br>
124
-
-----data<br>
125
-
-------OperationsRubNetworkModel<br>
126
-
-------OperationCurrNetworkModel<br>
75
+
```
76
+
project
77
+
├─ di
78
+
│ ├─ app
79
+
│ ├─ payments
80
+
│ └─ operation
81
+
├─ presentation
82
+
│ ├─ view
83
+
│ │ ├─ payments
84
+
│ │ │ ├─ PaymentsView
85
+
│ │ │ └─ PaymentsFragment
86
+
│ │ └─ operations
87
+
│ │ ├─ OperationsView
88
+
│ │ └─ OperationsFragment
89
+
│ └─ presenter
90
+
│ ├─ payments
91
+
│ │ └─ PaymantsPresenter
92
+
│ └─ operations
93
+
│ └─ OperationsPresenter
94
+
├─ domain (он же business)
95
+
│ ├─ payments
96
+
│ │ ├─ PaymentsInteractor
97
+
│ │ ├─ PaymentsInteractorImpl
98
+
│ │ └─ CurrencyHandler (вспомогательный класс для PaymentsInteractor)
99
+
│ └─ operations
100
+
│ ├─ OperationsInteractor
101
+
│ ├─ rubs
102
+
│ │ ├─ OperationsInteractorRubs
103
+
│ │ └─ RubsManager (вспомогательный класс для OperationsInteractorRubs)
104
+
│ └─ currency
105
+
│ ├─ OperationsInteractorCurr
106
+
│ └─ CurrencyManager (вспомогательный класс для OperationsInteractorCurr)
107
+
├─ repositories
108
+
│ ├─ payments
109
+
│ │ ├─ PaymentsRepository
110
+
│ │ └─ PaymentsRepositoryImpl
111
+
│ └─ operations
112
+
│ ├─ OperationsRepository
113
+
│ └─ OperationsRepositoryImpl
114
+
├─ data
115
+
│ ├─ network
116
+
│ └─ db
117
+
└─ models (по сути хранилище всех dto)
118
+
├─ payments
119
+
│ ├─ PaymentsModel
120
+
└─ operations
121
+
├─ presentation
122
+
│ └─ OperationUIModel
123
+
├─ domain
124
+
│ ├─ OperationsRubModel
125
+
│ └─ OperationCurrModel
126
+
└─ data
127
+
├─ OperationsRubNetworkModel
128
+
└─ OperationCurrNetworkModel
129
+
```
127
130
128
131
Разбивать только по слоям или фичам невсегда бывает удобно, поэтому гибридный вариант, когда внутри одного пакета слоя могут быть пакеты с фичами, вполне приемлим.<br>
0 commit comments