tags:

views:

27

answers:

2

I was reading this Wikipedia page on UML 2 package diagrams. This page mentions a relationship of merge between 2 packages.

Quoting the article:

"A package merge is "a directed relationship between two packages, that indicates that the contents of the two packages are to be combined. It is very similar to Generalization in the sense that the source element conceptually adds the characteristics of the target element to its own characteristics resulting in an element that combines the characteristics of both"

Somehow I just cannot grok this concept of package merging.

Has anyone used this in their modeling? Can anyone give me a real example of where and why you would use package merge.

A: 

The merge package is a kind of dependency link. I never use it because this concept is not needed with my favorite tool EclipseUML Omondo. I mean that my modeling is made at project level which includes packages, inners packages etc....

Many tools are talking about package merge because they have never implemented the project level and still just model at package level :-) If you reverse a multiple packages java project then export the xmi of RSA, EA or any other tool then you will see what I mean. You don't for example see an interface and a class inheritance because not placed in the same package. How can you imagine that I would place all my interfaces and classes in the same package ?

This is what is recommended by tool vendors because they can't manage project level and this is for me bad project architecture !! alt text

A: 

The wiki quote is right from the OMG spec, as the reference indicates. Two things. The OMG spec goes on to say:

This mechanism should be used when elements defined in different packages have the same name and are intended to represent the same concept. Most often it is used to provide different definitions of a given concept for different purposes, starting from a common base definition. A given base concept is extended in increments, with each increment defined in a separate merged package. By selecting which increments to merge, it is possible to obtain a custom definition of a concept for a specific end. Package merge is particularly useful in meta-modeling and is extensively used in the definition of the UML metamodel.

Secondly the entire OMG UML spec infrastructure and superstructure is broken into many packages, which are often merged. This is useful when you want to do your own meta modeling and add functionality or exclude it, I have myself. UML is their own best example. Many UML implementations have followed this package merging scheme successfully for inclusion and exclusion to a solution.

Ted Johnson