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 / Getting Started / Handling non-pureMVC-ized subcomponents on: June 11, 2008, 04:49:48
I have an MXML view component implementing a menu where 'upstream functions' like startup and dataprovider population are standard pureMVC operations. The buttons used by this menu are created by a reasonably complex 3rd party .as class that knows nothing of pureMVC. My menu (the pureMVC view component) is correctly injecting the dataProvider and another property required by the button class (labelField) when it declares the button object:

:
<mx:Canvas id="contentCanvas" top="10" width="200">
<nav:UFMButtonList id="nav" y="200"
width="200" maxHeight="800"
labelField="@ModuleName" visible="true"
showEffect="{myWD}" hideEffect="{myWU}"
filters="{dsFilterArray}"
openDuration="500"
/>
</mx:Canvas>


So far, so good. Now I need to modify the button component so that click  events (but only _some click events) are bubbled up to the menu component or even the the menu's mediator without incurring the complexity of making the button component a full-fledged pureMVC-ized class. I want to change just enough button code so that, at a given condition internal to the button object, the click event is passed back to the menu component or perhaps, the menu's mediator.

In other words, add a property to the button's declaration that tells the button's internal click hander where to send events that meet my conditions. To my eye, this is the same pattern as sending a 'responder' argument from a proxy to the constructor of a delegate letting the delegate know who gets the results of an asynch operation.

thoughts?

thx
--steve...
2  Announcements and General Discussion / Getting Started / Injecting data to a viewComponent on: May 31, 2008, 05:33:53
I have the connections in place that correctly;
  • loads xml data to the proxy;
    connects mediator to proxy
    connects viewComponent to mediator

Now I'm trying to get the mediator to pass the proxy's data to the viewComponent:
this.mainMenu.loadXML(this.menuProxy.getMenuData() as XMLList);

The above statement executes from the mediator after the viewComponent fire's it's CreationComplete event. Using breakpoints, everything is happening in correct order - the data in the proxy exists correctly when the getMenuData() method is called:
   public function getMenuData( ):*
   {
      return data;
   }

But the parameter passed to the viewComponent's method is coming up NULL.
   public function loadXML(  value:XMLList ):void
   {
      nav.dataProvider="{_navXML}";
   }

So the question boils down to, is this not a legit way to pass data down to a view component?
this.mainMenu.loadXML(this.menuProxy.getMenuData() as XMLList);

Thinking it might be a conversion of type issue, I've also tried:

(proxy)
public function getMenuData( ):*
{
   return data as XMLList;
}   

(mediator)
this.mainMenu.loadXML(this.menuProxy.getMenuData());

Data looks ok all the way to the final step where it's passed into the viewComponent.

thx
--steve...
3  Announcements and General Discussion / General Discussion / Logging Needs on: May 29, 2008, 11:26:50
Occasionally there have been messages posted about this or that strategy for getting better logging information out of PureMVC but I haven't seen code or samples that clearly demonstrates anything. There are a number of open source logging apps out there, including LogBook that might provide an advanced starting point for getting more robust logging capabilities.

It might be worthwhile putting out some feelers in some of those other logging-oriented forums looking for someone already adapt at logging to see what capabilities can be brought to a PureMVC framework.

IMHO, logging is very nearly as important as Startup / Preloading utilities.

thx
--steve...
4  Announcements and General Discussion / Getting Started / Any samples of dynamic notification handling? on: April 06, 2008, 04:48:45
The HelloFlash demo shows a dynamic mediator being registered. Is there anything listing how to handle a dynamically named body property being passed to a notification handler?

A proxy constructor that looks like
:
public function AssetProxy( swf2Load:String ):void {
//rename name vars
NAME = swf2Load + "Proxy";
SRNAME = swf2Load + "SRProxy";

this.swf2Load = swf2Load;

super( NAME );
this.load();
}

Would like to send the value of 'swf2Load' as the body payload of a sendNotification.

