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 [2] 3
16  Announcements and General Discussion / Architecture / Re: Air sqlite Proxy question on: March 07, 2008, 04:59:39
Just checked out code peek, with the AbstractProxy, seems like that may be the better way to have one database provide data to multiple proxies.  Is this correct?
17  Announcements and General Discussion / Architecture / Re: Air sqlite Proxy question on: March 07, 2008, 04:43:54
ok, so what about this line of thought.  I have one database, three proxies.  The proxies are databaseProxy, userProxy, and playProxy.

I'm basically creating the databaseProxy in order to create one point of access to database creation and access (I'm going to try and use the DAO pattern for the creation and access).

So in my modelPrepCommand I have

facade.registerProxy(new databaseProxy());
var dbProxy = facade.retrieveProxy( databaseProxy.NAME ) as databaseProxy;
facade.registerProxy(new userProxy(dbProxy));
facade.registerProxy(new playProxy(dbProxy));

Then I can access that databaseProxy from my user and play Proxies using the getData method they inherit from Proxy.  Is this a good way to structure this 2 proxies wanting different portions of the same dataobject? 


18  Announcements and General Discussion / Architecture / Re: ViewStacks, Mediators and Deferred Instantiation on: March 06, 2008, 09:13:23
Oh man, I think I just understood your mainDisplay take 1 take 2 Post!!  That is exciting for me:>   
19  Announcements and General Discussion / Architecture / Re: ViewStacks, Mediators and Deferred Instantiation on: March 06, 2008, 09:04:41
Thanks again.
20  Announcements and General Discussion / Architecture / Re: Air sqlite Proxy question on: March 06, 2008, 03:48:02
Thanks again.
21  Announcements and General Discussion / Architecture / Re: Air sqlite Proxy question on: March 05, 2008, 11:05:44
Outside of the DAO pattern, would it be a good idea to create a Database proxy that populated a value object that was accessible from a variety of mediators or commands. 
22  Announcements and General Discussion / Architecture / Re: Air sqlite Proxy question on: March 05, 2008, 10:21:39
Thanks, I'm sure I'll have that figured out lickidy split  ???
23  Announcements and General Discussion / Architecture / Re: ViewStacks, Mediators and Deferred Instantiation on: March 05, 2008, 10:19:48
Yeah, about commands.  I've read your documentation, read a ton of blogs about puremvc and thought I understood them until I started working with this stuff.  I don't see any reason to do any commands yet in my application (outside of startup).  Do commands make more sense when you have more than one thing to do off of an event?  Right now my stuff is real basic, pressing a button and then switching a viewstack selected index.

Also, earlier in this post you wrote
selectedIndex="{currentView}"

did you mean selectedIndex="{currentViewSelector}"

or am I super dense?
24  Announcements and General Discussion / Architecture / Re: ViewStacks, Mediators and Deferred Instantiation on: March 05, 2008, 08:06:35
Not to switch gears here, but do I even need a viewstack, or should I just adjust my components visible values in the mediators.  If I just register my components to listen for the correct events I should be able to handle everything in the mediator right?  Is that a bad way to do it.  Sorry for all these questions, but this is really new to me.   
25  Announcements and General Discussion / Architecture / Best Practices Question -- menu component on: March 05, 2008, 02:34:51
I have a set of buttons that when clicked create a new Menu.  In that menu I want to be able to trap mouseclicks and create an event that will talk with the appropriate mediator.  Can anybody tell me if I am doing this in the recommended PureMVC way.  Here is my code for the menu component.

:
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="1000" height="200">
<mx:Metadata>
[Event('importGame')]
[Event('modifyGame')]
[Event('generateReports')]
[Event('exportData')]
</mx:Metadata>
<mx:Script>
        <![CDATA[
            import mx.controls.Menu;
import com.wolffebrothers.gametimetech.*;

            public static const importGame:String    = "importGame";
            public static const modifyGame:String    = "modifyGame";
            public static const generateGame:String  = "generateReports";
            public static const exportGame:String    = "exportData";
            // Create and display the Menu control.
            private function createAndShow():void {
            //call notification ? JJM
                var myMenu:Menu = Menu.createMenu(null, myMenuData, false);
                myMenu.labelField="@label";
                myMenu.show(10, 50);
                myMenu.addEventListener(MouseEvent.CLICK, mainMenuClicked);
            }
           
            public function mainMenuClicked(event:Event):void {
            trace("Main menu clicked");
            dispatchEvent( new Event( importGame ) );
            }
        ]]>
    </mx:Script>
