Skip to main content

All Questions

1 vote
3 answers
319 views

Which option is best, when you have an attribute that is a list?

I have a class containing a list, for example: class User{ .... List<String> cards ... } What's the best way to provide access to this member? List<String> getCards() or String ...
Tlaloc-ES's user avatar
  • 387
2 votes
1 answer
507 views

Is it good approach to create new viewModel class for every new Ui(Fragment/Activity)?

I am working on a project in which I am following clean Architecture from Google ... and for making code testable I am following an approach in which,I am creating a new ViewModel Class ViewModel ...
Kamran Ali's user avatar
-2 votes
1 answer
2k views

How to clean a refactor Java for-if-try-catch-else kind of messy code [duplicate]

Often I came across situations like this, how to write this code in a neat and clean way. One more issue I find here is performance as I am iteration a list and then it's properties. Edit : - while ...
ifelse.codes's user avatar
4 votes
2 answers
896 views

Clean Architecture: get instance in inner circle of class from outer circle

This might be an easy question for experienced software engineers. I'm currently reading the book Clean Architecture by Uncle Bob, and I'm trying to implement clean architecture in a Java project. ...
weibeld's user avatar
  • 161
4 votes
2 answers
4k views

Clean Architecture: Apps that rely heavily on background services

I am trying to implement clean architecture (https://8thlight.com/blog/uncle-bob/2012/08/13/the-clean-architecture.html) on an Android app. As an example, let's say that all the app does is monitors a ...
HPage's user avatar
  • 253
3 votes
1 answer
215 views

Clean Architecure: Creating an entity from a set of other entities

I have an app that collects data points throughout the day. Each data point is stored in a DataPoint object (that is persisted in the DATA_POINTS) table. I also have a DataPointRepository with basic ...
HPage's user avatar
  • 253
70 votes
4 answers
59k views

Uncle Bob's clean architecture - An entity/model class for each layer?

BACKGROUND : I'm trying to use Uncle Bob's clean architecture in my android app. I studied many open source projects that are trying to show the right way to do it, and I found an interesting ...
Rami Jemli's user avatar
5 votes
2 answers
3k views

"Clean Code": How to organize named queries?

Few days ago I started to read Robert C. Martin "Clean Code" book and it encouraged me to look more detailed at my code. After I opened eclipse I saw this: entityManager.createNamedQuery("...
pepuch's user avatar
  • 153