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]
16  Announcements and General Discussion / Getting Started / Re: Big Picture Question about Views on: September 29, 2009, 03:58:26
Jason is referring to Flex List Control.

As you may know, Flex comes with variety of components:
Controls: Button, Label, LinkButton, List, Tree...
Layout: Canvas, Tile, VBox...
Navigators: LinkBar, TabNavigator...

Mariush T.
http://mariusht.com/blog/
17  Announcements and General Discussion / Architecture / Re: FInal State Machine..need feedback on FSM definition for videoplayer on: September 07, 2009, 06:33:19
I dont think you are on the right track.

You send StateMachine.ACTION notification from application(command or mediator) to StateMachine which triggers a transition. No need to register commands with StateMachine.ACTION notification. You should add 'changed' property to each state.

<fsm initial={Main.STATE_READY}>
            <state name={Main.STATE_READY}  changed={Main.READY}>
                <transition action={Main.ACTION_START} target={Main.STATE_PLAYING}/>
            </state>
            <state name={Main.STATE_PLAYING} changed={Main.PLAY}>
                <transition action={Main.ACTION_PAUSE} target={Main.STATE_PAUSED}/>
                <transition action={Main.ACTION_STOP}  target={Main.STATE_STOPPED}/>
            </state>
            <state name={Main.STATE_PAUSED} changed={Main.PAUSE}>
                <transition action={Main.ACTION_RESUME} target={Main.STATE_PLAYING}/>
            </state>
            <state name={Main.STATE_STOPPED} changed={Main.STOP}>
                <transition action={Main.ACTION_RESET} target={Main.STATE_READY}/>
            </state>
         </fsm>;

Now your StateMachine sends notification(READY, PLAY, PAUSE, STOP) every time state is changed. If you need, you can register commands with these notifications or simply make mediator(s) to listen for them.

override protected function initializeController () : void
      {
         super.initializeController();
         registerCommand( STARTUP,       StartupCommand );   
registerCommand( Main.READY,       ReadyCommand );
registerCommand( Main.PLAY,       PlayCommand );
registerCommand(  Main.STOP,       StopCommand );
registerCommand(  Main.PAUSE,       PauseCommand );
}

Look at the SOAMusicPlayer source code http://seaofarrows.com/srcview/

Mariush T.
http://mariusht.com/blog
18  Announcements and General Discussion / Architecture / Shared proxy in modular application? on: August 05, 2009, 10:34:18
Hi,
I am trying to create an application where main view shows users(in a list component) and cars for each user(in datagrid component).

Application has 7 modules:
MainDisplayModule - module with list, datagrid component and buttons 'Add User', 'Remove User', 'Edit User', 'Add Car', 'Remove Car', 'Edit Car'

UserCreatorModule - module with UserCreator(popup window) component - FirstName, Age textInputs, OK and Cancel button
UserEditorModule - module with UserEditor(popup window) component - FirstName, Age textInputs, OK and Cancel button
UserRemoverModule - module UserRemover(popup window) component - FirstName label, OK and Cancel button

CarCreatorModule - module with CarCreator(popup window) component - Make, Model, Year textInputs, OK and Cancel button
CarEditorModule - module with CarEditor(popup window) component - Make, Model, Year textInputs, OK and Cancel button
CarRemoverModule - module CarRemover(popup window) component - Make, Model, Year label, Ok and Cancel button

Having separate modules for popups gives me States and Substates in this application :).
Modules are connected with Pipes and each core(module) has its own StateMachine.

I have CarsProxy with methods addCar(car:CarVO), removeCar(car:carVO), getCars(), cars() and UsersProxy with methods addUser(user:UserVO), removeUser(user:UserVO), getUsers(), users().

Proxies add, remove and retrieve records from/to MySQL server.

Should I place CarsProxy, UsersProxy in a common library?

I dont know but i was thinking about creating another module(ServiceModule) and connecting it with modules. Modules could send and receive messages from/to ServiceModule. Is it a good practice?
Do you have a different approach?

I use Flex/Multicore, StateMachine, Pipes Utility.

Mariush T.
http://mariusht.com/blog/
19  Announcements and General Discussion / Architecture / Application needs architecture on: July 22, 2009, 09:38:14
I have problem with architecture of LiteFtpClient application(Flex/Multicore PureMVC, Pipes, StateMachine). You can see mockup below.

Initial window


Ftp address, username, password were entered. Application is in a process of connecting to the server(logging, getting directories), popup window is visible.


User can browse through files and folders in CONNECTED mode.


'New Folder' was clicked, popup window is visible


User is able to rename files, 'Rename' button was clicked


'OK' button was clicked in 'Delete File/Folder' popup window. 'delete item' request was sent to the server, application is waiting for response from the server. Popup window is still visible, 'OK' button is disabled.


I got following questions:

-should i create modules and StateMachines for each popup window? Maybe i am wrong, but i think it would be good to have FSMs(similar to that one below) for each popup window, application then can have States and SubStates.