thx
--steve...
5  Announcements and General Discussion / Architecture / Where to put ItemRenderers? on: March 31, 2008, 03:19:43
Just finished reading Peter Ent's itemRenderers: Part 4: States and Transitions (http://weblogs.macromedia.com/pent/) outlining a really clear way to handle a lot of what my menus' buttons have to deal with - state and showing or hiding other elements depending on that state.

But the renderer as presented in that specific demo seems impossible to implement in Purely MVC fashion. Is it a matter of breaking the different code elements to respective roles? As presented it's soooo nice and tidy.

Do we have itemRenderers exhibited in any demos?

thx
--steve...
6  Announcements and General Discussion / Getting Started / ApplicationFacade and the debugger on: March 23, 2008, 06:09:37
While playing with the AppSkeleton I've set a breakpoint on SplashScreenMediator's handleNotification so as to watch the incoming notifications. I've created watch expressions on 'note' and on 'ApplicationFacade.LOADING_STEP'. Neither object will display a value in the 'Expressions' panel. In fact, ApplicationFacade.LOADING_STEP goes so far as to say No such variable: 'ApplicationFacade' .

Sure seems like i should be able to inspect the ApplicationFacade - much less see the value of one of it's constants. How am I looking at this wrong?

thx
--steve...
7  PureMVC Manifold / MultiCore Version / Status of Multi vs Single core demos and utils on: March 17, 2008, 07:49:46
Looking for a quick overview of where things stand with the multi-core version.

How do we go about using the startupmanager utility. Is a port to the multi-core package required / already underway?

The version of the Best Practices  & overview docs aren't yet referencing the Multiton...will these documents update or will an independent paper be published?

And a quick question about appropriate usage of Multiton verion...

Effectively all the development I'm involved with will make use of nested and or sibling-level PureMVC objects - e.g. a top-level menu (based on PureMVC) can cause change of view stack to bring up a slideshow also based on PureMVC. My life is easier by just focusing on the Multi-Core version, right? Or are there other considerations to take into account? From the client-side point of view, what's the functional difference?

thx
--steve...
8  Announcements and General Discussion / General Discussion / How will PureMVC ported C# effect backend-only developers? on: February 25, 2008, 08:30:02
WebORB from http://www.themidnightcoders.com/ is releasing a new version for .NET this week that includes PureMVC generation for .NET projects. That means some degree of code gen for Server-side to Flex stuff...it'll be interesting to see exactly how that works.

My question here is wondering what PureMVC for C# is going to look for those of use not producing browser pages. Is the definition of 'View' going to be broad enough to include SOAP or WDSL output?

thx
--steve...
9  Announcements and General Discussion / Getting Started / Where'd my argument go? on: February 24, 2008, 06:26:37
Very likely, this issue isn't caused by the framework itself but it strikes me as quite strange and Flexcoders hasn't pickup on it.

I've refactored the sample Book App that David Deraedt has posted at: http://www.dehats.com/drupal/?q=node/26. My version sits at http://67.99.17.218/weborb30/CampusWO/Campus4.html?debug=true

The problem is the detail view is never passed a populated current slide - something that should happen at the 'change' event of the datagrid:

       <mx:DataGrid
               selectedItem="{selectedSlide}"
               change="selectSlide(event.target.selectedItem as Slide)"
               dataProvider="{slides}" >

Placing a breakpoint on the change property and observing the
event.target.selectedItem value shows the event is carrying the
expected info. But when execution reaches the handler:

       public var selectedSlide:Slide;
       private function selectSlide(pSlide:Slide):void
       {
               selectedSlide = pSlide ;  // pSlide is now null.
               dispatchEvent(new Event(SELECT, true));
       }

the param is null. If I remove the explicit cast to 'Slide' when calling the handler and change the signature to 'Object' ... again null.

Changing event.target.selectedItem as Slide to event.target.selectedItem.myIdentity   & the handler's signature to accept a Number _will pass the expected value.

