Something that can be seen, touched or otherwise sensed
Things about an object Weight Height Material Things an object does Pen writes Book stores words
Water have Fresh water Rivers Oceans have have Fish have live in Crocodiles Salt water Penguins
struct Time { // structure definition int hour; // 0-23 int minute; // 0-59 int second; // 0-59 }; Time dinnertime; dinnertime.hour = 29; dinnertime.minute minute = 73;
class Time { public: Time(); // constructor void settime( int, int, int ); // set hour, minute, second void printtime(); // print time format private: int hour; // 0-23 int minute; // 0-59 int second; // 0-59 };
void Time::setTime( int h, int m, int s ) { hour = ( h >= 0 && h < 24 )? h : 0; minute = (m>= 0&&m< 60 )? m : 0; second = ( s >= 0 && s < 60 )? s : 0; } Int main(){ Time t; t.settime( 13, 27, 6 ); t.printtime(); t.settime( 99, 99, 99 ); }
vocabulary functionality system assembly configuration mgmt. Design View Implementation View Use Case View Process View Deployment View performance scalability throughput behavior system topology distribution delivery installation
<?> <?> :
T1:Approach(train ID) T: T5:Speedup(train ID) (150) (40) (30) T4:Cleared(train ID) T3:Time Depart(train ID) (ok) T2:AtPlatform(train ID) (0)
Class Driver Attributes Operations Name Address Driver ID Train Number Mileage Print Name Assign Train Get Mileage Increase Mileage Set Destination
(C++) class Driver { private: char name, *address; int driverid, mileage; char *trainnumber; public: Driver(int, char *); void printname(int); int getmileage(); void increasemileage(); void assigntrain(); void setdestination(int); }; main() { Driver drvr1 r1 (2734, Kim ) Driver * drvr2; drvr2 = new Driver (2759, Lee ) drvr1.increasemilage(1500); drvr2 increasemileage(60); if( drvr1.getmileage() >20000). }
Class Active Class (processes/threads) Student Event Mgr std_id thread grade time hangelevel( ) Start setgrade( ) suspend( ) getgrade( ) stop( ) Component (replaceable part, realizes interfaces) Course.cpp Interface (collection of externally Visible ops) IGrade <<interface>> IGrade Node (computational resource at run-time, processing power w. memory) UnivWebServer setgrade() getgrade() Register for Courses Manage Course Registration Use Case (a system service -sequence of Interactions w. actor) Collaboration (chain of responsibility shared by a web of interacting objects, structural and behavioral)
( Interaction) a set of objects exchanging messages, to accomplish a specific purpose. harry: Student name = Harry Kid ask-for-an-a katie: Professor name = Katie Holmes (State t Machine) specifies the sequence of states an object or an interaction goes through during its lifetime in response to events. instudy received-an-a/ buy-beer sober/turn-on-pc inparty
Course Manager University Administration Course Manager Student Admission -Student +Department - Explanatory/Comment parts of UML models - usually called adornments - Expressed in informal or formal text. flexible drop-out dates operation() {for all g in children g.operation() }