Created
May 7, 2013 13:37
-
-
Save jagwire/5532603 to your computer and use it in GitHub Desktop.
Example M-V-P cell pattern for Wonderland U.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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