Why no compile _or runtime error? I find that if I intentionally misspell the dataField property of one of the DG's columns, that column comes up blank but others render as expected and, again, no error reported.

Is it possible the framework is somehow masking something that prevents an error condition from bubbling high enough?

What could cause the value of 'selectedItem' to show as valid at the point that the event Handler is called but 'null' when that function is hit?

thx

10  Announcements and General Discussion / Getting Started / The Role of Enums on: September 09, 2007, 12:30:23
In attempting to adapt the Arch101 sample I come to the usage of enums in the model. I think I understand them to function as an entity used to enforce type checking.

Yes?

The 2 sample enum structures provided are both used to populate a dropdown in view components. The statement that creates the constants on which the enums are based will hardcode the items into the class.

public static const ADMIN:RoleEnum 
    = new RoleEnum( 'Administrator', 0);
public static const ACCT_PAY:RoleEnum
    = new RoleEnum( 'Accounts Payable', 1);
& so on.


But what if the contents of the list is itself, db-driven and not known at compile time.

Can those static constants be generated at runtime?

thx
11  Announcements and General Discussion / Getting Started / Does Extends == Inheritance && Implements == Composition? on: August 20, 2007, 05:57:12

In the context of making sure I'm getting my head around the fundamentals correctly....

When I read this statement from LiveDocs EventDistpatcher
(http://livedocs.adobe.com/flex/201/langref/index.html):

In general, the easiest way for a user-defined class to gain event
dispatching capabilities is to extend EventDispatcher. If this is
impossible (that is, if the class is already extending another class),
you can instead implement the IEventDispatcher interface, create an
EventDispatcher member, and write simple hooks to route calls into the
aggregated EventDispatcher.


my understanding of Inheritance and Composition leads me to think this is also a true statement:

In general, the easiest way for a user-defined class to gain event
dispatching capabilities is to use inheritance. If this is impossible
(that is, if the class is already extending another class), or you
employ the logic in Advanced AS3 Design Patterns you can favor
composition over Inheritance and save yourself the opportunity to
extend some other case in the process.


thx
--steve...
12  Announcements and General Discussion / Getting Started / Implementing a logging system on: July 23, 2007, 06:57:51

I've had the chance to play around with Arch101 and danieleUg's ApplicationSkeleton enough to grasp the generalities. To my mind, the route to the next level is adding a layer of 'something' to see how stuff changes.

I think it would be useful to add a logging layer to provide a better visual sense of the circuitry involved. What's the route taken - how is the map drawn.

In the AS<3 days I'd just toss trace statements in at various points and watch the order of execution. That approach seems a) not feasible in as3; b) non-pure. Logging has changed at a fundamental level.

So my question at the point is, in a real world - production app, - given one of our existing demo apps - how would a team implement a logging system that helps bring junior members up to speed? How can logging be implemented in a centralized, generalized fashion?

thx
--steve...
13  Announcements and General Discussion / Getting Started / Working with CodePeek on: July 15, 2007, 10:23:21
When I load CodePeek into FB2 I get:

2   Could not resolve <mx:WindowedApplication> to a component implementation.   CodePeek.mxml   CodePeek   line 11   July 14, 2007 7:45:07 PM   4

Could be due to my newness to Flex Builder itself. After extracting the folder (to default My Docs\Flex Builder 2) I have to Create New Flex Project named 'Code Peek', right? Any other steps and/or preference settings required?

thx
--steve...
14  Announcements and General Discussion / Getting Started / Best Practices on: July 09, 2007, 04:10:51
Greets....just got here and have spent the time needed to catch up on the blog & what not. Given your penchant to literary illustration I spent a couple more minutes wondering if there might be some Zen-esque intent that presents 404s for the .swf and .zip and a blank page for the doc.

If so, I'm prepared to despair of all hope of ever getting my head around MVC.
Pages: [1]