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

Pages: [1]
Print
Author Topic: Multiton keys  (Read 6312 times)
Roustalski
Jr. Member
**
Posts: 13


View Profile Email
« 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.
« Last Edit: December 30, 2008, 07:51:15 by Roustalski » Logged
Roustalski
Jr. Member
**
Posts: 13


View Profile Email
« Reply #1 on: December 30, 2008, 07:36:00 »

Well, the attachment was too big. Perhaps email me and I can send you the example?
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #2 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>
Logged
Pages: [1]
Print