Hi Andreas

If you're writing code to generate Java code from an activity then
that should definitely not be in the activity diagram module. Your
code should not be reading to Figs and using them as the basis to
generate anything but it should just be reading the module. So in
theory the diagram itself shouldn't even be required.

Another problem if you coded in the diagram module or even referred
directly to it is if that was ever replaced using the eclipse diagram
tools in future.

I would suggest that any such code would go inside the Java module but
you could even add this to a new separate module while its being
developed.

If we had such functionality available then a toolbutton in the
activity diagram would be useful to trigger it but we still don't want
the Java and activity modules to know of each other directly. We
should have both of them go via core ArgoUML.

We need first to make sure we have a good flexible architecture for
extending functionality like this.

Some quick thoughts

We need a CommandFactory class

Any module can register a CommandFactory with core ArgoUML

The CommandFactory create method will create a Command to do whatever
functionality is required

As an example

1. A module registers a CommandFactory for a diagram type
=============================================
You can write a GenerateJavaFromActivityCommand (extends
AbstractCommand) that will have an execute method to perform all your
functionality

You also write a GenerateJavaFromActivityCommandFactory. The create
method of that class will check if we are in UML1.4 mode, if so it
will just return null. If we are UML2 mode though it will create a new
instance of your Command and return it.

You register your factory with core ArgoUML with something like
CommandFactoryManager.addCommandFactory(DiagramType.Activity,
myCommandFactory)

2. A diagram queries what Commands it should add to its toolbar.
================================================
Our new activity diagram module calls core argouml asking for any
CommandFactory's registered to DiagramType.Activity

For each returned it calls the create method

For any that return non-null it wraps the Command in an Action and
uses that to create a toolbutton.

Quite where to register I'm not sure yet. Do we need a
CommandFactoryManager or do we need some extension to ModuleLoader?


Note that even the swing class Action is not used anywhere except in
the diagram module so we are begining to make as much new code as we
can Swing/SWT neutral.

Regards

Bob.

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=2638219

To unsubscribe from this discussion, e-mail: 
[[email protected]].
To be allowed to post to the list contact the mailing list moderator, email: 
[[email protected]]

Reply via email to