My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
GuitPresenter  
GuitPresenter features
Updated Sep 7, 2010 by gal.dol...@gmail.com

Introduction

Guit 1.5 introduces the GuitBinder and an abstract presenter implementation: GuitPresenter.

This document describe what features they have and why they will make your application faster than ever.

Laziness + Recycling = Speed

Laziness

The GuitPresenter is designed for lazy view instantiation.

How does it work?

  • Instantiate a presenter
  • initialize() is called after everything gets injected
  • Someone call getView()
  • A view is recycled or instantiated if necessary
  • @ViewInitializers methods get called
  • You show you pretty view to your user
  • Someone call releaseView()
  • All view event handlers are removed and the view goes to a recycling pool
  • You can call getView() -> releaseView() any number of times
  • Someone call destroy() and the presenter is no longer usable

Recycling

The recycle pool is automatically enabled for all your GuitPresenters.

Memory vs cpu

It is hard to find the right balance between this two.

In the current implementation when a view is pushed into the recycling pool and nobody reuse it after 5s, it gets destroyed to release the memory. This time will probably be configurable.

I am pretty happy how this end up, but ANY IDEA OF A BETTER RECYCLING IMPLEMENTATION IS WELCOME.

Powered by Google Project Hosting