[OpenLayers-Trac] Re: [OpenLayers] #2992: move
OpenLayers.Util.extend to Class.js
OpenLayers
trac-20090302 at openlayers.org
Mon Jan 3 10:50:56 EST 2011
#2992: move OpenLayers.Util.extend to Class.js
---------------------+------------------------------------------------------
Reporter: tschaub | Owner:
Type: feature | Status: new
Priority: minor | Milestone: 2.11 Release
Component: general | Version: 2.10
Keywords: | State: Review
---------------------+------------------------------------------------------
Comment(by tschaub):
It's a semantic issue. We don't need Util.js to be loaded before Class.js
can execute, but Class.js depends on Util.js (OpenLayers.Util.require).
Since we use @require comments to specify dependencies, it makes to put a
@require comment in Class.js that pulls in Util.js. Since Util.js depends
on several BaseTypes, and those BaseTypes use the Class function, we get a
circular dependency.
These circular dependencies are not a real problem. The problem is the
current toposort method - which bombs out in the case of a circular
dependency (and is needlessly complex). It is acceptable to resolve a
circular dependency with an arbitrary order in cases where the dependency
is not used when the library initially loads.
The BaseTypes need the Class function to be defined at load time. We
can't guarantee this with a circular dependency. The way to guarantee
that Class is defined first is to make sure it doesn't depend on anything
else that depends on it. So Class.js should depend only on SingleFile.js.
--
Ticket URL: <http://trac.openlayers.org/ticket/2992#comment:3>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list