By Rupert
Posts tagged uml
Writing CFCs using UML with Poseidon
Feb 4th
It seems the xmi2cfc tool from cfcxmi.tigris.org works only for Poseidon 2.x versions. The visio works well and poseidon can export the xmi as well but I still encounter problems during the xmi to cfc conversion.
I just bought a 1GB ram for my notebook since Poseidon peaks at 200MB. How to create cfc’s with Poseidon?
1. Download and install Poseidon. Im using Poseidon 5 Professional.
2. Download the poseidon custom templates from http://cfcxmi.tigris.org/.
3. Extract it to Poseidon/lib/. You should have the ff directories:
Poseidon/
lib/
custom/
4. Start poseidon
5. Click on “Generation” -> “Java”
6. Click on the ellipses tool and point to the custom templates.
7. “Apply” the settings.
8. Create your class
9. Click on the source code to view your cfc.
I have made some changes to the templates to reflect the output=”false” and required=”true”. You can download the templates from here.
UML Explained
Feb 1st
As Im making some progress in ColdSpring/Reactor, I need some modelling to be able to visualise things much better and to help the team understand. Here is a very good post regarding Use Case Diagrams and Activity Diagrams that Doug wrote.
Some UML Tools:
ArgoUML
- hard to copy and paste objects
Poseidon for UML5.0.1 – without JRE
- cannot save
cfcxmi convert XML models to CFC
Visio 2003 UML Class Export Tool
1. Open your class diagram at a page with a class you wish to export.
2. Control+click each class you wish to export
3. Open the Visual Basic Editor (Alt+F11)
4. Double click on "ThisDocument" if no script is currently loaded
5. Paste the script below here into the empty page
6. Edit the "LogFileLocation" string to tell it where you wish to save your file. (Note: this must exist before the script runs)
7. Hit F5 to run the script
8. Enter a name for the file in the popup box
9. Hit OK
Sub ExportShapes() Const LogFileLocation As String = "C:\visioExportFiles\" Dim selObj As Visio.Selection 'Shapes selection collection Dim shpObj As Visio.Shape 'A shape instance Dim i As Integer Dim myClassDef As String Dim LogFileName As String Dim FileNum As Integer myClassDef = "<classes>" Set selObj = Visio.ActiveWindow.Selection For i = 1 To selObj.Count Set shpObj = selObj(i) myClassDef = myClassDef & "<class>" myClassDef = myClassDef & " <properties> <property>" & Replace(shpObj.Shapes.Item(6).Text, Chr(10), "</property> <property>") & "</property></properties>" myClassDef = myClassDef & "<methods><method>" & Replace(shpObj.Shapes.Item(5).Text, Chr(10), "</method><method>") & "</method></methods>" myClassDef = myClassDef & "</class>" Next i myClassDef = myClassDef & "</classes>" 'Begin export LogFileName = InputBox("What is the file name you wish to use (exclude the .xml extension)?", "Export Classes") MsgBox (myClassDef) If Len(LogFileName) Then FileNum = FreeFile ' next file number Open LogFileLocation & LogFileName & ".xml" For Output As #FileNum ' creates the file if it doesn't exist Print #FileNum, myClassDef ' write information at the end of the text file Close #FileNum ' close the file Else MsgBox ("Bad file name") End If End Sub
Comments