Call for volunteers to create SOAPGateway

I am been pretty focused on use the Flex RemoteObject tag and the AMF protocol that I have neglected the WebService tag. If anyone out there is trying to use SOAP or has the time I would greatly appreciate a WebServiceGateway to complement the AMFGateway and MessagingGateway classes. Anyone up for it?

Initializing your app

Depending upon timing in your flex app there is a possibility of your creationComplete=init() method executing and dispatching an event that uses the service layer before the service layer has been initialized. To handle this situation you need to use the MVCServicesInitializedEvent that is thrown by the framework like so:

public function init():void { // set up our MVC controller for this component addEventListener( MVCServicesInitializedEvent.MVC_SERVICES_INITIALIZED, servicesInit); controller = new MyAppController(this); if (getService() != null) { dispatchEvent(new MyAppInitEvent()); } } private function servicesInit(ev:Event):void { dispatchEvent(new MyAppInitEvent()); }

GEMVC used at NASA - Let me know if you are Using GEMVC!

GEMVC is being used for several projects at the Johnson Space Center. These include the Altair Lunar Lander Infomation Model tool suite (comprised of 5 Flex tools), the Stardust Sample Management Suite for the Astromaterials division, and the Project Management Toolkit for the Engineering Science Contract of the JSC Engineering Directorate.

Let me know where you are using it!

Thanks.

Event Reuse

There are times where you need one event to perform the behavior of another event you already have. In this case you have two choices: One, called context.dispatchEvent from your event handler and throw the new GEMVC Event or two, inherit from a base event, overriding the behavior where necessary. While case one is probably the cleaner way in terms of decoupling and is what is used when you want a higher level controller to handle a portion of an event a lower controller is handling, sometimes due to asynchronous nature of Flex you need to perform an action immediately before do anything else. In this case you just need to inherit the event you want to share and override its handleEvent method or any other methods it may have. You can then substitute your own handlers if the you make service layer calls. Since it is impossible to guess at what events someone may want to extend it is a good idea to code your GEMVC Events in such as way as they can be easily extended. This means that your variables and methods should be in the protected scope and your constructor should be designed to accept any event type string. The following code snippet shows how to set up your constructor:

public class ResetSelectedNodeEvent extends Event implements MVCEvent

{

public static const RESET_SELECTED_NODE:String = "RESETSELECTEDNODE";

protected var _pane:String;

protected var globalApp:MELApplication = MELApplication(Application.application);

protected var model:MELModel = MELModel(MELApplication(Application.application).model);

public function ResetSelectedNodeEvent(pane:String='',type:String=RESET_SELECTED_NODE):void

{

super(type, true, false);

_pane = pane;

}

By adding a type parameter, an extended event can supply its own event identifier but since it is optional, users of the base event do not have to change anything.

When to use nested controllers

A user asked me when they should create a sub-controller for a nested component instead of putting it all in the main controller. There is no hard and fast rule only two guidelines. 1) It is nice to use a sub-controller to modularize your code and place it along with the component in its own directory. 2) If your events do not need access to anything outside the component they are thrown from (other than the model) then use a controller for that component (the context passed to your event handlers will be that component). If you were to place them in the main controller not only would it clutter it up but since the handler context will now be the main component you will have to use dot notation to dig down into the component you need to deal with- sometimes necessary but never desirable.

Solicitation of Features for 1.1 Release

In preparation for the 1.1 Release I would like to solicit inputs for features that you would like to see (depending upon the request some may be pushed to further releases).

Currently I am looking at 4 main features: 1) Pluggable Controllers, 2) Hierarchical Controllers, 3) Better Decoupling of Views, and 4) Factories for event and controller creation.

[More]

BlogCFC was created by Raymond Camden. This blog is running version 5.5.006. | Protected by Akismet | Blog with WordPress