PureMVC Architects Lounge

Announcements and General Discussion => General Discussion => Topic started by: Roustalski on December 30, 2008, 07:35:31



Title: Multiton keys
Post by: Roustalski on December 30, 2008, 07:35:31
I wanted to do a little test to see if the name constants for all types were unique per singleton instance.

For example, I have two application facades with different keys. I then have an application mediator for each, but with the same name. It appears as though somewhere along the line, the same names are conflicting when I would expect them to be partitioned off by the facade key.

Is this assumption not correct?

I've attached my demo project showing the problem, but let me describe:

I created a hello google project which requests html from www.google.com and loads it into a text area. I then copied all of the files and placed them in a different package structure and appended "2" to the NAME constant of the second ApplicationFacade class. I also changed the URL from www.google.com to www.yahoo.com

When I click the first load message button, google HTML is loaded into the text area, but when I click the second, it fires and event in the first ApplicationFacade's domain or instance.

Are the facade keys not a partition sort of like application domains? If not, we have to make sure all classes in all projects have unique names? It seems like 2 separate projects using common names would need to keep notifications separate for obvious reasons.


Title: Re: Multiton keys
Post by: Roustalski on December 30, 2008, 07:36:00
Well, the attachment was too big. Perhaps email me and I can send you the example?


Title: Re: Multiton keys
Post by: puremvc on December 30, 2008, 01:18:43
No you do not need to have unique classnames or constants in each module. As long as two ApplicationFacade classes are in different packages there will be no problem. Examine the Modularity and Pipeworks demos to see this is so.

-=Cliff>