01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

58<br />

Saturday Morning<br />

Customer<br />

Withdraw Cash<br />

<br />

Update Account<br />

Withdraw Cash<br />

with Overdraft<br />

Protection<br />

<br />

Protect Overdraft<br />

Figure 5-9<br />

dependency notation for the Use Case diagram<br />

Generalization<br />

Inheritance is a key concept in object-oriented programming, and OO analysis and design.<br />

Inheritance tells us that one object has, at the time of its creation, access to all the properties<br />

of another class, besides its own class. Thus, the created object incorporates all those<br />

properties into its own definition. In layman’s terms, we say things like, “A Ford Explorer is<br />

a car.” A car is a well-defined general concept. When you create a Ford Explorer, rather than<br />

redefine all the car properties, you simply “inherit” or assimilate all the existing car properties,<br />

then override and/or add any new properties to complete the definition of your new<br />

Ford Explorer object.<br />

The same idea, applied to actors and to Use Cases, is called generalization, and often goes<br />

by the nickname, an “is a” relationship. A Senior Bank Teller is a Bank Teller with additional<br />

authority and responsibilities. The “Withdraw Cash with Overdraft Protection” Use Case is a<br />

more extensive requirement than the “Withdraw Cash” Use Case.<br />

<strong>To</strong> model generalization, the <strong>UML</strong> uses a solid line with a hollow triangle. It looks a bit<br />

like an arrow, but be careful not to confuse the two. The triangle is always on the end near<br />

the item that is being inherited. In the examples mentioned earlier, the triangle would be<br />

near “Bank Teller” and “Withdraw Cash,” as shown in Figure 5-10.<br />

Customer<br />

Withdraw Cash<br />

<br />

Update Account<br />

Withdraw Cash<br />

with Overdraft<br />

Protection<br />

<br />

Protect Overdraft<br />

Figure 5-10<br />

Generalization notation for the Use Case diagram

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!