Difference between revisions of "OOP Class6"
(→UML) |
m (→UML) |
||
Line 4: | Line 4: | ||
[http://dia-installer.sourceforge.net/ Dia for windows] | [http://dia-installer.sourceforge.net/ Dia for windows] | ||
− | + | [http://iam.colum.edu/oop/browser/browser.aspx?f=/classsource/class6/DiagramDog Dog Diagrams with Dia] | |
==What is UML== | ==What is UML== |
Revision as of 16:14, 28 February 2006
UML
What is UML
Simple Notation
Dog Exmaples
Simple Dog Class from week 5 DogSimple.cs - source
<csharp>using System;
//Dog simple class definition public class Dog {
public string Name; // the dog's name
public int Age; // the dog's age public int Weight; // the dog's weight public string BarkSound; // the sound of the dog's bark
public Dog() { BarkSound = "Woof!!!"; }
public void Bark() { //put bark code here } public void Eat() { //put eat code here } }</csharp>
Dog UML with Types
Dog Class with Types from week 4 DogWithTypes.cs - source
<csharp>using System;
//Dog simple class definition public class Dog {
public string Name; // the dog's name
private int Age; // the dog's age public int Weight; // the dog's weight public string BarkSound; // the sound of the dog's bark private int barkCount; //The number of time the dog has barked public Dog() { BarkSound = "Woof!!!"; }
public string Bark() { string strBark = this.BarkSound;
barkCount ++; return strBark;
}
public void Eat() { //put eat code here } }</csharp>