Skip to content

Instantly share code, notes, and snippets.

@jagwire
Created May 7, 2013 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagwire/5532603 to your computer and use it in GitHub Desktop.
Save jagwire/5532603 to your computer and use it in GitHub Desktop.
Example M-V-P cell pattern for Wonderland U.
public class Cell {
//Do we need to contractually obligate developers to only use a single instance of a component based on class?
//The difference is in using a List or a Map.
Collection<State> states;
//Given an enum of types: Text, 2D, JME3
//We should keep track of the various views in a map. No two instances of a cell view should have the same type
Map<EnumViewType, CellView> views;
//The alternative here is to have a single view with view components
//I can see merit in there being a single presenter with perhaps its own presenter components as well
//This way we won't need a bunch of presenters.
CellPresenter presenter;
//The alternative here is to have a map of presenters with enumtype keys.
}
public interface CellView {
}
public class CellPresenter {
public CellPresenter(CellView view) { }
public void updateView(Cell data) { }
//perhaps the observable pattern can be used here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment