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

Pages: [1] 2
Print
Author Topic: Using the PureMVC Java port with GWT?  (Read 35774 times)
ryebrye
Newbie
*
Posts: 7


View Profile Email
« on: June 25, 2008, 09:21:21 »

Has anyone used the PureMVC java port with GWT yet?

I can see how doing a parallel RIA with both GWT and Flex would be made much easier using PureMVC in both pieces.

Anyone tried it yet?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: June 26, 2008, 08:18:40 »

Yes, actually they have.

Luchiano Broussal, owner of GWM (the GWT WindowManager framework: http://www.gwtwindowmanager.org), recently alerted me that he had successfully ported the Java port to GWT.

Apparently it was necessary to actually port the port, due to GWT constraints. Here is what he recently told me:

Most of the modification i had to do are :
- i had to package the source for GWT since the packaging on GWT is specific.
- GWT doesnt support reflective API so newInstance call into Controller and MacroCommand can't be run that way under GWT
I've  introducted  a CommandProvider interface instead

/**
 * @author lbroussal
 */
import org.puremvc.java.client.interfaces.ICommand;
import org.puremvc.java.client.patterns.command.MacroCommand;

public interface CommandProvider {
    public ICommand getCommand(String command);
    public List<ICommand> getSubCommandList(Class<? extends MacroCommand> commandClass);
}

this is registered on the Facade and used into the Controller and into the MacroCommand

into the Controller
--------------------------

 public void registerCommandProvider(CommandProvider commandProvider) {
       this.commandProvider = commandProvider;
       
 }

public void executeCommand( INotification note )
    {
        Class<ICommand> commandClassRef =  this.commandMap.get( note.getName() );
        if (commandClassRef == null) {
            return;
        }
        try {         
            ICommand commandInstance = commandProvider.getCommand( note.getName());
            commandInstance.execute( note );
        } catch (Exception iae) {
           
        }
    }

into MacroCommand
------------------------------

 public void execute(INotification notification) {
        List<ICommand> subCommandsList = facade.getCommandProvider().getSubCommandList(this.getClass());
        for (ICommand command : subCommandsList) {
            command.execute(notification);
        }
    }

The Provider itself
---------------------------

public class MyCommandProvider implements CommandProvider {

    public ICommand getCommand(String command) {
        if(command.equals(ApplicationFacade.STARTUP))
            return new StartupCommand();
        if(command.equals(ApplicationFacade.SUBMIT_LOGIN))
            return new ProcessLogin();
        return null;
    }

    public List<ICommand> getSubCommandList(Class<? extends MacroCommand> commandClass) {
        List<ICommand> subCommands = new ArrayList<ICommand>();
        if(GWT.getTypeName(commandClass.getClass()).equals(GWT.getTypeName(StartupCommand.class.getClass()))) {
            subCommands.add(new PrepViewCommand());
            subCommands.add(new PrepModelCommand());
        }else {
            throw new RuntimeException("Unknow type command " + commandClass);
        }
        return subCommands;
    }
   

}

I've also try to use generic as much as possible and interface so i've  changed  some declaration from Vector to List and Hashtable to Map.

I've to clean and package a bit more and i will send you the code.

If you're interested in this port, then definitely contact Luciano over at his site, and see how you might get involved with it early. Otherwise, keep an eye out here, and you're sure to hear about it soon.

-=Cliff>
« Last Edit: June 26, 2008, 08:20:37 by puremvc » Logged
lbroussal
Newbie
*
Posts: 5


View Profile Email
« Reply #2 on: June 26, 2008, 10:08:15 »

Hi,

Thank you Cliff  for the summary.
I will provide very soon the source code.
Is it needed you open a new tab of the existing puremvc versions.

I don't know if you prefer i deliver it to you first or on the forum ....

Let me know but yes PureMVC works for GWT :)

Luciano
--
http://www.gwtwindowmanager.org
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: June 26, 2008, 10:27:31 »

Luciano,

Send it to me first for review and we'll see how to position it for distribution.

