Time to refactor

There comes a time in the life of every active project in which the starting design is not sufficiently general, and two paths are open: patch, or refactor. If you also are learning a new API in the process, as in my case, there is only one responsible course: it’s time to refactor!
Why have I reached this point in a project so small and young as OTempo? Because I am implementing a widget for the desktop and a service, and of course, I face the monster of duplicated code. The initial design, if there was any, was directed to a simple application accessing information from a single point.
From what I have learned in the documentation for Android, it seems that I should focus the refactoring on giving more weight to the service, simplifying to the maximum the activity and the widget. Since the widget requires periodic updates, which will lie in the service, this will bring exciting improvements to existing code, as users will not need Internet access when opening the application. The service will monitor Internet access to update when possible and always have fresh data.
The great advantage of taking this path is that, from this process, a design pattern will emerge that I will be able to apply in future projects, and therefore enhance my learning of the platform.

Anuncios

Acerca de Rubén L.

Software Engineer
Esta entrada fue publicada en android, English y etiquetada , , , . Guarda el enlace permanente.

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s