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]
1  Announcements and General Discussion / General Discussion / Re: MVP and pureMVC differences on: March 18, 2010, 12:35:46
Cliff what about in the case of complex RIAs where the way in which a component is displayed (presented) can vary so much that a presenter is justified?

: Jay Fields
Since views are templates they can also contain behavior. The most common behavior you encounter in a view is formatting; however, since the view is a template you will occasionally see computations or worse. Because this logic is stored in a template it can be problematic to test. Presenters address this problem by pulling all formatting, computation, and any additional behavior into a class that can be easily tested.

This is a common problem for me especially when dealing with view components that are reusable but where their presentation is completely dynamic. Take a view component which has multiple drop downs, but depending on data from the model, certain drop downs need to be presented horizontally or maybe not presented at all.

If PureMVC used Presenters, then that would mean anyone wanting to use your component needs to be using PureMVC.

My original thought was that it seems as if though it would be a great way to add another layer between the Mediator and the components themselves, thus making the components dumber, i.e. more reusable.

However my colleague argues that this is less cohesive and that you are indeed right in the sense that if the view components relied on a presenter to be displayed properly, then without their presenter they are not as powerful and less portable to other applications.

How would one go about solving this problem in the PureMVC world? I was even dreaming of a LayoutMediator utility that would extend the Mediator and allow for multiple layouts of its view component. It could have a default layout when registered and the ability to specify different layouts for different instances.
2  PureMVC Manifold / Standard Version / Re: Custom interfaces and inheritance in PureMVC on: January 08, 2010, 10:53:02
Perfect. Thank you for clearing this up - it all makes perfect sense. And yeah Cliff thats what I will be doing exactly so thanks for the concrete example!
3  PureMVC Manifold / Standard Version / Custom interfaces and inheritance in PureMVC on: January 08, 2010, 02:03:10
My scenario is the following:

I am extending Mediator with PageMediator.
I am implementing PageMediator with IPageMediator.
IPageMediator extends IMediator.

I dont understand 2 things:

1. If I add a public method to IPageMediator which is not implemented in PageMediator, the compiler warns me, however, if I include a public method to PageMediator which is not declared in IPageMediator, there are no warnings at all.

2. All concrete classes that extend PageMediator and that implement IPageMediator do not seem to need to contain any of the methods that are declared on IPageMediator and I can add as many public methods as I want even if they arent declared in IPageMediator.

Are these questions coming from a lack of understanding of interfaces and inheritance or is PureMVC structured in a way that would cause this behavior?

Thank you!
4  PureMVC Manifold / Standard Version / Re: Startup Manager on: August 26, 2009, 01:18:40
Edit: of course its mysterious because I was not registering the proper commands on the ApplicationFacade. Thats why nothing was happening. Thank you for your time!
5  PureMVC Manifold / Standard Version / Startup Manager on: August 25, 2009, 04:09:44
Hi, quick question about startup manager. How come when I specify that a startup proxy resource requires the previously registered startup proxy resource, it simply wont load. Instead of waiting for the one it requires to load, then loading, it simply wont load. If I do not specify the requires variable for any of my proxies, then they all load fine and their notifications are sent perfectly.

Appreciate the help because this is maddening.
6  Announcements and General Discussion / Architecture / Re: Mediators and Components Help to Understand on: August 25, 2009, 11:08:01
Ok. So after sleeping on it and dreaming in puremvc, (the view was the most prominent class), I have come to the following conclusion:

Something such as a CustomTextField class should not have a mediator associated with it. I should apply the stylesheet to it on it's parent class, or pass it in to the CustomTextField class as an argument.

Mediators are only when a view component needs to communicate with the rest of the application in which case a Mediator should mediate those needs with the rest of the application via notifications. Otherwise a regular component class should suffice.

Any confirmation/clarification would be great.
7  Announcements and General Discussion / Architecture / Mediators and Components Help to Understand on: August 24, 2009, 03:33:49
Hi. I am very new to puremvc and trying to establish the architecture for an online questionnaire done in flash.

AS in previous iterations I have extended the TextField class to make a CustomTextFieldClass with some predefined properties such as textField.stylesheet = [global class].styles.css; I would then pass in the textField content as a string in the constructor.

In my puremvc version, I feel this would best be done with a TextFieldMediator, which has access to the proxies which contain the text I need (from the xml), the stylesheets, etc.

My questions are as follows:

1. Considering that I need access to those proxies, the best way to do this is to have a mediator for that component right?

2. I will for sure need to have multiple instances of this component within whatever parent viewComponent, so I think its silly to have a mediator for each view component and have to register each one. How does one go about adding multiple instances of a view component that are all children of the same mediator?

I was unable to understand how this should work by reading the best practices PDF so any help is greatly appreciated!

Ted

8  PureMVC Manifold / Standard Version / Re: Beginner's Questions on: July 28, 2009, 11:12:35
Thanks so much! This is very helpful, I guess thats the point of the proxy not only to load external data but just for any data storage at all....

9  PureMVC Manifold / Standard Version / Beginner's Questions on: July 27, 2009, 01:06:55
Hi, I am new to the forums and new to PureMVC : ) I am fairly familiar with design patterns and try to implement them whenever possible, especially MVC in the vast majority of my projects, but I am trying to get a grasp on PureMVC and I think I understand some of the core concepts but there are still things I am stuck on so I hope this is the right place for me to request some knowledge...

In regards to Notifications I have one question: the getBody() method pulls the body parameter. Is that parameter pretty much just a placeholder to be able to pass any argument you want through a notification? In the examples I see, for Mediators, it is usually used to pass the stage object through. Should I designate this argument for something in particular in most cases?

My second question is about the facade... In the PureMVC world, how would one go about setting/getting a 'global' variable? Before I was using a singleton class I found that stores and instantiates global objects but I feel like with the facade, this should no longer be necessary... any tips for accomplishing this the right way?

Thanks lots for any help or feedback, direction etc you can provide :D
Pages: [1]