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 / Fabrication / Trouble strongly typing custom Notifications on: March 23, 2009, 05:55:51

Hi all, first of all this is an amazing library thank you so much Darshan for your excellent work.

I'm studying http://code.google.com/p/fabrication/wiki/ReflexiveNotificationInterests but having trouble strongly typing my notifications as it won't compile. The error I get is:

:
"Incompatible types String and ContextMenuNotification. 'newContextMenuNotification(ContextMenuNotification.ADD_MENU)'"

Here is the Command code that the error happens in:

:
public class BossStartupCommand extends SimpleFabricationCommand {
        registerMediator( new BossMediator( notification.getBody() ) );

// WORKS
// sendNotification( ContextMenuNotification.ADD_MENU );
// DOES NOT WORK
sendNotification( new ContextMenuNotification( ContextMenuNotification.ADD_MENU ) );


}

In my Mediator I have a respondTo function which works fine with INotification as the argument & a vanilla Notification is sent but never gets called when I swap it for my strongly typed version:

:

// OK - public function respondToAddMenu( args : INotification ) : void {
// NEVER CALLED - custom notification for strong typing
public function respondToAddMenu( args : ContextMenuNotification ) : void {
trace("add the menu");
}


My Notification is simple and is extending the Fabrication version, here's the code:

:

package {
import org.puremvc.as3.multicore.utilities.fabrication.patterns.observer.FabricationNotification;

public class ContextMenuNotification extends FabricationNotification
{
public static const ADD_MENU:String = "addMenu";

public function ContextMenuNotification (__evtType : String = "undefined")
{
super( __evtType );
}
}
}


I am using the latest versions of PureMVC Multicore, Pipes & Fabrication with Flash (Not Flex) in FDT. Can anyone point out what I'm doing wrong please? Many thanks :)
2  PureMVC Manifold / Standard Version / Command & View Abstraction for 3rd party 3D Engines & Maps on: February 18, 2009, 06:00:45

Greetings one and all,

I'm pretty new to PMVC but have read all the docs & am comfortable with the majority of the framework. Most of it is very clear however I have some questions regarding what logic to split into Commands and what belongs embedded within it's own ViewComponent specifically regarding 3rd party 3D & Maps Engines that already have their own predefined API's (e.g. PaperVision/Away3D/GoogleMaps/Yahoo Maps)

I am building a weather display app. The main structure is done but I want to create a ViewComponent that contains a 3D model of some terrain and is capable of simple 3D transformations. I have not yet decided on which 3D engine to use (Papervision or Away3D - because PV is easy but I may add Flint support later and this renders much faster in Away) and want to delay this decision and reduce the reliance of the application to any particular 3rd party engine & require the minimum amount of code modification were I to switch 3D engine half way through development.


...so I seek the forums advice on how best to abstract the 3D engine out and reduce coupling as much as possible. For best practice; would you recommend I:

1.) Just keep all the rotation control and view within one complex Mediator per 3D engine for simplicity:
...view
PVisionMediator
Away3DMediator


2.) Have a Mediator for each engine and a Command for each transformation that is NOT engine specific:
...view
PVisionMediator
Away3DMediator
...controller
3DRotateCommand
3DLookAtCommand


3.) Have a Mediator for each engine and a Command for each transformation that is engine specific:
...view
PVisionMediator
Away3DMediator
...controller
PVisionRotateCommand
Away3DRotateCommand
PVisionLookAtCommand
Away3DLookAtCommand

I am also intrigued as a relative newbie:
- Am I being too ambitious in terms of the level of abstraction?
- Am I misunderstanding the type of logic (domain/business)which should be in Commands?

My first post on the forum! Thanks so much for reading, sorry it took a while to explain,

Warm Regards,

Rob
www.robmccardle.com
Pages: [1]