The reason for DynamicFactory was because I was really using the Module simply 
to load some classes at runtime and not to load and display the Module in the 
typical fashion. That is, I would load a Module that contained multiple classes 
and through DynamicFactory's API create from that Module the class I really 
wanted. I tried using ModuleBase and RSLs but had some issues with missing 
dependences at runtime. Anyways....

I would agree that <mx:Module implements="MyModuleInterface" > should work 
well, I have also seen people have their modules simply dispatch events that 
the main app knows to listen for. As far as optimizing goes if you are not 
overly concerned with size and memory usage not optimizing makes your modules 
more flexible. That is they will work in any app because they contain all the 
dependencies that they need.

One thing to keep in mind with Modules and RSLs is that once a class is loaded 
into the App the app will always use that first version.

Example:
Module1 has dependency of MyDependency
Module2 had a dependency with the same name "MyDependency" but MyDependency has 
been changed since Module1 was published.

Now at runtime you load Module1 later you load up Module2 with or without 
unloading Module1. Module2's dependency MyDependency or at least a class with 
the same name is already loaded so the player will ignore it. If Module2 
depends on one of the new things in MyDependency you will encounter runtime 
errors.

If I am wrong please correct me.

--- In flexcoders@yahoogroups.com, Alex Harui <aha...@...> wrote:
>
> Interesting. I skimmed the link provided.  The ModuleManager already returns 
> an IModuleInfo that contains a factory so I don't quite get any need for a 
> DynamicFactory class.
> 
> You should be able to create a project and switch it to use <mx:Module 
> implements="MyModuleInterface" > instead of <mx:Application>.  The project 
> will need access to the MyModuleInterface source or swc.  As long as teach 
> time has that set up, they can independently develop modules.
> 
> Then as long as you use ModuleManager to load that module everything should 
> work just fine.  The only real question is whether you should optimize out 
> classes or not.  It will depend on your desire to re-use these modules in 
> different apps.
> 
> However, I would encourage you to briefly read the doc on the Marshall Plan 
> as you may want to use sub-apps instead of Modules if you are going to have 
> these things developed on different versions of the SDK some day.
> 
> 
> On 2/17/10 8:59 AM, "gtb104" <gtb...@...> wrote:
> 
> 
> 
> 
> 
> 
> Thanks for the link Robert.
> 
> I guess that I'm slightly frustrated because what I want doesn't seem to be 
> unreasonable, and is what I expect modules to provide.  I just want 2 teams 
> of developers to be able to create code that can be put together, at runtime, 
> that communicate with a set interface.  These two sets of code should have no 
> knowledge of each other.  I guess it would be like adding someones SWC to 
> your code path to get the functionality, without actually adding it to your 
> code path so that your SWF bloats.
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , 
> "ag_rcuren" <robert.vancuren.jr@> wrote:
> >
> > This sounds very similar to a project I worked on. Here is post I made  a 
> > while back that might help you.
> >
> > http://flexinonroids.wordpress.com/2009/05/27/flex-3-dynamically-loading-components-at-runtime/
> >
> > The app I ended up creating knows how to load modules (that are not 
> > optimized to ensure they contain everything they need) that implement an 
> > common interface so the app knows how to use them. When the app runs it 
> > pulls of list of all the available modules from a database and then can 
> > load and use them.
> >
> > --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> , 
> > "gtb104" <gtb104@> wrote:
> > >
> > > Reading the Flex Docs gave me the impression that you can create modules 
> > > that have no direct dependencies to the main app, but I can't figure it 
> > > out.
> > >
> > > Basically, I want a team of developer somewhere else to create a module 
> > > that's coded to an interface.  I then want to load that module, 
> > > potentially from their server, and cast it to the interface that's 
> > > defined on my system, and use the interface methods.
> > >
> > > I'm not having luck though.  Most examples show the main/interface/module 
> > > all physically located in the same package.  I need them to be in 
> > > different projects... projects that have NO dependency with each other.
> > >
> > > I've tried finding info on the web as well, but no luck.  Does anyone 
> > > know of a resource, with code example?
> > >
> > > Thank you in advance!
> > >
> > > One last question. The module that the other team is creating, does that 
> > > have to be created in a flex project, or can you make it in a flex 
> > > library?
> > >
> >
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>


Reply via email to