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.

28<br />

Friday Evening<br />

the other guy), and leaves assuming he has the truth. How do you feel Outraged, I imagine.<br />

The officer talked to his “client” and captured the facts just like we typically gather our<br />

requirements. So what’s the problem<br />

The problem is that the officer did nothing to verify his facts. He should have asked the<br />

other witnesses for their perspectives. After he does that, he has a bunch of eyewitness<br />

accounts. If he compares the stories, he’ll discover two things. First, some of the information<br />

from different testimonies will agree. He can reasonably assume that those portions of the<br />

account are true. Second, the portions that don’t line up can’t be trusted until he can find<br />

corroborating evidence.<br />

Working with multiple, different views works in the same way. The diagrams each look at<br />

your problem in a different way, like different witnesses. The diagrams will overlap. If they<br />

agree where they overlap, you can relax knowing you’ve probably got it right. If they don’t<br />

agree, then you have some homework to do to reconcile the differences. Now here is the<br />

other great benefit: When they disagree, you’ve pinpointed where you need to invest your<br />

effort. When everything agrees, you know you’re done.<br />

Object-Oriented Principles<br />

Next I want to visit the principles that drive most of the <strong>UML</strong> modeling. All the <strong>UML</strong> diagrams<br />

describe some form of object-oriented information. But what does the term object-oriented<br />

mean The term itself sheds some light on the answer. It has something to do with viewing<br />

the things in the world as objects.<br />

So what is an object The simplest definition of an object is pretty much anything you<br />

can talk about. Look around you. Almost without thinking you may begin to recognize<br />

things you see and give them names: book, chair, lamp, room, and so on. An object can be<br />

a physical entity, like the things you see, but an object may also be intangible, for example,<br />

a concept like an illness, attendance, or a job. Even though a job is not something you can<br />

touch, it is something you can describe, discuss, assign, and complete.<br />

(By the way, if you aren’t already familiar with OO concepts, some of the language may<br />

sound a little odd. Be prepared.)<br />

So what do you need to know about an object<br />

Abstraction<br />

A software object is an abstraction, a representation of something in the real world like this<br />

book. An abstraction is a way to describe something where you only include the information<br />

about it that is important to you. When I need to contact my friend Victor, for example, I<br />

don’t need to know everything about him. I just need his phone number or e-mail address.<br />

Thank heaven I don’t also need to know his anatomy, his genealogy, and his music preferences!<br />

All those things are valid, but they don’t help me contact him. Figure 3-5 shows<br />

Victor on the left, hard at work, and an object icon, my abstraction of Victor, on the right.

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

Saved successfully!

Ooh no, something went wrong!