performance vs. design
Christoph Baudson
christoph.baudson at ccgis.de
Fri Nov 10 04:58:19 EST 2006
Hi there,
the worst problem while redesigning the digitizing/WFS components was
how to keep Mapbender lean and not overloading map.php with too much
content. A very basic Mapbender should load as fast as possible.
One example: We have a new function that calculates the part of a line
which actually lies within the mapframe. With this, we don't have to
paint parts of geometries we don't see at all. That enhances the
performance a lot. The problem is: this function should be (speaking in
terms of OO-design) a method of the map object class. You ask the map
object (f.e. mapframe1) which part of a geometry it contains. But adding
these function(s) to the map object class would result in more size and
more traffic.
The solution now is to ask the map object about its width/height (that
always includes getting the map object index by the frame name first)
and then call a geometry function that determines which part of a
geometry lies within a box with given width and height. Not as
beautiful, but maybe more efficient.
This is just one example, there are dozens more.
So there is a trade-off between performance and software design. Maybe
other developers might share their insights about this.
Cheers,
Christoph
More information about the Mapbender_dev
mailing list