<!-- send to Proxy JJM -->
    <!-- Define the menu data. -->
    <mx:XML format="e4x" id="myMenuData">
        <root>
            <menuitem label="Import New Game Data"/>
            <menuitem label="Modify Existing Game"/>
            <menuitem label="Generate Reports"/>
            <menuitem label="Export Data"/>
        </root>
    </mx:XML>
<!-- call notification JJM -->
    <!-- Define a Button control to open the menu -->
    <mx:HBox>
        <mx:Button id="Stats"
            label="Stats"
            click="createAndShow();"/>
            <mx:Button id="PlayBook"
            label="Play Book"
            click="createAndShow();" enabled="false"/>
            <mx:Button id="VideoAnalysis"
            label="Video Analysis"
            click="createAndShow();" enabled="false"/>
            <mx:Button id="Recruiting"
            label="Recruiting"
            click="createAndShow();" enabled="false"/>
    </mx:HBox>
</mx:Canvas>
26  Announcements and General Discussion / Architecture / Air sqlite Proxy question on: March 05, 2008, 01:35:41
Hello.  I am building an air application with puremvc.  I am trying to use the sqlite database on the project as well. I've got a login box that is tied to a userproxy.  In the userproxy I've put the database connection/creation code, in the constructor.  Putting the code in the user proxy seems like a bad place to me because I have other proxies that need to get information from the same database.  What should I do here?  Is there a recommended central place that I  create the database connection and have it available to all proxies for sql inserts, selects etc.  ?  Should I use a bunch of different databases?  Here is a portion of my code in the userproxy.  Is it bad form?

:
public class UserProxy extends Proxy implements IProxy
    {
public static const NAME:String = "UserProxy";
private var _sqlConnection:SQLConnection;
private var _dbFile:File;

public function UserProxy ( data:Object = null )
        {
            super ( NAME, data );
        _sqlConnection = new SQLConnection();
_sqlConnection.addEventListener(SQLEvent.OPEN, openHandler);
_sqlConnection.addEventListener(SQLErrorEvent.ERROR, errorHandler);

_dbFile = File.applicationStorageDirectory.resolvePath("gTT.db");
_sqlConnection.openAsync(_dbFile);

        }

27  Announcements and General Discussion / Architecture / Re: ViewStacks, Mediators and Deferred Instantiation on: March 05, 2008, 10:28:58
Wow!  Thanks for all the info.  I'm trying to digest it, and get this stuff straight.  Probably be back with a few questions.

Thanks again,
Josh
28  Announcements and General Discussion / Architecture / ViewStacks, Mediators and Deferred Instantiation on: March 03, 2008, 10:58:33
When you say

"Generally, I like to expose a variable in the component that contains the ViewStack"

are you saying that I should have a component just for the viewStack, kinda like an empty movieclip in flash that I would load other movieclips into?  Do I even need to use a viewstack?  Should I be using modules for this?

29  Announcements and General Discussion / Architecture / ViewStacks, Mediators and Deferred Instantiation on: March 02, 2008, 04:50:57
Starting to make more sense now.  I'm still not there but I had a flash of thinking I knew what was going on, and that was cool.  I have another question that relates to this.  I've been reading about deferring view instantiation with PureMVC on a few forums.  I've been creating each 'page' of my app as a module and was going to load them when needed.  Am I going to have to do this deferred instaniation stuff?  Is this a good idea considering I'm developing an AIR app?

Thanks in advance.
Josh
30  Announcements and General Discussion / Architecture / ViewStacks, Mediators and Deferred Instantiation on: February 29, 2008, 01:25:16
Thanks for the info.  I'm a little confused, and this stuff is still pretty tough for me.  Do any of the demos work in the manner you are discussing, or do you have any other examples? 
Pages: 1 [2] 3