[Mapserver-users] UML class diagram of PHP/MapScript

Sean Gillies sgillies at frii.com
Fri Oct 31 09:30:32 PST 2003


On Friday, October 31, 2003, at 09:37  AM, Yewondwossen Assefa wrote:

> Alexander Pucher wrote:
>> Hi,
>> thanks for the images. I started a draft yesterday, but came up with 
>> a far more complex version.
>> What made some first problems was the distinction between classes 
>> that are returned by other classes (e.g. mapObj -> layerObj) and 
>> those that are embedded in other classes (e.g. scalebarObj is 
>> embedded in mapObj, i.e. is a member of mapObj)
>>  From what I read about UML/Object-oriented concepts, the connection 
>> between mapObj and layerObj is an 'aggregation' (i.e. 1..* layers are 
>> aggregated to one map), whereas mapObj is dependent on scalebarObj 
>> (with the stereotype: access).
>
>> You think this is correct? Is this distinction important for the UML 
>> concept of PHP/MapScript?
>
>   From what I read on UML, aggregation is the correct link between map 
> and layers since both could exist without being associated to each 
> other. But I think the link should be 0..* since a map object could 
> have  0 layers.
>
>  As for embedded objects like scalebar, although they could exist 
> without a link to a map, they do not really make sense in a general 
> use in mapserver (which is to draw a scalebar) without a map object. 
> Not also that the map does not need to have a scalebar to be exist. 
> Not sure to know what is the best representation, but from my limiyes 
> undersanding of UML, aggregational link seems to be the one that 
> defines best this relationship.
>
>

I'm with Assefa, the relationship between mapObj and scalebarObj is 
aggregation.
And since a scalebarObj only exists within one mapObj and is destroyed 
when the
mapObj is destroyed, we could call it a 'composition' relationship 
(Fowler and
Scott, UML Distilled).

However, I think that you might be going about this in the wrong 
direction.  UML
is a tool for design of classes and systems, not a tool for explaining 
the
structure of a package that is already in existence.  If you really 
like UML and
want it to be meaningful, the thing to do would be to refactor the 
MapServer
objects so that they have real UML relationships between them rather 
than
picking which UML relationship is the nearest to the existing 
relationship.

This is not to say that I feel graphing the class relationships to be
unproductive.  Such a graph would be a great reference item, and will 
stimulate
people to think about how the classes and their relationships might be 
improved.

cheers,
Sean

--
Sean Gillies
sgillies at frii dot com
http://www.frii.com/~sgillies




More information about the MapServer-users mailing list