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]
Print
Author Topic: run into first errors  (Read 6022 times)
landed
Full Member
***
Posts: 37


View Profile Email
« on: April 27, 2009, 12:30:42 »

I have tried to start off on the right foot with my facade. It is failing and I would like to work out the next step. It kicks off as the compiler errors have been commented out

I have
:
package at.landed
{

import org.puremvc.as3.interfaces.*;
import org.puremvc.as3.patterns.facade.*;
//import at.landed.view.*;
//import at.landed.model.*;
//import at.landed.controller.*;
// A concrete Facade for MyApp
public class LandedFacade extends Facade implements IFacade
{
// Define Notification name constants
public static const STARTUP:String = "startup";
public static const LOGIN:String = "login";
// Singleton LandedFacade Factory Method
public static function getInstance() : LandedFacade
{
if ( instance == null ) instance = new LandedFacade( );
return instance as LandedFacade;
}
// Register Commands with the Controller
override protected function initializeController( ) : void
{
super.initializeController();
//registerCommand( STARTUP, StartupCommand );
//registerCommand( LOGIN, LoginCommand );
//registerCommand( LoginProxy.LOGIN_SUCCESS, GetPrefsCommand );
}
// Startup the PureMVC apparatus, passing in a reference to the application
public function startup( app:MyAp ) : void
{
sendNotification( STARTUP, app );
}
}
}

so for example StartupCommand is undefined and I dont have any views models or controllers created yet in my application.

Do I just create a view for example, but what should it extend etc...there seems to be little documentation on this kind of thing, once I get started I will be ok. I would like just a simple view say a button which when I click does a sum in the model via a dispatched command. and the view updates by showing something.

What is the next step.thanks
« Last Edit: July 21, 2009, 02:43:44 by landed » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: April 28, 2009, 09:14:24 »

The next step all depends on what you want to do. Without those commands being defined, they can't be registered, which means we can't get the plane off the ground. We're 'landed' from the start :)

A good place to begin if you are using Flex, is to examine how the EmployeeAdmin demo works. It shows you how do distribute data from the model tier to the view tier and how to decompose the view tier in to components that are tended by mediators. It shows a pretty standard Facade class with a straightforward startup process.

-=Cliff>


Logged
Pages: [1]
Print