Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

| * |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / General Discussion / question(s) regarding Java port code on: March 22, 2011, 08:21:38
Hello

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(){}with
:
public 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 of
:
public 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 of
:
public 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


Pages: [1]