15.04.2018 Views

programming-for-dummies

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Automating Software Engineering with CASE 119<br />

diagrams, programmers can define objects and how they interact with each<br />

other without worrying about the specifics of any object-oriented <strong>programming</strong><br />

language.<br />

Book I<br />

Chapter 5<br />

Dynamic model<br />

A UML dynamic model (or a Sequence diagram) describes the sequences a<br />

program follows, as shown in Figure 5-5. Sequence diagrams are similar to<br />

flowcharts because they describe what a program does at any given time,<br />

but not necessarily how a program works, which is unlike a flowchart.<br />

Managing Large<br />

Projects with<br />

Software<br />

Engineering<br />

sophmore : Student<br />

basket_weaving_101 : Course<br />

joe_derkins : Teacher<br />

fall : Semester<br />

Assign Teacher()<br />

Figure 5-5:<br />

UML<br />

Sequence<br />

diagrams<br />

define how<br />

a program<br />

works.<br />

Enroll (Student ID)<br />

Add Student (Student ID)<br />

Sequence diagrams show you the order that events occur, the messages<br />

passed from one object to another, and the actual names of all interacting<br />

objects.<br />

The boxes at the top of the Sequence diagram in Figure 5-5 shows object<br />

names and the classes they’re based on (such as a sophomore object based<br />

on the Student class). The vertical dotted lines (lifelines) show how long an<br />

object exists. The arrows show the messages objects send to each other. A<br />

Sequence diagram helps explain the interaction between different objects.<br />

Generating code automatically<br />

Designing a program by using UML or some other modeling method can be<br />

great, but there’s a big gap between designing a program and actually writing<br />

code that follows that design. To eliminate this problem of transferring a program<br />

design into working code, computer scientists have created special<br />

programs dubbed code generators. The basic steps <strong>for</strong> using a code generator<br />

are as follows:

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

Saved successfully!

Ooh no, something went wrong!