在 module1 中加载与 module2 中的类同名的类
我有一个 Flex 应用程序,可以根据需要加载模块。当第一个模块加载时,它会创建一个类 MyBackground(),它将背景绘制为红色。当我选择加载第二个模块(并卸载第一个模块)时,我再次加载类 MyBackground (从第二个模块)。但是,当我进入 MyBackground 的构造函数时,它会直接进入 UIComponentDescriptor 的构造函数:
public function UIComponentDescriptor(descriptorProperties:Object)
{
super(descriptorProperties);
}
这是否与我加载的每个模块使用相同的应用程序域有关? Flex 是否将类类型加载到父应用程序中并缓存它们,因此当我第二次请求一个类时,它只是进行查找,而不实际查看该类是否相同?
任何有关这方面的信息表示赞赏。
I have a Flex application that can load modules as necessary. When the first module is loaded, it creates a class MyBackground(), which paints the background red. When I choose to load a second module (and unload the first) I again load a class MyBackground (from the second module). However, when I step into the constructor for MyBackground, it goes straight into the constructor for the UIComponentDescriptor:
public function UIComponentDescriptor(descriptorProperties:Object)
{
super(descriptorProperties);
}
Is this something to do with using the same application domain for each module that I load? Does Flex load in the class types into the parent application and cache them, so when I request a class the second time it just does a lookup, without actually seeing if the class is the same?
Any info on this appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经设法通过使用子应用程序域解决了这个问题(这并不是 100% 有意义,因为它说子域不能覆盖父域,但这似乎正是发生的情况)。
I've managed to fix the issue by using a child application domain (which doesn't make 100% sense as it says child domains can't override parent domains, yet that appears to be exactly what is happening).