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 / Objects Specific to View Components API on: November 24, 2008, 05:47:13
So I'm starting to build a little framework built on top of PureMVC multicore and I'm creating a set of base components for it. In particular, I'm creating a component that will serve as a base class for a "module". Not unlike Modules in Flex, these modules will serve as a base to create a "cored" component that can run standalone or when loaded into another Module (SWF).

I'd like my Module component to define a list of required items to be loaded before it can be initialized. Think of it as the Module defining the "holes" that need to be filled, but not defining exactly what asset to load into that hole. The ModuleMediator would then retrieve the list of "holes", and fill them by loading the assets it wishes. The list of "holes" would be, lets say, an Array of objects that extend a base class. Lets call it Asset.

My confusion lies in where to place the objects that define the holes. In other words, where would (non display) objects that are specific to a view component's API be placed in the package structure of an application? My initial thinking is that the view component framework should perhaps be separated from this base MVC framework. Then I thought for a second that maybe the objects specific to the view component should just be placed in a sub package of the blah.blah.view.component package.

Perhaps I'm even going about this all wrong. I'm not sure. So I look to the community! Thanks in advance.
2  Announcements and General Discussion / General Discussion / When to register Mediators of loaded content in a web based Flash project on: November 13, 2008, 11:40:20
Recently I've been trying to use PureMVC for a web based Flash project in which I'm using the Flash IDE. For simplicity's sake, let me abstract the design a bit so that you may get a better idea of the design.

This application has what I call a "shell". In essence, this is the main application. This is where startup occurs and the ApplicationMediator is registered and mediates the root of the main FLA file. This shell is also the SWF file that is embedded into the HTML page.

The shell has a simple navigation that loads "sections" into the shell on demand of the user. Each section extends a base class, lets call it AbstractSection. Each section then also has a Mediator specific to it that needs to be registered at some point. This is where my dilemma resides.

Initially, I was registering the Mediator for a loaded section after is has been loaded in the shell. But then I realized I was importing all the section mediators into my ApplicationMediator, and thus all the code for each section and its mediators was getting compiled into the shell. This is making the shell much bigger than it should be and defeats the purpose of leaving each sections code to be contained within itself.

So I then started to wonder if I should register the Mediator of each section within the document class of each FLA, sort of like what happens with the shell to start up the application. This of course, required a reference to ApplicationFacade within each section and thus compiling the PureMVC framework and anything else I had imported into that class into each section.

I'm no OOP expert, but I'm very comfortable using PureMVC with a self contained Flex or AIR application. But this is really confusing me. I look to all of you for help and suggestions. I hope my explanation is thorough enough, but if it isn't I'll gladly explain more as I'm very anxious to figure out how to properly do this as I really like PureMVC.
Pages: [1]