-If i have modules for popups, when i should load them? Should i load modules one by one after user is successfully connected or maybe when for example, 'New Folder' button was clicked and popup window is about to be created.

- Do you add any view components into shell application? Should shell application only be responsible for loading, unloading, connecting and disconnecting modules?

-What are steps in your application development? Do you start with designing User Interfaces, Use Cases, States, etc?
I started with User Interfaces(screenshots) then i worked on States. Later i created SubStates, now i need modules since i have SubStates.

-How should i name modules, popup windows? DeletingModules or DeleteModule, FolderDeletingWindow...?

-How do you know how many modules you need? Is there any rule?
It looks like i need modules for states with substates.

+--DISCONNECTED
+--DISCONNECTING
+--CONNECTING
+--GETTING_DIRECTORIES
+--CONNECTED
   +--CREATING
   +--DELETING
      +--INITIALIZATION
      +--DELETING
      +--CLOSING
      +--FAILING
   +--RENAMING
   +--UPLOADING


Am i wrong?

I think i should have MainModule, BrowsingModule, DeletingModule and couple more for each popup windows.

MainModule, Main FSM Diagram, user is 'DISCONNECTED'.


BrowsingModule, Below FSM diagram can only happened when user(application) is in CONNECTED state.


DeletingModule, FSM Diagram for 'Delete' popup window


-Do you know any links to real world applications with source codes, any tutorials on how to architect this type applications?

I would like to to here your thoughts.

NOTE!!! Above application is for my practice purpose only(not for a client) and I will be happy to share source code with the community at the end.

Mariush T.
http://mariusht.com/blog/
20  Announcements and General Discussion / General Discussion / Re: Can Proxy send StateMachine.ACTION Notification? on: July 13, 2009, 09:56:32
I completely forgot about possibility of having multiple apps using the same model. Now i understand why NOT to send a StateMachine.ACTION from a Proxy.

Cliff, Great explanation, Thanks a lot!

Mariush T.
http://mariusht.com/blog/
21  Announcements and General Discussion / General Discussion / Can Proxy send StateMachine.ACTION Notification? on: July 13, 2009, 01:22:53
Hi,

Can Proxy send StateMachine.ACTION notification that triggers the StateMachine to begin a transition between States? If yes, do you have any real world scenarios when this happens. I know from your presentation http://puremvc.tv/#P003/ that Command or Mediator can send StateMachine.ACTION Notification, but i am not sure about Proxy.

Mariush T.
http://mariusht.com/blog/


22  Announcements and General Discussion / Public Demos, Tools and Applications / Module to Module communication (Flex/Multicore PureMVC/Pipes) on: July 08, 2009, 02:52:55
I just made a very simple demo where modules can talk to each other even if they are NOT connected to Shell/Application. Modules are loaded dynamically and connected with pipes (Module->Pipe->Module).

It's a perfect demo for beginners.
http://mariusht.com/blog/2009/07/08/module-to-module-communication/

Mariush T.
http://mariusht.com/blog/
23  PureMVC Manifold / MultiCore Version / Re: Flex with two swf modules demo need? on: July 08, 2009, 01:23:38
Hi All,

I made a simple demo(two modules loaded at runtime talk to each other). I want to point out that modules are not connected to shell. Messages are sent directly through pipes Module-Pipe-Module.

http://mariusht.com/blog/2009/07/08/module-to-module-communication/

Mariush T.
http://mariusht.com/blog/

24  Announcements and General Discussion / Architecture / Converting Array into XML in Proxy or in Command? on: June 03, 2009, 04:28:58
Hi,
I am retrieving an array of objects(categories and subcategories) from MySQL database.
I want to convert this array into hierarchical xml data(please see demo).
 
http://mariusht.com/blog/2009/04/30/converting-array-of-objects-into-hierarchical-xml-data/
http://mariusht.com/files/blog/array_into_xml/demo/ArrayIntoXml.html

Can you tell me where i should put logic for above conversation? Should i do it in Proxy or maybe in Command?

Thank You,
Mariush T.
25  Announcements and General Discussion / Getting Started / Re: PureMVC actors and their responsibilities on: May 28, 2009, 03:05:43
Thanks for your help!!!

I just added new post to my blog
http://mariusht.com/blog/2009/05/28/puremvc-actors-and-their-responsibilities/
(short description of each responsibility with sample code)
26  Announcements and General Discussion / Getting Started / PureMVC actors and their responsibilities on: May 23, 2009, 07:34:58
Hi,
I have been studying PureMVC for a couple days now and I think i got good understanding about the framework.
I made a simplified diagram of core actors: facade, mediator, command, proxy and their responsibilities.
I want to put below picture on my blog http://mariusht.com/blog/ but i am not sure if i got this right.

Do you think i should add anything or maybe remove something from my list?


Any help is appreciated.  Thanks.

Mariush T.
Pages: 1 [2]