Android / Architecture

Modeling my presentation layer

After modeling my domain layer here it comes, modeling my presentation layer. The reason for this post is that I saw in many projects that are moving from a legacy codebase to an MVP approach that there are some issues trying to differentiate what belongs to the presentation layer and what belongs to the UI …

Android / Architecture

Say goodbye to all main thread problems in MVP

Months ago I created a sample project demonstrating clean architecture in Android, you can see it here. One of the main problems when I created this project was the threading, in Android if you do too much work in the Ui thread you have drawing problems and your Ui can seem unresponsive while you keep …

Android / Architecture

Another approach to handle domain errors

Handling the internal domain errors as exceptions was a bad idea and I didn’t like since the beginning. For me an Exception must be thrown when there is no other choice, the method can’t deal with that action and the caller has any options to handle this, if the caller does not have any options why …

Android / Architecture

Modeling my Android domain layer

Since my last post about why I don’t use a pure repository pattern in Android I received some feedback and I want to explain how I organize my domain layer.

What should be my domain layer

Everything. No, seriously, everything that are decissions that your app makes in order to request data must be in this layer. …

Android / Architecture

Clean Contacts injectors are now proguard friendly

One of the awesome proguard features is the ability to strip the non-used code that you are packaging to the final apk, is really a nice feature because it removes a lot of size of our final apks and also strips the method number for the dex count (remember the 65k dex method limit)

The problem …

Android / Architecture

New implementation of Interactor Invoker

The interactors are the part of the business logic that follows the command pattern, one example implementation in Java is, for example, the ThreadPoolExecutor and the Runnables. The ThreadPoolExecutor is the invoker that executes the runnable (command). When we are using Interactors in our clean approach we are following the command pattern, so I’ve wrapped …

Android / Architecture

New weapons against the bus

Hi, today I gave a talk in Droidcon Spain about Clean architecture, quite similar to the Salamanca but with some fixes and improvements over this implementation. Now I don’t use a bus for this architecture anymore and I reduced the boilerplate.

New implementation of Interactor Invoker

The new implementation of the invoker is based on Futures and …

Android / Architecture

Clean Android without bus

A lot of people are wondering why use a bus in my Clean Android implementation (Clean-Contacts repo on GitHub). And the reply is simple: I need to to get the reply of a previously launched interactor in a new instance of a presenter because on a rotation change the presenter is destroyed also the view, …

Android / Architecture

VIPER hangout

El pasado Miércoles 28 estuvimos hablando por hangouts on air Alberto Moraga, Pedro Piñera y yo sobre VIPER y en general arquitectura, os dejo las preguntas que se hicieron contestadas y el video del evento.

¿Qué beneficios habéis visto con este tipo de arquitectura?

Poder testar todas tus capas, independientemente de sus dependencias
Que tengas claro en todo …