4

for a software design project I have to do, I chose the Eclipse Platform as a framework. Meaning I have lots of extension points to implement.

However, I have trouble specifying these extension points in my UML class diagram. So how do I model the fact that a class belongs to an extension point in my class diagram?

Or is the class diagram the wrong place to do this anyway? If so, where is the best place to specify the extension points I implement?

For reference, I am doing the UML modeling with Papyrus. I already have a working prototype of the application, so it is just about creating the diagram.

Cheers

user2019510
  • 1,460
  • 5
  • 16
  • 29

4 Answers4

2

Speaking of Eclipse plugins I would rather choose a component diagram than a class diagram. You can then model extension points as ports and their contract as interfaces (those lollipops).

If you rather have class diagrams specifying extension points as interfaces with a special stereotype (or keyword) would be fine as well.

Regarding the class implementing an extension point you can either use a dependency on the component or (in the second solution) an interface realization.

Christian
  • 13,285
  • 2
  • 32
  • 49
1

An eclipse extension point is like an interface: it declares a set of properties that must be implemented.

For example, the org.eclipse.ui.editors extension point declares that to implement this extension point you have to provide:

  1. id
  2. name
  3. icon
  4. class
  5. file extensions
  6. contributors

There is no EXACT way to say this in UML since an extension point is neither an interface nor an object, but you could model it by adding a stereotype to your model, say <<extension_point>> (you can read more about stereotypes here), and create a class in your diagram (for example org.eclipse.ui.editors) that has all of these attributes, with their required types (in this example all attributes are strings, except class which is of type org.eclipse.ui.IEditorPart).

After this you can create another stereotype, say <<extension_point_implementation>> and a new class that has this stereotype. This class you connect with a realization link from the <<extension_point>> class, and then you set the values of all of the attributes to what you are implementing.

Note that this is not "pure" UML since you are defining a new domain with added semantics, but I think that this would be a good and easy to understand way to model what you want.

vainolo
  • 6,907
  • 4
  • 24
  • 47
0

In a sense extensions are to extension points what instances are to classes; extension points define the possible attributes of the extensions, and each extension contains the concrete attributes conforming to the extension point.

Tassos Bassoukos
  • 16,017
  • 2
  • 36
  • 40
0

Just reverse the java code and add a note. It would do the job.

UML GURU
  • 1,452
  • 1
  • 9
  • 7
  • I have trouble understanding what you mean by „reverse the java code“. Could you please shortly explain it? Thanks in advance! – user1083696 Dec 06 '11 at 23:39
  • You reverse the jar file of the other plugin and also reverse your code. You therefore have now one big model composed by one or more project which have been reversed. You create an empty class diagram and then drag and drop your class calling the other plugin class inside the same diagram. Create a dependency with "extension point" as stereotype. Job done :-) – UML GURU Dec 07 '11 at 09:50
  • You can also reverse a method and if you have an eclipse project and have inside the same workspace then the reverse will also go to check what is going on in the jar file and other projects. I mean that the sequence diagram is at multi-project level too. – UML GURU Dec 07 '11 at 09:52