public class AppRouter {
private static AppRouter m_appRouter = new AppRouter();
private HashMap<String, FromArgs> m_forms = new HashMap<String, FromArgs>();
private AppRouter() {
m_forms.put("FROM_MAIN", new MainForm());
m_forms.put("FROM_SEARCH", new SearchForm());
m_forms.put("FROM_BLAH", new BlahForm());
...
...
...
...
}
public static AppRouter get() {
return m_appRouter;
}
public void showForm(String formname, Object arg) {
FromArgs form = m_forms.get(formname);
if(form != null) {
form.showForm(arg);
}
}
}