Ive been using PureMVC in some Flex3/4 applications for a while now and Im definitely a fan.
I was looking into the Java port as most of my development work is actually Java-based.
When browsing through the source code I noticed there were some architectural choices that I didnt fully understand.
1. Why arent classes like Mediator and Proxy made abstract? I simply cannot think of a use case where anyone would use the base classes anyway...
Also, it would better (and cleaner) to replace
public void onRegister(){}
withpublic abstract void onRegister();
If however, it is intended that these classes are not abstract and indeed instantiable, please enlighten me with a use case.
2. What is the logic behind not using Generics in, for example, the following cases:
public class Mediator extends Notifier implements IMediator, INotifier
{
//...
private Object viewComponent = null;
//...
}
instead ofpublic class Mediator<T> extends Notifier implements IMediator<T>, INotifier
{
//...
private T viewComponent = null;
//...
}
or
public class Proxy extends Notifier implements IProxy
{
//...
private Object data = null;
//...
}
instead ofpublic class Proxy<T> extends Notifier implements IProxy<T>
{
//...
private T data = null;
//...
}
There's more examples like this. Wouldn't this avoid lots of casting?
Any input appreciated!
Greetings,
Bart