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: AppSkeleton + CafeTownsend  (Read 5243 times)
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« on: February 26, 2008, 07:45:35 »

I"m trying to adapt CafeTownsend login sample into a generic shell (based on Daniele Ugoletti's AppSkeleton)

My app preloads and loads correctly, jumps from a SplashScreen and stops on a MainScreen that now contains a memberLogin view (eq to CafeTownsend  EmployeeLogin view)

Unfortunately, when I fill in form and press login button, APP_LOGIN event  is never catched by the corresponding mediator.

As mixing structures is complex to figure out, that's pretty hard for me to determine where my bug may come from so I'm stalled.

Considering theses two samples, does an expert can see a trap in mixing them ?

(for example, as MainScreen level does not exist in CT, should  MemberLoginMediator be registered into MainScreenMediator rather than in ApplicationMediator ?!)


Thx





« Last Edit: February 26, 2008, 07:53:02 by kouri » Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #1 on: March 01, 2008, 09:09:05 »

As I got no answer to my question, let's try a new approach...

AppSkeleton seems to be an interesting start but does not considers multi app architecture like Arch101 does : unit3-lab3 manages 2 apps (admin management and user login) with a common model

Maybe  I better start from Arch101 and try to integrate AppSkeleton functionnalities as a third app ? Adding a view and a controller but integrating model

Would appreciate any recommendations  ;)
« Last Edit: March 01, 2008, 09:12:21 by kouri » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 on: March 01, 2008, 11:57:36 »

Hi Kouri,

Yes, I think that starting with the admin 101 approach and adding the resource loading functionality might be best.

Regarding the AppSkeleton, it is a great app that early on tackled the problem of loading async resources before letting the user access the view. That demo inspired (search these forums) several other folks to evolve the resource loader into an actual plug in utility that even supports resource load-order dependencies, timout-retry, progress notifications, and fault handling. Its sweet, and it's coming in 2.0!

-=Cliff>
Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #3 on: March 04, 2008, 12:26:12 »

Cliff,

I set up this multi app structure: starting from Arch101 sample (admin+user apps) I added a preload app (from AppSkeleton) then changed admin.mxml and user.mxml into Canvas.  But starting from preload I still can't properly chain all these parts:I always get an err 1009 as soon as I add to main viewstack, a view from another app.

Considering only Arch101(to be simpler) how would you link admin app to user app (i.e get into admin panels after being logged instead of getting  into MainMenu panel that is not an app but just a  view of user app..) ?

Thx for your help.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: March 04, 2008, 01:42:32 »

The idea in the courseware was really that the user app and the admin app are two totally different apps.

The login is part of the user app that would have the use cases the user can execute (based on their role). The admin app isn't meant to be accessable after login in the user app but by going to another url altogether.

Again that was merely contrived to show the reuse of the model by two applications.

There are a couple of ways this could be extended. The user app could present your menu and if you have the accounting role, you'd be able to get to the admin app, say. The selection on the menu would simply send the browser to the page with the admin app. That's the simplest thing.

If you wanted to actually load the admin app into the user app as a Flex Module, that isn't something you want to try with the standard version of PureMVC. There has been a lot of thought put into various ways of doing Modules with PureMVC, and they all involve a lot of hoop-jumping.

There is, however, an answer to this problem waiting in the wings. Very soon, coinciding with the 2.0 release you will have an answer.

-=Cliff>
Logged
kouri
Courseware Beta
Full Member
***
Posts: 28


View Profile Email
« Reply #5 on: March 04, 2008, 02:19:32 »

Thx Cliff !
Waiting for your V2 ice cream, I'll have a look to spicy modules recipes.  ;)
Logged
philipSe
Sr. Member
****
Posts: 139


View Profile Email
« Reply #6 on: March 05, 2008, 03:09:41 »

Kouri, I don't know if this is relevant and you may already know this anyway.

Be aware that with viewstacks you can't just register mediators any old time - the view component must first have been created (creationComplete) - otherwise the reference to the view component is null and this will affect the instantiation of the mediator.  See other postings in these forums regarding deferred instantiation and registering mediators etc.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #7 on: March 05, 2008, 06:48:33 »

Thanks for mentioning this Philip. In fact when 2.0 is released, you'll find the best practices document updated with a full mediator example which handles deferred instaniation of ViewStack children and their Mediators.

-=Cliff>
Logged
Pages: [1]
Print