Skip to main content
43 votes
Accepted

Clean Architecture - Too many Use Case Classes

Do I really have to make 24 use cases? Only if everything you write is CRUD. Refer to the diagram below: Your assertion is that you will have six different entities, and 4 methods (Create, Read, ...
Robert Harvey's user avatar
16 votes
Accepted

Should business logic be in the app or in the backend?

It should be on a case-by-case basis but I would expect most of the logic to go in the backend. Your interactor might still contain several methods ("Check ticket availability", "Add ticket to basket"...
just me's user avatar
  • 653
14 votes
Accepted

Difficulties in reading code

I have more than 20 years of experience and I am profoundly lazy. I work in many platforms. The way I read and understand someone else's code is primarily with my fingers. Why yes I am the kid who ...
candied_orange's user avatar
14 votes
Accepted

Access multiple entities in repository - clean architecture

Your repository doesn't break the "clean architecture", which identifies entities as the core, requires dependency inversion, but doesn't impose to use repositories. But your repository ...
Christophe's user avatar
  • 82.1k
13 votes
Accepted

Proper way to name a class which has just methods and not fields

If a class is properly encapsulated it's hard to tell if it even has fields from outside. Some classes are immutable. You can't change their fields once their objects are constructed. Your class is ...
candied_orange's user avatar
10 votes
Accepted

Why doesn't CharSequence define contains(CharSequence)?

The point of CharSequence is to provide a read-only view to a character sequence, and that's it. This interface does not provide any string manipulation or searching methods. Those are out of scope. ...
amon's user avatar
  • 136k
10 votes
Accepted

Unit Testing in VIPER Architecture: Possible?

Oh it's possible. It just doesn't look like what you want it to look like. What you're complaining about is the use of output ports1,2,3 to communicate results rather then returning results. Does this ...
candied_orange's user avatar
10 votes
Accepted

What is the correct way to configure a testing mode on a class?

You should use a different approach. The commonly advised approaches are Use DI to inject the firestore object into your repository class instance. This way, your test framework can just inject a ...
Bart van Ingen Schenau's user avatar
9 votes
Accepted

Keeping version parity between platforms

When most of your code base is shared for both platforms, I would avoid getting version numbers "out of sync", because it will bring a lot more effort for writing a coherent changelog or ...
Doc Brown's user avatar
  • 220k
8 votes
Accepted

Pure Dependency Injection - How to implement it

You've probably finished your course by now, but in case you are still searching, or someone else is: rolling your own DI is actually very simple on Android once you know how to do it. Creating the ...
asaf android's user avatar
8 votes

Put conditional logic inside method for DRY, or keep it outside for readability?

I think that the logic in the existing code base is fine. I think that the method name is the issue. Instead of naming it showInterstatialAd, why not name it something that tells what the method does,...
Deacon's user avatar
  • 767
8 votes
Accepted

Best practices for app-cloud synchronization of database representation

You are trying to create a distributed eventually-consistent system. Those are inherently complicated. It's understandable that you are having difficulty coming up with a good solution because there ...
amon's user avatar
  • 136k
8 votes
Accepted

Is recommendable set as final as classes by default in a SDK?

In general, unless you're specifically designing your classes to be inheritable, it's better to mark them final. Here's why: you can't predict how someone might use your class. If you allow ...
Robert Harvey's user avatar
7 votes
Accepted

Best way to Model Classes associated with other Classes?

It feels like a good number of things are missing, to be honest. A Team has many Players. A Match is played between two Teams. A Season is composed of many Matches. A Season is managed by a ...
Greg Burghardt's user avatar
6 votes

Proposed Method to Restrict API Access to Mobile App Only

Some comments Your mechanism relies upon the secrecy of an algorithm, a technique known as security through obscurity, which is almost universally deemed a bad idea. It is not likely you will be able ...
John Wu's user avatar
  • 27k
6 votes

Is this Singleton-like design pattern a feasible framework to build on?

It makes perfect sense to have only one instance of a class if it has a large cost when being initialized or it allows continuous operation as in your case. But that does not indicate that the rest ...
Bent's user avatar
  • 2,596
6 votes

Should business logic be in the app or in the backend?

The very definition of the terms "front end" and "back end" comes from the separation of business logic (back end) from the user interface (front end). So yes, business logic should be in the back-end,...
casablanca's user avatar
  • 5,004
6 votes
Accepted

In mobile games that work across android and iOS is game logic written twice?

Three words: cross-platform compatibility. If you write your game in HTML and Javascript, it will run on any platform where there is a web browser on the device (which is most devices nowadays). If ...
Robert Harvey's user avatar
6 votes

Can you modify the front-end source code of a mobile app?

It's not just that people might be able to hack into your front-end app. They might be connecting directly to your server with an app that they wrote themselves. I can get around whatever security ...
gnasher729's user avatar
  • 49.4k
6 votes

How to Deploy Machine Learning Model on Wearable Edge Devices?

But the deployment constraint says the model has to be deployed on a low power proprietary wearable device with <50 ms latency My biggest piece of advise is to get more information about this ...
Bart van Ingen Schenau's user avatar
6 votes

How to Deploy Machine Learning Model on Wearable Edge Devices?

I'm making a wild guess that "low power proprietary wearable" means a microcontroller, and probably an ARM-based one. The good news is that there are libraries like LiteRT (formerly known as ...
ojs's user avatar
  • 207
5 votes

String[] args vs (String . . . args)

A feature of String[] vs String... is that the "String..." does not need to be part of the call. public void test(String... args){ if(args.length > 0){ for( String text : args){ ...
GetBackerZ's user avatar
5 votes

Push notification from web application to my mobile app

There is no need to reinvent the wheel and there are plenty of solutions out there that makes pushing notifications to mobile devices easier. I personally would recommend Firebase Cloud Messaging by ...
Dean Meehan's user avatar
5 votes

Is there any rule of thumb regarding which version of Android you should target, minus the current version?

There is no rule you can apply to every app. You need stats on market penetration for each version, and cross reference that with what your app needs to do. Some older versions of Android might not ...
Greg Burghardt's user avatar
5 votes
Accepted

Can you modify the front-end source code of a mobile app?

Yes of course. People like to think that because a lay person can't read the source code for compiled or even "transpiled" applications in the same way you can with javascript on a website that it's ...
Ewan's user avatar
  • 84.4k
5 votes
Accepted

Designing Password Recovery for an Offline-First Password Manager

I think the standard approach here is to have a recovery key that the user stores "in a safe place" The key is much longer than a password and presumably harder to crack. You rely on the ...
Ewan's user avatar
  • 84.4k
4 votes

Clean Architecture - Too many Use Case Classes

You are right if every CRUD-Operation is translated in one UseCase. But a UseCase may also consist of multiple CRUD-Operations. A UseCase is a separated model gathers information from different data ...
oopexpert's user avatar
  • 789
4 votes
Accepted

encrypting a string with public key in client side and decrypt it in backend using private key

Implementing your own crypto is likely to be error prone, so please don't do that. If you are trying to encrypt data in transit between your app and your backend (i.e. provide confidentiality for ...
amon's user avatar
  • 136k
4 votes
Accepted

Best Practice for handling data sync with React Native, MobX and REST?

The best practice is to use persistent storage which facilitates offline-first development and offers built-in client/server data sync, such as PouchDB/CouchDB: The PouchDB API provides a method for ...
4 votes

Android - Clean Architecture - best way to structure packages?

Uncle Bob would probably prefer seeing the "business intend" of ur app in the top level folder structure. This is what I means with "screaming architecture". so as I have described in my blog post ...
plainionist's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible