flex 库中的循环依赖 [英] Circular dependencies in flex libraries

查看:30
本文介绍了flex 库中的循环依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个相互引用的 Flex 库.两者都使用链接类型External",然后我使用 Loader 类手动加载.

I have two Flex libraries that reference each other. Both use link type "External", and I manually load then with the Loader class.

我收到错误在项目的构建路径中检测到一个循环:foo".

有什么办法可以解决这个问题吗?可能是编译器的参数什么的.

Is there any way to resolve this? Maybe a parameter for the compiler or something.

我认为应该没有问题,因为使用 external 链接类型,源代码不会被编译到库中...

I don't think there should be a problem, since with the external link type the source code doesn't get compiled into the library...

推荐答案

这听起来更像是您需要重新考虑您的代码.

It sounds more like you need to rethink your code.

也许您可以通过使用接口以一种方式消除依赖?

Maybe you can eleminate dependency one way by using interfaces?

如果您可以概述依赖项,也许我或其他人可以提供有关如何重新设计结构的想法.

If you could give an overview of the dependencies maybe I or someone else could give ideas on how to redesign the structure.

你给我减分真是太好了...让我引用维基百科文章 主题:

How nice of you to give me a minus... Let me quote the Wikipedia article on the subject:

[...] 在软件设计通告中大型软件之间的依赖关系模块被认为是反模式,因为它们的负面影响.

[...] in software design circular dependencies between larger software modules are considered an anti-pattern because of their negative effects.

[...]

循环依赖会导致很多软件程序中的不良影响.最有问题的软件设计的观点是紧相互依赖的耦合减少或制作的模块不可能单独重复使用一个单个模块.

Circular dependencies can cause many unwanted effects in software programs. Most problematic from a software design point of view is the tight coupling of the mutually dependent modules which reduces or makes impossible the separate re-use of a single module.

循环依赖会导致当一个小地方的多米诺骨牌效应一个模块的变化扩展到其他模块并具有不需要的全局效果(程序错误,编译错误).循环依赖可以也会导致无限递归或其他意外故障.

Circular dependencies can cause a domino effect when a small local change in one module spreads into other modules and has unwanted global effects (program errors, compile errors). Circular dependencies can also result in infinite recursions or other unexpected failures.

循环依赖也可能导致通过防止某些内存泄漏很原始的自动垃圾收集器(那些使用参考计数)从释放未使用的对象.

Circular dependencies may also cause memory leaks by preventing certain very primitive automatic garbage collectors (those that use reference counting) from deallocating unused objects.

[...]

循环依赖通常是由需要实施的没有经验的程序员介绍某种回调功能.有经验的程序员避免这样不必要的循环依赖应用设计模式,如观察者模式.

Circular dependencies are often introduced by inexperienced programmers who need to implement some kind of callback functionality. Experienced programmers avoid such unnecessary circular dependencies by applying design patterns like the observer pattern.

(强调)

但话说回来,也许你比维基百科上的集体更聪明......

But then again, maybe you are smarter than the collective that writes on wikipedia...

这篇关于flex 库中的循环依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