PureMVC
Home
About
Code
Docs
FAQ
Forums
News
Showcase
Contact
Jobs
Welcome,
Guest
. Please
login
or
register
.
September 02, 2010, 07:48:39 AM
News:
ATTENTION: Spambots must die! Humans must visit
http://contact.futurescale.com
to request forum access.
PureMVC Architects Lounge
PureMVC Manifold
Port to AS3
Standard Version
creating and destroying mediators at runtime
Pages: [
1
]
« previous
next »
Author
Topic: creating and destroying mediators at runtime (Read 1460 times)
hannes
Newbie
Posts: 2
creating and destroying mediators at runtime
«
on:
March 06, 2009, 04:31:40 AM »
hello,
what are the best practices to handle creation and destruction of mediators at runtime?
In my app, there is a "ContentMediator" which creates and initializes different types of dumb (non-interactive) subpages. Now there is an additional type of such subpage, which contains a contact form. I don't want the ContentMediator to know anything about that form, but instead I somehow want to connect something like a ContactFormMediator to the form.
ContentMediator could send a notification carrying the subpage each time some content is created; a command could be executed which checks the content type and creates the ContactFormMediator. Same thing for destroying content.
Is there any better way to accomplish this?
Cheers
Hannes
Logged
puremvc
Global Moderator
Hero Member
Posts: 2366
Re: creating and destroying mediators at runtime
«
Reply #1 on:
March 07, 2009, 08:07:01 AM »
Sounds about right on the creation, but on destruction, a better way to go is that the ContentMediator removes the subpage from its view component's hierarchy. This will cause the subpage component to send a REMOVED event which its mediator should listen for and respond to by removing its listeners, nulling its viewComponent reference (freeing the subpage for GC) and finally removing itself with 'facade.removeMediator(this.getMediatorName());'
-=Cliff>
Logged
hannes
Newbie
Posts: 2
Re: creating and destroying mediators at runtime
«
Reply #2 on:
March 08, 2009, 05:21:16 PM »
thanks, that sounds good
Logged
Pages: [
1
]
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Announcements and General Discussion
-----------------------------
=> Official PureMVC Announcements
=> General Discussion
=> Getting Started
=> Architecture
===> OSGI Working Group
=> Public Demos, Tools and Applications
===> Fabrication
-----------------------------
PureMVC Manifold
-----------------------------
=> Port Authority
===> Contributor Central
===> Client Side
===> Server Side
=> Port to AS2
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to AS3
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to ColdFusion
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to CSharp
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Haxe
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to Java
===> Standard Version
=====> Bug Report
=====> Demos and Utils
===> MultiCore Version
=====> Bug Report
=====> Demos and Utils
=> Port to JavaScript
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Objective C
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to PHP
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Python
===> Standard Version
=====> Bug Report
=====> Demos and Utils
=> Port to Ruby
===> Standard Version
=====> Bug Report
=====> Demos and Utils
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Powered by SMF 1.1.11
|
SMF © 2006-2007, Simple Machines LLC
Loading...
Copyright © 2006-2008 Futurescale, Inc.