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 / Re: When to register Mediators of loaded content in a web based Flash project on: November 17, 2008, 07:59:27
Thanks cliff. I'm starting to understand now. I'm going to give this interface approach a shot and see how it goes. I think I'm even starting to see the potential of creating my own framework based on this to suite my needs as many of the projects I do at work end up being setup like this.
3  Announcements and General Discussion / General Discussion / Re: When to register Mediators of loaded content in a web based Flash project on: November 17, 2008, 02:22:34
So upon further investigation, I think I'm onto something. The Modularity demo gave me some insight. Basically it seems to be that I will treat each section as its on Application, giving each section a Multiton key, in other words, a unique id/key. Furthermore, each section will implement an interface. Lets say these are IShell and ISection. Once a section is loaded into the shell, a reference to the shell will be made within each section. Makes sense so far.

My only question now is if I want to send a notification from the shell, will that notification only be heard within the shell? If not, I'm guessing I'll have to expose an API on the sections, defined as part of the ISection interface, to execute anything in a section that should respond to a shell based notification and vice versa.
4  Announcements and General Discussion / General Discussion / Re: When to register Mediators of loaded content in a web based Flash project on: November 13, 2008, 02:35:38
Aww man. I was afraid you'd say multi-core. Guess I have something new to learn then! As for now, I've dropped the use of mediators for the sections and have resorted to my old way of building things with highly coupled code in the sections. Its not all that big a deal as this is not an application in the sense that it needs to be easily modified or extended over time. Its simply a marketing website that will eventually die when the campaign is over.

Its been a great learning experience trying to use PureMVC in an "experience site" and I'm really looking forward to try and implement the framework in another site that may benefit from it more.
5  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]