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: PureMVC for Flex Components ?  (Read 12150 times)
younes
Newbie
*
Posts: 1


View Profile Email
« on: September 14, 2007, 04:22:42 »

Hi,
I'm currently working on Flex components Set for Red5 and, I'd like to know if PureMVC Framework can be used to design a components architecture.
For suggestion/comments don't hesitate :)
Thanks
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #1 on: September 14, 2007, 06:50:07 »

Younes,

PureMVC is intended to adapt components to an ActionScript application. I can't really think of a useful role for it in the definition of the components themselves.

-=Cliff>
Logged
julien
Courseware Beta
Newbie
***
Posts: 5


View Profile WWW Email
« Reply #2 on: September 18, 2007, 02:46:12 »

This is actually a good question.
I had the problem recently where I was refactoring a Cairngorm application (actually just the start of an application) with http services
I wanted to create an auto paginated DataGrid made of a flex component (datagrid+paginator) + a mediator + a remote proxy object.
I wanted this datagrid to be an independent and "self-standing" component, able to be dropped as an xmxl tag into another mxml component or application
Moreover, this grid had to be generic in respect to the data type (value objects) that it was connected to (http request returned generic collections of different Vo classes) (done at the decoder level)
Finally, I wanted to specialize the grid into actual VO collections, so that I have the appropried columns and renderers in a final specialized datagrid component.

Finally,
I did something that may break a little the patterns of PureMVC: the component creates itself its mediator (that is generic), initializes it with himself some specfic parameters, and thats all.
What do you think of this technique ?
Thanks for reading this
Kohinoor
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #3 on: September 18, 2007, 03:48:05 »

Kohinoor

It does diverge from the goal of keeping the view components transportable by keeping them ignorant of PureMVC classes. But whether to take or leave such a goal is entirely up to the implementor.

By building the component in this way, you have simply accepted that A) you're only ever going to use this component with PureMVC, OR B) if you do decide to use it outside of a PureMVC app, you're going to have to modify it to run elsewhere.

The key is being conscious of these decisions when you make them. And, if you're in an enterprise or otherwise writing code someone else will maintain, documenting the fact and why the decision was made to go against the best practice. Maybe it was a time constraint. Too long to figure out the solution that fits with the practice. Maybe there was some other extenuating circumstance. Whatever it was, capture it early so that future generations get a clue why things are the way they are.

-=Cliff>

Logged
Pages: [1]
Print