Gallo_Teo
|
|
« on: January 04, 2009, 07:39:47 » |
|
In java you can't use default parameter so i think it's better to overload some pureMVC methods
in Notification class
public Notification( String name, Object body, String type ) { this.name = name; this.body = body; this.type = type; }
public Notification(String notificationName, Object object) { this(notificationName, object, null); } public Notification(String notificationName) { this(notificationName, null); }
in facade classe
public void sendNotification( String notificationName, Object body ) { notifyObservers( new Notification( notificationName, body, null ) ); }
public void sendNotification( String notificationName ) { notifyObservers( new Notification( notificationName, null ) ); }
so it is quite more usable
i still have problems undestanding how to link views and mediators in java because i can't use bubbled events so a lot fo boring code is required
i'm studing a better way to handle notifications in mediator because we can't use String with switch statement, probably the best way is tu use enumeration but we can't extend it later so i don't know if it is a good solution, what do you think about ?
Teo
|