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: Build an excel like application  (Read 11868 times)
koirsm
Newbie
*
Posts: 5


View Profile Email
« on: August 27, 2009, 02:11:24 »

Hi, this is my first post here.
I'm playng with puremvc a bit and I want build an application Excel like in AS3.
User create a selection on an "fluid" grid (24x24) with scrollbars: every time the user draw a selection, the system prompt (or not) a configuration window for cutomize with colors the selected cells.
I don't want draggable rows and columns (for set rows and columns width) but I have to build a shits navigation system.

Some questions:

1) standard puremvc or multicore?
2) some advice on how to implement it?  ;D
Logged
koirsm
Newbie
*
Posts: 5


View Profile Email
« Reply #1 on: August 27, 2009, 05:12:03 »

Ok, I'm traying some approach by myself

Starting from this great example http://hubflanger.com/building-a-flash-site-using-puremvc/ I reuse the facade, controller and first view creation.
Now I want manage the fluid behavior of GUI, so the grid and other Component can be adaptable to the user monitor.
I create 1 mediator for every component that also implement a simple interface with a method that get a component istance and return the avaible space for that component according to Stage dimension.
The mediators send to views the coord and the view do the redraw.
I use a proxy class to store dimension and position of Components and register Component's Mediators to listen for Proxy internal VO changes.

Everytime the stage is resized:
- Proxy notify to facade that data is changed
- Components Mediators is listening for that changes
- Mediators tell to views how they have to behave

Am I totally wrong?


 
« Last Edit: August 27, 2009, 08:37:08 by koirsm » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: August 27, 2009, 11:48:22 »

What responsibilities does IPositionManager add to the mediators?

-=Cliff>
Logged
koirsm
Newbie
*
Posts: 5


View Profile Email
« Reply #3 on: August 27, 2009, 12:34:34 »

I want use BoundManager (sorry for the wrong Interface's name) to get final width and height of a Component (view) for redraw process.
The Mediator initialize a BoundManager passing the Component, and the BoundManager return width and height to Mediator as Object.
Mediator send Obj to view.

Txs.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: August 28, 2009, 10:44:20 »

Can the mediator not inspect the width and height of its own view component?

-=Cliff>
Logged
koirsm
Newbie
*
Posts: 5


View Profile Email
« Reply #5 on: August 28, 2009, 11:57:32 »

Mmmm...yes of course.
I can:

- register a proxy (guiProxy) at startup and create an object to store component's id, width, height, isResizable, ecc..
- keep the component mediator clean and register only a notification about guiProxy changes
- move the redraw logic in the view by implementing interafce

Now, if I'm not wrong:

- user --> stage resize
- facade listen stage resize
- facade dispatch event for proxy
- proxy listen the event and change guiProxy data
- mediator listen for proxy changes and notify to view
- view call an Interface method to get final position/dimension
- view redraw

is it correct?

Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #6 on: August 31, 2009, 06:23:15 »

Why does a Proxy need to become involved in keeping View-related information such as component id, width, height, etc? The component keeps its own info. Unless the Domain Model being persisted is coordinates and component details, the Proxies should never have to traffic in View details.

-=Cliff>
Logged
koirsm
Newbie
*
Posts: 5


View Profile Email
« Reply #7 on: August 31, 2009, 06:41:50 »

Ok, so I've to keep the logic of resize inside views and only register mediator for listen to resize notifications.
Right?
I've found a post in general forum about this...
I'm sorry for wasting your time..
Txs.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #8 on: August 31, 2009, 07:20:00 »

Yes, best to encapsulate as much of the view component's behavior as possible.

Not a problem with the questions. It takes a while for everything to find it's place in your mental picture of an app based on PureMVC (or any framework for that matter). When it all clicks, you can move like lightning, though, because you're not stopping every 5 minutes wondering 'now where does this thing go?'.

-=Cliff>
Logged
Pages: [1]
Print