Im curious, when you design the classes of your application, there are always framework classes that the classes you design contain in one way or another... like eventargs, arraylist, graphics objects.
How do you draw them in UML? If you have a class that has a property of type arraylist... then you have to make the arraylist class and draw it, in order for the property to be rendered correctly
I use visio, and there you can select the property type from a dropdownlist. And only predefined value types and classes which you have added are visible on that list. So for an arraylist class to be seletable you have to add it manualy by creating a dummy arraylist class...
Or how do you write your UML diagrams? Can I somehow import all framework classes in visio?
I have another question.... if I have three classes A, B and C
Class A has an arraylist property which can contain both B and C objects
What kind of relation should I draw between A B and C? I can't find a good relation in visio... Im looking for a simple arrow.. but perhaps there should be a more advanced type of aggregation?
In response to your first question (Creating additional framework datatypes):
1) Open your Model Explorer (UML -> View -> Model Explorer)
2) Right click the root node (mine was called UML System 2)
3) Click on Packages... (the packages window opens)
4) Click New (a new package is added to the list)
5) Change the name of the package (I changed mine to System.Collections)
6) Click Ok
7) In the Model Explorer, right click the package you just created.
8) Select New -> Datatype...
9) The UML Datatype Properties dialog is displayed.
10) Give the datatype a name (I called mine ArrayList)
11) Click Ok.
12) This datatype will now appear in the type dropdown lists you speak of.
In response to your second question, I have attached a pdf document that should answer you question. You will notice though that I did not specify that they both belong in the ArrayList. Perhaps this is the part you really wanted the help on???
I dont think that sort of implementation detail can be shown in a UML static structure diagram. I think you can show the relationship between the classes (e.g. A contains B and C), but I dont think you can show exactly how....
I believe the delegate in your case is a signal in UML. You would put a signal onto your diagram and other classes will be registered to receive notifications from the signal. I am not 100% sure of this, but from what I understand, thats how its supposed to be done. If anyone else really knows how it should be done, please let us all know!
just an idea: To import the .NET framework libraries into Visio
Create any project in .NET and reference the libraries you want to import into Visio. Load up the Visio add-in for .NET and hit the Reverse Engineer button. It will "import" the referenced libraries for you and you can use that Visio file for your application design. If you do this just once, you can then save it as a template from which you can create new visio files.
I definitley agree with you about the design issues on the forums. There are very few that will ever answer your design and architecture questions.
I think that most developers on the forums are just programmers. They know how to write code, but they have no idea how to put together a sound application design. Either that or it just takes too long to do the design and you need too many details on the application.
Sorry, missed your post about the delagate... It's amazing how little information there is to be found on the internet about this stuff... But one can assume that a signal can represent a classifier.. now the question is, what kind of relationship does it have with the class that uses it?
I have an object O in my class A, the object O has an event E, and in this class A I have a delegate D handling the event E...
I tried a "Dependency" relatinship, and I got no errors. Dunno if it's correct..
Check the attachment. This is how I do it. No ones ever told me I was doing it wrong, so.... Then again, I dont know anyone that would know any better.
1) Open the properties dialog of class A.
2) Click on the Receptions item in the list on the left of the dialog.
3) Add a reception and choose the signal.
4) Ok.
5) Open the properties dialog of class O.
6) Click on the Operations item in the list on the left of the dialog.
7) Add an operation.
8) Select the operation you have just created and click on the "Properties..." button on the right of the dialog.
9) Click on "Code Generation Options" item in the list on the left of the dialog.
10) If you are using Visual Basic code, then select Event from the "Kind" list box.
11) Ok.
If you preview the code generation for the O class, you will see that the operation is declared as an event. How you tell the event that its signature must match that of your delegate, I dont know. Thats why they still have programmers...???