Thanks,
-=Cliff>
Logged
lbroussal
Newbie
*
Posts: 5


View Profile Email
« Reply #4 on: July 09, 2008, 12:30:27 »

hi Cliff,

Thank you.
I received mail about interest about the GWT port :)
To interested People :

I've delivered my version to the smart puremvc team.
They have to masterize it before delivering the official GWT version. As you can notice Pure MVC is a well designed and a well documented product. All this work as to be done on the GWT version to be well integrated with all existing PureMVC port.

Please hold on and keep confident.

Particular Thank you to Donald and Cliff.

Luciano
--
http://www.gwtwindowmanager.org
Logged
MMauny
Newbie
*
Posts: 2


View Profile Email
« Reply #5 on: July 09, 2008, 02:48:48 »

Hi all,

I'm interested in this port.
How long do you think the validation will take?

Moreover Luciano made non gwt changes to PureMVC, did this change will be merge with Java trunc?

Matthieu
Logged
dominik
Newbie
*
Posts: 1


View Profile Email
« Reply #6 on: July 09, 2008, 06:17:19 »

Same here,

it would be great to have this port from Luciano for GWT ASAP.

Thanks for this contribution Luciano.

Greetings

Dominik
Logged
atrox
Newbie
*
Posts: 1


View Profile Email
« Reply #7 on: July 09, 2008, 06:21:03 »

I haven't looked at it yet, but am *definitely* very interested.  Just noting the interest here to bump the thread ;).
Logged
glidealong
Newbie
*
Posts: 5


View Profile Email
« Reply #8 on: July 15, 2008, 01:56:34 »

Any updates please..?.. I am really interested in this topic, cuz that would really help us in streamlining our development process in both GWT and the Flex areas..

Cliff or anyother team members, can you give us some feedback on the status?

Thanks in advance.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #9 on: July 15, 2008, 06:02:31 »

Don is looking at this now and working with Luciano to determine the best way to handle this. We don't want to do a whole separate java port just for GWT. Instead we want to have a special build target that produces the jar for GWT.

Luciano does, I believe have his custom port available on his site, and if you really need to get ripping with it, you could start there.

Just know that more than likely the key difference between the eventual GWT support that the Java port will offer and the version on Luciano's site now is the package space.

He has org.puremvc.puremvc4gwt.*, I believe, and here it will be org.puremvc.java.*

So you'll have to swap jars and change your imports at a minimum. I don't yet know if there will be any method signature or practice changes, that's what Don and Luciano are sorting out.

-=Cliff>
Logged
twentyseven
Newbie
*
Posts: 1


View Profile Email
« Reply #10 on: August 29, 2008, 07:09:48 »

Do you have any update on this topic ?

Thanks,
Logged
glidealong
Newbie
*
Posts: 5


View Profile Email
« Reply #11 on: September 03, 2008, 08:46:55 »

Sorry to say this, i had been very impressed by the simplicity and effectiveness of puremvc for Flex development, we were waiting for this release to align gwt/flex development on similar lines. We cannot wait any longer for this to be a reality , bye for now to puremvc, we are planning to write a puremvc like framework implementation in GWT.

Anyway keep up the great work and thanks for the lightweight framework in AS3.

Best Regards,
Hafiz
Logged
lbroussal
Newbie
*
Posts: 5


View Profile Email
« Reply #12 on: September 17, 2008, 03:19:29 »

Hi all,

The actual version is available at http://code.google.com/p/purevmc4gwt/


Fill free to join the crew, me ;).

An official port space will be opened in the futur on PureMVC.

Cheers.

Luciano
Logged
Tekool
Sr. Member
****
Posts: 192


View Profile WWW Email
« Reply #13 on: September 17, 2008, 05:05:52 »

Hi,

I talk about it to a Java Developer colleague of mines that play a lot with GWT. I asked him to have a look into it. ;)

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #14 on: September 17, 2008, 05:07:01 »

I had intended to get the port set up in the repo this weekend but my plans were unfotunately foiled. It is still high on my list this week.

-=Cliff>
Logged
Pages: [1] 2
Print