All Questions
12 questions
0
votes
0
answers
333
views
Best practice for Asynchronous CRUD operations in Android/Java
A few months back, I was working on designing a client API (FooManager) for adding/removing/fetching a list of objects (Bar).
The requirements were simple-
1. Fetch operation is CPU-intensive and ...
0
votes
2
answers
255
views
Is this Singleton-like design pattern a feasible framework to build on?
I am posting this question here after it having been determined to be "off-topic" for stackoverflow, and "too hypothetical" for codereview.
I am experimenting with different singleton-style design ...
3
votes
1
answer
678
views
Is Content Observer an implementation of Observer Pattern?
Observer Pattern is defined by the 'Gang of Four' Design Patterns book as a "one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated ...
2
votes
4
answers
3k
views
Put conditional logic inside method for DRY, or keep it outside for readability?
Take the following example which loads an interstitial ad every 10 times user does XYZ in the app, under certain conditions. It is called in multiple places in the code base:
public class AdHandler {
...
1
vote
1
answer
2k
views
MVP: Should a View have multiple Presenters?
Is it desirable (from an architectural standpoint) to have more than one Presenter communicating with a View?
In my particular situation I have one presenter communicating with multiple views, and ...
1
vote
2
answers
328
views
Is this one method interface a good response to this interview question?
Today I received a rejection letter from a company where as part of the interview process they gave a a couple days to respond to the following question (paraphrased):
Let’s say say you have ...
2
votes
2
answers
693
views
Is 20 Java classes for just making a REST call too much?
In an Android project, I am using dagger 2 for dependency injection, applying mvp design pattern, and I am writing interface for almost every class. Although it does achieved the separation of ...
2
votes
1
answer
755
views
Is IntentService an implementation of Command Pattern?
According to Wikipedia:
In object-oriented programming, the command pattern is a behavioral design pattern in which an object is used to encapsulate all information needed to perform an action or ...
4
votes
2
answers
4k
views
Class becoming God Object what pattern to use
I am developing Android app and my MainActivity is becoming God Object.
By the way native Activity class implementation is some sort of God Object already.
The problem is that my activity class is ...
7
votes
2
answers
5k
views
how can the presenter or view interact with the model in the MVP pattern?
I'm learning the MV* patterns. MVP in this case. I'm trying to refactor an old android application into the MVP pattern to make things less tightly coupled, but I'm struggling one one concept. I know ...
1
vote
1
answer
577
views
Android Data persistence question
I have an android app in which users have sets of items, and each item has about 10 properties.
What I do at the moment:
items are stored in the server database
when the user logs in, I get all the ...
2
votes
1
answer
996
views
Best practice for combining a Java Applet/ Android interface?
I'm working on an online game, which I am seriously considering writing a Java Applet for it. The game is not overly complex on the features. I'm considering at some point having at least 3 versions ...