Стив Макконелл - Совершенный код

889

Upload: ruslan-medinskiy

Post on 14-Apr-2017

136 views

Category:

Education


3 download

TRANSCRIPT

  • .

    , Refactoring

    , , , # .

    , Programming Pearls, 2d ed

    , # # . . # !

    , Debugging Applicationsfor Microsoft .NET and Microsoft Windows

    , # . # , .

    , , Microsoft; Writing Secure Code

    # . , , , , .

    , Object Solutions

    . 850# . , # (, #) , . .

    , High%Performance Client/Server

    # ,

    , Game Development and Production

    .

    , The Laboratory Computer:A Practical Guide for Physiologists and Neuroscientists

    , .

    . , Embedded Systems Building Blocks:Complete and Ready%To%Use Modules in C

    ,

    , Unix: The Complete Reference

  • , , # . .

    , PC Techniques

    Microsoft Press , # . .

    , Software Development

    .

    . . () , Computer

    , , #, . . , # # , .

    , IEEE Micro

    # .

    , C Users Journal

    , , API, .

    , Windows Tech Journal

    , .

    , .EXE

    , # , .

    , Program Now

  • ,

    , ,

    .

    CC2_Titul_2010.indd I 21.06.2010 16:28:23

  • Second Edition

    C O D ECOMPLETE

    Steve McConnell

    CC2_Titul_2010.indd II 21.06.2010 16:28:37

  • 2010

    -

    CC2_Titul_2010.indd III 21.06.2010 16:28:37

  • 004.45 32.973.26018.2

    15

    .

    15 . # / . . . : , 2010. 896 . : .

    ISBN 978-5750200641

    10

    .

    , -

    .

    , ,

    , -

    . -

    , ,

    , ,

    .

    35 , .

    004.45 32.973.26018.2

    2005-2012, Translation Russian Edition Publishers.

    Authorized Russian translation of the English edition of Code Complete, Second Edition, ISBN 9780735619678

    Steven C. McConnell.

    This translation is published and sold by permission of OReilly Media, Inc., which owns or controls all rights to publish

    and sell the same.

    2005-2012, .

    Code Complete, Second Edition,

    ISBN 9780735619678 Steven C. McConnell.

    OReilly Media, Inc.,

    .

    2005-2012, , .

    Microsoft, , , : http://www.microsoft.com/about/legal/en/us/IntellectualProperty/Trademarks/EN-US.aspx Microsoft / . .

    , , , ,

    , , .

    ul_2010.in

  • VII

    .................................................................................................................... XIII ................................................................................................................ XIX ...................................................................................................... XXI

    I 1 ! .................................................... 2

    1.1. ? ................................................................................................. 2

    1.2. ? ........................................................................... 5

    1.3. ................................................................................................................................6

    2 , .................................... 82.1. ......................................................................................................................................8

    2.2. ? ...................................................................................................... 10

    2.3. , ........................ 12

    3 , : ...................... 213.1. ............................................... 22

    3.2. , ..................................................... 28

    3.3. ,

    ...................................................................................................................... 34

    3.4. , ....... 36

    3.5. , .................................................................................................................... 41

    3.6. ? ..................................................................................................................... 52

    4 , ................................................................................................ 58

    4.1. ........................................................................................... 59

    4.2. ............................................................................................... 63

    4.3. ........................................................................................................ 64

    4.4. ............................................................. 66

    II 5 ................................................................. 70

    5.1. , ......................................................... 71

    5.2. ........................................................................... 74

    5.3. : ........................... 84

    5.4. ........................................................................................................ 107

    5.5. ........................................ 115

    6 ........................................................................................................................ 1216.1. : ............................................................ 122

    6.2. .................................................................................. 129

    6.3. ..................................................................... 139

  • VIII

    6.4. ............................................................................. 148

    6.5. , ................................................................................ 152

    6.6. : ............................................................................... 153

    7 ............................................................................... 1577.1. ............................................................................ 160

    7.2. ................................................................................ 163

    7.3. ................................................................................................................. 167

    7.4. ? ................................................................... 169

    7.5. ................................................. 170

    7.6. ................................. 177

    7.7. # ................................................................. 178

    8 ................................................................................ 1828.1. .............................. 183

    8.2. .............................................................................................................................................. 184

    8.3. .................................................................................................... 189

    8.4. ............................................................................................................................................... 193

    8.5. , ................................................... 198

    8.6. ....................................................................................................................... 200

    8.7. ........... 204

    8.8. ................................................................. 206

    9 ...................................................... 2099.1. .................................................................................... 210

    9.2. ....................................................................................................................... 211

    9.3. ......................................... 214

    9.4. ............................................................................................................................. 225

    III 10 ................................................ 230

    10.1. ? ............................................................................................................. 231

    10.2. ............................................................................. 232

    10.3. ................................................................ 233

    10.4. ......................................................................................................................... 238

    10.5. ............................................................................................................................... 245

    10.6. ............................................................................................................................. 246

    10.7. ............... 247

    10.8. ............................................................ 249

    11 ......................................................................................... 25211.1. ..................................................... 253

    11.2. ................................................................... 257

    11.3. ............................................................................................... 263

    11.4. ................................................................... 264

    11.5. ........................................................................................... 272

    11.6. ............................................................ 274

    11.7. , ..................................................................................... 277

  • IX

    12 ......................................................................................... 28212.1. ...................................................................................................................................... 283

    12.2. ............................................................................................................................................ 284

    12.3. ................................................................................................... 286

    12.4. ............................................................................................................................ 289

    12.5. ............................................................................................................ 292

    12.6. ...................................................................................................................... 294

    12.7. .......................................................................................................... 299

    12.8. ...................................................................................................................................................... 301

    12.9. () ................................. 303

    13 ............................................................................... 31013.1. ................................................................................................................................................. 310

    13.2. ................................................................................................................................................... 314

    13.3. ......................................................................................................................... 326

    IV 14 .............................................................. 338

    14.1. , ........................................... 338

    14.2. , ........................................... 342

    15 ............................................................................................. 34615.1. if ........................................................................................................................................... 346

    15.2. case ................................................................................................................................... 353

    16 ........................................................................................................................ 35916.1. ............................................................................................................................. 359

    16.2. ........................................................................................................................ 365

    16.3. ......................................................... 378

    16.4. ........................................................... 379

    17 ......................................................... 38217.1. ............................................................................ 382

    17.2. ...................................................................................................................................................... 385

    17.3. goto ....................................................................................................................................... 389

    17.4. ................................ 401

    18 ................................................................................................. 40418.1. ................................ 405

    18.2. ................................................................................................. 406

    18.3. .................................................................... 418

    18.4. ................................................................................ 419

    18.5. ............................................................................ 422

    19 ................................................................................ 42419.1. ............................................................................................................... 424

    19.2. () ............................................................................................ 436

    19.3. ........................................................................................................................... 437

    19.4. ........................................................... 438

  • X

    19.5. : .......... 448

    19.6. ........................................................................ 450

    V 20 ............................................................................................................. 456

    20.1. ............................................................................................... 456

    20.2. ................................................................................ 459

    20.3. ....................................................................................................... 462

    20.4. ? ................................................................. 466

    20.5. ....................................................................... 467

    21 ............................................................................. 47121.1. ......................................................... 472

    21.2. .................................................................................................... 475

    21.3. ............................................................................................................ 477

    21.4. .................................................... 484

    21.5. ..................................... 487

    22 , ................................................. 49022.1. , , ........... 492

    22.2. , ............................................................................................................................................... 494

    22.3. ................................................................................................................. 496

    22.4. ............................................................................................................................ 507

    22.5. ................................................................................................... 513

    22.6. ........................................................................ 518

    22.7. ......................................................................................................... 520

    23 ..................................................................................................................... 52423.1. ............................................................................................................ 524

    23.2. ...................................................................................................................................... 529

    23.3. ........................................................................................................................ 539

    23.4. ................................................................................ 543

    23.5. ............................................... 545

    24 ............................................................................................................ 55124.1. ......................................................................................................................... 552

    24.2. ............................................................................................................ 553

    24.3. .......................................................................................... 559

    24.4. ........................................................................................................ 566

    24.5. .......................................................................................................... 568

    25 ............................................................................... 57225.1. ...................................................... 573

    25.2. ............................................................................................ 576

    25.3. ? ............................................................................................................ 583

    25.4. ................................................................................................ 588

  • XI

    25.5. .................................................................................................................................................... 590

    25.6. : ........................................................................... 591

    26 ................................................................................ 59526.1. ........................................................................................................................................................... 596

    26.2. ............................................................................................................................................................ 602

    26.3. ......................................................................................................... 611

    26.4. ............................................................................................................................................... 616

    26.5. ......................................................................................................................................................... 625

    26.6. ............................................... 626

    26.7. # , # ............................................................................................ 629

    VI 27 ...................................... 634

    27.1. ......................................................................................................... 635

    27.2. ................................................................................................ 636

    27.3. ................................ 636

    27.4. ........................................ 638

    27.5. ......................................... 639

    28 ........................................................................... 64528.1. ............................................................................. 646

    28.2. .................................................................................................. 649

    28.3. ................................................................................. 655

    28.4. ................................................................................................................................................ 661

    28.5. ..................................................................... 664

    28.6. ........................................................................................................... 670

    29 ............................................................................................................... 67329.1. .................................................................. 673

    29.2. ? .............................. 675

    29.3. ....................................................................... 678

    29.4. ........................................................................... 686

    30 ....................................................................... 69430.1. ................................................................................. 695

    30.2. ....................................................... 695

    30.3. ............................................. 700

    30.4. ................................................................................................................... 704

    30.5. ....................... 705

    30.6. .................................................. 707

    VII 31 ...................................................................................... 712

    31.1. .................................................................... 713

    31.2. ...................................................................................................... 720

    31.3. ............................................................................................................. 721

  • XII

    31.4. ............................................................... 728

    31.5. ................................................................ 736

    31.6. ..................................................................................................... 747

    31.7. ...................................................................................................................... 750

    31.8. ......................................................................................................... 752

    32 ............................................................................ 76032.1. ............................................................................................................... 760

    32.2. ........................................... 761

    32.3. ? ............................................................. 764

    32.4. .................................................... 768

    32.5. ................................................................................................ 774

    32.6. IEEE .................................................................................................................................... 795

    33 ................................................................................................................... 80033.1. ? ................................................................................................................... 801

    33.2. ............................................................................................................ 802

    33.3. ......................................................................................................................................... 803

    33.4. ............................................................................................. 806

    33.5. ................................................................................................... 809

    33.6. ........................................................................................................ 809

    33.7. ................................................................................................................................................................. 810

    33.8. , , ..................................................... 811

    33.9. .................................................................................................................................................. 813

    34 ................................................................................................ 81734.1. ........................................................................................................... 817

    34.2. ................................................................................ 819

    34.3. ............................................................................................................................................. 821

    34.4. , ....................... 823

    34.5. .................................. 824

    34.6. ..................................... 825

    34.7. ............................................................................................ 827

    34.8. , ...................................................................... 830

    34.9. ................................................ 831

    35 ....................................................... 83435.1. ......................................................................... 835

    35.2. ................................................................. 836

    35.3. ............................................................................................................ 838

    35.4. .............................................................. 839

    35.5. ...................................................................................... 841

    ................................................................................................................. 842

    ................................................................................................. 863 .......................................................................................................................... 868

  • , , . % .

    (Fred Brooks)

    # , , # . # , .

    , # . , # , #. , , 1970# . # , , # . , # 5 15 (Raghavanand Chand, 1989; Rogers, 1995; Parnas, 1999). .

    ? , , # . # , , , , # . , .

    , # . # , , , ##.

    . . , , , ( ), , , # .

  • XIV

    - , . 50 000 (BLS, 2004, Hecker 2004), , # , 35 000 (NCES, 2002). # , . ## , , , , # , # , . , # .

    , , # , , #, . , # , , #. . . , . , .

    ? . , (Hildebrand, 1989; McConnell, 1997a). , # , , #, # , . , .

    , , , # . , Introduction to Java, Advanced Java Advanced Advanced Java ? Intel Motorola, Microsoft Windows Linux , . #, . # , . # , # .

    , , , #. , # . , # .

  • XV

    , .

    # , #. , # , , , . , # . , # .

    # , , #, , , , #, .

    , . , , # .

    # , , . # , , . , , # , # .

    1 # 10 . . , , .

    # , C++, C#, Java, Microsoft Visual Basic .

    500 . , . , .

  • XVI

    , # . # , , , .

    , # , , . , . , . # , .

    # , . # , , .

    Web' , , Web# Web# cc2e.com. , Code Complete, 2d ed., cc2e.com/

    , . , # .

    ? , , . Computer Scienceand Technology Board , # (CSTB, 1990; McConnell, 1997a). , # .

    . , #, . # .

    , , # #, . # , , , # .

    , , # , # , # . .

    65% 50% . 75% #

    http://cc2e.com/1234

  • XVII

    50 75% . , , # , ( 27).

    , , , , # , . , # , , , # . #, , , (Weinberg, 1983; SEN, 1990). # , .

    , , . , , , . , # , # .

    , , # . #. , # . 15 # , ALGOL, PL/I, Ratfor Smalltalk. # , . #, , , . # , , # .

    , , #, , . # , ## #. , , , # . # , .

    , , , . [email protected] Web# www.stevemcconnell.com.

    , 30 2004

    -, , - . , - , - .

  • XVIII

    Microsoft Learning Technical Support , , . Microsoft Press :http://www.microsoft.com/learning/support/

    Microsoft , :

    http://www.microsoft.com/learning/support/search.asp

    , , Microsoft Press :

    Microsoft PressAttn: Code Complete 2E EditorOne Microsoft WayRedmond, WA 98052%6399

    :

    [email protected]

    :

  • 1 ! XIX

    ( ), #.

    , : (Hkon gstsson), (Scott Ambler), (Will Barns), . (William D. Bartholomew), (LarsBergstrom), (Ian Brockbank), (Bruce Butler), # (Jay Cincotta), (Alan Cooper), (Bob Corrick), # (Al Corwin), (Jerry Deville), (Jon Eaves), # (Edward Estrada), (Steve Gouldstone), (OwainGriffiths), (Matthew Harris), (Michael Howard), (Andy Hunt), (Kevin Hutchison), (Rob Jasper), (Stephen Jenkins), (Ralph Johnson) , (MarekKonopka), (Jeff Langr), (Andy Lester), (MiticaManu), (Steve Mattingly), (Gareth McCaughan), # (Robert McGovern), (Scott Meyers), (Gareth Morgan), (Matt Peloquin), (Bryan Pflug), (Jeffrey Richter), (Steve Rinn), (DougRosenberg), # (Brian St. Pierre), (DiomidisSpinellis), (Matt Stephens), (Dave Thomas), # (Andy Thomas#Cramer), (John Vlissides), (Pavel Vozenilek), (Denny Williford), (Jack Woolley) (Dee Zsombor).

    , . , , .

    Construx Software, # : (Jason Hills), # (Bradey Honsinger), (Abdul Nizar), (Tom Reed) # (Pamela Perrott). , , , . , Web# cc2e.com.

    (Devon Musgrave) # . ,

  • XX

    . , ! (Linda Engleman), # . # Microsoft Press, (Robin Van Steenburgh), (Elden Nelson), (Carl Diltz), (Joel Panchot), (PatriciaMasserman), (Bill Myers), (Sandi Resnick), # (Barbara Norfleet), (James Kramer) (PrescottKlassen).

    Microsoft Press, : (Alice Smith), (Arlene Myers), (Barbara Runyan), (Carol Luke), (Connie Little), (Dean Holmes), (Eric Stroo), # (Erin OConnor), (Jeannie McGivern), (Jeff Carey), (Jennifer Harris), (Jennifer Vick), (Judith Bloch), (Katherine Erickson), (Kim Eggleston), (Lisa Sandburg), (Lisa Theobald), (Margarite Hargrave), (Mike Halvorson), (Pat Forgette), (Peggy Herman), (Ruth Pettis), (SallyBrunsman), (Shawn Peck), (Steve Murray), (WallisBolz) (Zaafar Hasnain).

    , , # : (Al Corwin), (BillKiestler), (Brian Daugherty), (Dave Moore), (Greg Hitchcock), (Hank Meuret), (Jack Woolley), # (Joey Wyrick), (Margot Page), (Mike Klein), (Mike Zevenbergen), (Pat Forman), (Peter Pathe), . (Robert L. Glass), (Tammy Forman), (Tony Pisculli) (Wayne Beardsley). (Tony Garland) : 12 , # .

  • XXI

    ................................................................................................................................................................................................................. 42

    ............................................................................................................................................................................................................ 54

    ....................................................................................................................................................................... 59

    ................................................................................................................................... 69

    .............................................................................................................................. 122

    ............................................................................................................................................................................................ 157

    ........................................................................................................................................................... 185

    ......................................................................................................................................................... 211

    .................................................................................................................. 233

    ............................................................................................................................. 257

    ..................................................................................................................................................................... 288

    .......................................................................................................................................................................................... 316

    .............................................................................................................................. 343

    .................................................................................................................................. 353

    ................................................................................................................................... 365

    .......................................................................................................................................................................................................................... 388

    ........................................................................................................................... 410

    ........................................................................................................................................................................................ 429

    ................................................................................................................................. 459

    ......................................................................................................................................................................... 476

    ........................................................................................................................ 484

    ..................................................................................................................................................................... 491

    ............................................................................................................................................................................................................................. 532

    ...................................................................................................................................................................................................................... 559

    ......................................................................................................... 570

    ..................................................................................................................................................................................... 577

    ..................................................................................................................................................................... 584

    .......................................................................................................................................................... 607

    ........................................................................................................................................................... 642

    .............................................................................................................................................................. 669

    ............................................................................................................................................................................................................ 707

    ............................................................................................................................................... 724

    ............................................................................................................................................................................................. 773

    ........................................................................................................................................................ 780

    .................................................................................................................................. 816

  • I

    1. !

    2. ,

    3. , :

    4. ,

  • 2 I

    1

    !

    1.1. ?

    1.2. ?

    1.3.

    ? (. )

    , ? (. )

    ? (. )

    : , , . . # . # , #, #.

    1.1. ? , #. # 25 :

    ;

    ;

    ;

    , ;

    ;

    ;

    http://cc2e.com/0178

  • 1 ! 3

    ;

    ;

    ;

    ;

    .

    , , . #, ! # .

    , , , . , , , # , .

    , . : #, . . 1#1 .

    . 1'1. . , , ,

    , , , # , , , #

  • 4 I

    . # , . , . , # , # .

    . , # , # . , #.

    . 1#1 ; # . 1#2.

    . 1'2. , , , , , %

    . 1#1 1#2 #. ? , # :

    , ;

    ;

    ;

    ;

    ;

  • 1 ! 5

    , # ;

    ;

    ;

    , ;

    , , .

    , .

    , : , ? . , , , # , , . , #, , # . , 35.

    1.2. ? , # . # : # , , . , # , .

    , : ?

    .

    ' # 3080 % ., , .

    ' , . ( #) #. .

    - , -, . - 27.5.

  • 6 I

    ' # , , # #

    1020 (Sackman, Erikson, and Grant, 1968). (Curtis, 1981; Mills,1983; Curtis et al., 1986; Card, 1987; Valett and McGarry, 1989; DeMarco and Lister,1999; Boehm et al., 2000). #, .

    ' # . # , , . # , # 1 . # .

    , # #

    . #, . # , # . # # . # , ? # , # .

    1.3. . , 2. # 6 , . , , 3.2.

    1 , () [Goldberg, Rube (Reuben Lucius)] (18831970) #, . , # (inventions) . # 1948 . . . .

    - - . - 28.5.

  • 1 ! 7

    ,

    .

    : , ,, ( ).

    .

    .

    , . .

  • 8 I

    2

    ,

    2.1.

    2.2. ?

    2.3. ,

    :

    5.1

    . , # , , , , # ?

    #. , .

    . , . , .

    2.1. . # , , , . #.

    , . , # , . , , , . # (Barbour, 1966).

    http://cc2e.com/0278

  • 2 , 9

    , , , .

    . , ( #), ( ) . , # , , , . , . , .

    . , . ; , # . # .

    , . , , # .

    , , , . , , . , , . , , .

    . # , , , , , , . . , , # . , # , .

    . 1973 ., (Charles Bachman) # . 1400 . , 1543 ., , , # , . # , # .

  • 10 I

    # , 1970#. , . , , # (#). # , # (, ).

    , , . # , , # . , #

    # . , , .

    , # . # # , , .

    . : , . ! # , . # . , , .

    , , . , , , # .

    . , . . ., , .

    2.2. ?, , #, . , , .

    , .

    - . - -: - . , - -. - , - - .

    . (Fernando J. Corbat)

  • 2 , 11

    , . , . , , , .

    , . , , , . , # ; . # . , # 30# .

    , # : 167 . #, 4,5 . , # . 714, , .

    : . , #. , #, . # # . , #, .

    , # #. # . . , .

    , #, , . , , . # , # . , #, . , , # .

    , ? , , # . , , , . , , # , , .

    - . - - 5.1.

  • 12 I

    2.3. ,

    , , . , (Gries, 1981). (Knuth, 1998). , (Humphrey, 1989).. . , # , (Plauger,1993, Beck, 2000). (Cockburn,2002), (Raymond, 2000), (Andy Hunt) (Dave Thomas) , (Heckel, 1994). , , (Brooks, 1995). # ?

    : , , # . # : , , # . #, , , .

    . (Jon Bentley), #, , , . . . The Elements of Programming Style(Kernighan and Plauger, 1978), The Elements of Style (Strunk and White, 2000). .

    # , . #

    , . , # . , . , # . # , 90 % (Pigoski, 1997). . # , # , . , , , # , .

  • 2 , 13

    , # The Mythical Man#Month( #) (Brooks, 1995). : # : . , (. 2#1).

    . 2'1. , ,

    , # . # , 10# ., , # . # , # # . .

    : , . # , , , . # , # .

    . # . # ,

    .

    : - .

    c

    , .

    (Craig Zerouni)

  • 14 I

    , , # , , . # #. (. 2#2) ,

    , . C++ , # .

    , . , , .

    . 2'2.

    : , , , (accretion). , #. . .

    , # ; , # . , , , , #

    . , .

    #, . #, , , ,

    - -, - , . - On the Origins of DesignerIntuition Rethinking Sys-tems Analysis and Design (Wein-berg, 1988).

    - . 29.2.

  • 2 , 15

    . # . , .

    , . . , , . , . # , .

    #. , 1975 . , , , # #, , (Brooks, 1995). Principles of Software Engineering Management (Gilb, 1988), # (evolutionary delivery) # (agile programming). (Beck, 2000; Cockburn, 2002; Highsmith, 2002; Reifer, 2002; Martin, 2003;Larman, 2004).

    , #. , , # . , , , .

    : , # , # . #

    , , # . .

    , 10 , 100 100 . # .

    , , , , , , . # , : (. 2#3). , , . # . 1000 , , # .

  • 16 I

    . 2'3. , , , ,

    , . , # , . , . # . , , , , # . , # , , . . , , , #, , . .

    , . , # , . 15 , , , # . # , , # (. 2#4). , # , , , # . , , .

  • 2 , 17

    . 2'4.

    ? , . # , , , , . , . , . , # #, , # . , .

    #, , , . # , . . # . # # # , # .

    , , . , , . , # # , # .

    . # , # , , # . . . , . #

  • 18 I

    , # .

    , . , # , # , . , # , # , # .

    . # 15 , . # , .

    , # . # , . . ; 10 % , # . , . , # , 15 . # , .

    , , . , 69 (Jones, 1998). 40005000 , 2 3 . , , .

    # , # .

    # # , . # #, , (scaffolding), # . ,

    .

    - - - . WhatSupports the Roof? (Starr 2003).

  • 2 , 19

    :

    , , , . , .

    . . , # .

    # # . , , , # . , . , .

    , , . #, . ,

    , , , . , .

    . , . # , . , , # .

    , , # , The Structure ofScientific Revolutions (3d ed. Chicago, IL: The University ofChicago Press, 1996) (Thomas S. Kuhn). , 1962 ., , . , , #, , .

    - . 5.3.

    http://cc2e.com/0285

  • 20 I

    The Paradigms of Programming. 1978 Turing Award Lecture (Communicationsof the ACM, August 1979, pp. 45560) . (Robert W. Floyd) # # ; .

    , ,

    .

    , #, .

    , .

    # # .

    # , # . .

    . , # .

  • 2 , 21

    3

    , :

    3.1.

    3.2. ,

    3.3. ,

    3.4. ,

    3.5. ,

    3.6. ?

    , :

    4

    # : 27

    : 20

    : 28

    : 5

    , #, , . , ##, , , .

    . , # . , .

    http://cc2e.com/0309

  • 22 I

    , , 65% . # , . , .

    , . # #, 5. # , 3.2, , , 3.1, # , .

    3.1.

    , # , # , , .

    , # . #

    , , # , . , ; # .

    , , # .

    , #, . # , , # #. , #, . # .

    , # . # , # , , . , , .

    - - . (. 20.5).

  • 3 , : 23

    ? , , , , . # , # ( . ). # , . # , , 1970#, , .

    : , #

    . , # , .

    , # # (. 3.2).

    , , #. , .

    , . , # #, # # , . # , , : #, ! , # , # .

    , # , # . , .: . , #

    . - - - .

    (Harlan Mills)

    http://cc2e.com/0316

    - - , - , . 16 Professional Software Deve-lopment (McConnell, 2004).

  • 24 I

    . : , . , . .

    , # , , # . : , (Barry Boehm), (Grady Booch) (Karl Wiegers), # 25 , , , , , ...

    , # # . , : , #. , , , . , , #

    , # 100 #. , #, : ? ! # # , , # , # , , : .

    WISCA WIMP: Why Isnt Sam CodingAnything? ( ?) Why Isnt Mary Programming ( )?

    , : ,! ( , ? .) , . #, . #, .

    #, , . # # . #. , # !

    #, . , # . # .

    , . # (BLS, 2002), # , .

    . The Psy-chology of Computer Program-ming (Weinberg, 1998).

  • 3 , : 25

    , , , # . , , , .

    # . , . #

    , . # , .

    #, . . # , , , . # , # . # , , , . , , , , .

    , # . # .

    , . , , . # .

    , . , . . . . ., . .

    . , , # .

    . # , # . . # , , # .

  • 26 I

    , , # . : , , . , , #. ? .

    # #, . , , , , # . . #, , , # .

    25 # , .

    Hewlett#Packard, IBM, Hughes Aircraft, TRW , # 10100 , #

    , (Fagan, 1976; Humphrey, Snyder, and Willis, 1991; Leffingwell 1997; Willis et al., 1998;Grady, 1999; Shull et al., 2002; Boehm and Turner, 2004).

    : . # , . #, , , # . , , , # , , . .

    # (. 3#1):

  • 3 , : 27

    . 3-1.

    1 3 510 10 10100

    # 1 10 15 25100 #

    # 1 10 1025

    : Design and Code Inspections to Reduce Errors inProgram Development (Fagan 1976), Software Defect Removal (Dunn, 1984), SoftwareProcess Improvement at Hughes Aircraft (Humphrey, Snyder, and Willis, 1991), Calculatingthe Return on Investment from More Effective Requirements Management (Leffingwell,1997), Hughes Aircrafts Widespread Deployment of a Continuously Improving SoftwareProcess (Willis et al., 1998), An Economic Release Decision Model: Insights into SoftwareProject Management (Grady, 1999), What We Have Learned About Fighting Defects (Shullet al., 2002) Balancing Agility and Discipline: A Guide for the Perplexed (Boehm andTurner, 2004).

    , , , , # $1000, # $15 000 (. 3#1).

    . 3'1. . ( 100% ), ( 5%)

  • 28 I

    # . 3#1, , 50% #

    (Mills, 1983; Boehm, 1987; Cooper and Mullen, 1993; Fishman, 1996; Haley,1996; Wheeler, Brykczynski, and Meeson, 1996; Jones, 1998; Shull et al., 2002; Wiegers,2002). , # (McConnell, 2004). .

    , # , # , .

    ?

    , .

    , # .

    , #, .

    . , .

    , , .

    3.2. ,

    20 , , # Software Productivity Research, , 40 , 50 # 30 , #, 700 (Jones, 2003).

    #. , . , # (. 3#2):

  • 3 , : 29

    . 3-2.

    ,

    -

    #. . . . . .

    # #. # . . . . .. Web#. . # . .

    . . (

    , . . Scrum, # . . . .)...

    # # . .

    # # . . #. . . # . . .

    .

    # # . .

    . # . .

    (. . .)

  • 30 I

    . 3-2. ()

    ,

    -

    . .

    . # # . . # . .

    # .

    # # # # # #

    . . . # # # . . # #. . .

    # # . . # .

    . . # . # . . . .

    # # . . .

    , # , , . # # , , # , # . , , , .

    # , # , . #

  • 3 , : 31

    , # . . 3#3, , # . # , #; , . , (. 3#1). , # . . 3#3 3#4 # , , .

    . 3-3.

    1: 2:

    20% $100 000 $0 $100 000 $75 000

    40% $100 000 $0 $100 000 $75 000

    60% $100 000 $0 $100 000 $75 000

    80% $100 000 $0 $100 000 $75 000

    100% $100 000 $0 $100 000 $75 000

    # $0 $500 000 $0 $0

    $500 000 $500 000 $500 000 $375 000

    $1 000 000 $875 000

    . #, # , . # , , , # , .

    #, , . , # , , .

  • 32 I

    (. 3#4). , # , , , # .

    . 3-4.

    3: 4:

    20% $100 000 $20 000 $100 000 $10 000

    40% $100 000 $20 000 $100 000 $10 000

    60% $100 000 $20 000 $100 000 $10 000

    80% $100 000 $20 000 $100 000 $10 000

    100% $100 000 $20 000 $100 000 $10 000

    # $0 $0 $0 $0

    $500 000 $100 000 $500 000 $50 000

    $600 000 $550 000

    , , . # 100% #

    , # .

    , # 80% , # # ,

    . : 20% , # (. 3#2 3#3).

    - - . 27.

  • 3 , : 33

    /

    . 3'2.

    /

    . 3'3. .

    , , (. 3#2), , , # . ( ), :

    ;

    ;

    ;

    ;

  • 34 I

    ;

    , .

    ( ) , :

    , # ;

    , ;

    ;

    ;

    ;

    , .

    , , #. # , , # . # ( ) 27.

    , , . , # , . # ; , #, , , .

    , . 3#2, , , , , .

    3.3. ,

    , , #, . # , #, #. #. #, , , , ,

    .

    , , - .

    (AndyHunt and Dave Thomas)

  • 3 , : 35

    # . , . Gigatron # #. # , Gigatron . , .

    , (. 3#4).

    . 3'4.

    , , # . , . , # . . , , : . . , , .

    , #: , # . , .

    , (. 3#5).

  • 36 I

    . 3'5. , , ,

    # . , .

    3.4. ,

    , , . , , , , , .

    ? .

    , # , . , . # , #. , .

    , . . # #, , .

    # . , , .

    , # , . , , # , , . #, , . , , , .

  • 3 , : 37

    , , , # , # , #

    , , , (. 3#1). , # , 510, # 10, 10100 . # 510, 100 (Boehm and Turner, 2004). , , # .

    #, , , (. 3#6). # , , , , , # , .

    . 3'6. , ,

    . #, , , . ! , # 100 # , # .

    , , , . , , . , . : , ; . #

    . - , .

  • 38 I

    , (Curtis, Krasner and Iscoe, 1988; Jones 1998;Wiegers, 2003). , .

    ? , IBM , , # 25% (Boehm, 1981;

    Jones, 1994; Jones, 2000), 7085% (Leffingwell, 1997; Wiegers, 2003).

    , , # , , #, . , , . # , #, .

    ?

    # .

    , , # , . , , . # , #, ? . , .

    , , . , # , , #, , #. ,: , ! #, , , . , , # .

    , , # , . # .

  • 3 , : 39

    , . , , , . , , . : , # , , .

    , ' # # . # (evolutionary prototyping) # . # . # , , , #. , # .

    #, . , . , , #. , , .

    ' # . , , , . , # , , # .

    :

    , - . , . , , .

    . , -. , .

    - . - 5.4 29.3.

    http://cc2e.com/0323

    , , . 28.2.

    - , - , . Rapid Development(McConnell, 1996).

    - - (- - ) . 27.

  • 40 I

    , , , - .

    -

    , , ? -

    , , , ? Web-, . .? ?

    , ? , ? , , , -

    ?

    ( ) -

    ? ,

    , ? ? , , -

    , , , ?

    ?

    , -, ?

    ? ?

    , ?

    ? ? --

    , -?

    ? ? -

    ? ? ,

    ? ? ?

    ?

  • 3 , : 41

    ? , , ?

    - ?

    ,

    ? , -

    , ? - ?

    , ?

    3.5. ,

    #, , (Buschman etal., 1996; Fowler, 2002; Bass Clements, Kazman 2003; Clementset al., 2003). #, . #, , # . : # , # , , .

    , , #, , . , , # , .

    # ? # ,

    . , #. , # . , # .

    . . , , # . 3#7.

    - . 59.

  • 42 I

    . 3'7. , , .

    # . , , , #

    , . . (Basili and Perricone, 1984; Willis, 1998). , # . , , .

    . # , .

    . , # , . , # , .

    # . # . # 12 , # . 12 #

    , , , , .

    , , . , . ,

    - ,, -.

    - - . 59.

  • 3 , : 43

    , # . , , (Rombach, 1990).

    . # , . # /, #, , Web#, , # . , , . , # , .

    # . . , #, .

    # . , , , # .

    #, # . , # . , # .

    . # . 80/20: 20% , 80% (Jacobsen, Booch,and Rumbaugh, 1999; Kruchten, 2000).

    . # . # #

    - - - . - 5.2.

    - , - -, . . - ( ) 5.3.

    - . 6.

    - . 1013.

  • 44 I

    , , , , #. # , , #. , # .

    # ; , , #. . ( # ) 5.3.

    . , #, ( ), , # , , , , , . .

    -, #, . ##, 30 . #, .

    (GUI) #. , #. Web#, GUI, . . GUI # .

    , GUI , # # , . #, # . ; # , .

    GUI , .

    , , . , # , #

    http://cc2e.com/0393

  • 3 , : 45

    , #. , # . , # . ,, . , , .

    . , . # , (, , cookie, # #), , , , # , .

    #. , , , # .

    , #. , . # , #. , , # .

    #. , , , , , . . , .

    # , , .

    http://cc2e.com/0330

    - . Writing Secure Code,2d Ed. (Howard and LeBlanc 2003) IEEE Software 2002 .

    - - . Performance Engineering ofSoftware Systems (Smith, 1990).

  • 46 I

    / # . internationalization # I18n, . ( L10n ) # .

    . # , , #, . ., , . , # , #, , # (ASCII, DBCS, EBCDIC, MBCS, Unicode, ISO 8859 . .) ( C, Visual Basic . .), , , , # GUI. , # . , .

    -# , # . : , . , , ##: , , .

    #, . 90% #

    , . ., , 10% # (Shaw in Bentley, 1982). , # .

    , . , . , .

    ? # . . , # .

  • 3 , : 47

    ? (, , ) , (, # ). # GUI.

    ? , # , , , (#) # .

    ? , GUI # , . , .

    ? , , , # , . .

    ? , # .

    # ? , # ? # , ?

    , , ? # , , # .

    #. , # , , , , .

    , # .

    # . , # , , .

    , - , -. . 8.

  • 48 I

    , # . , , # .

    . , # . # ,

    . # , # .

    , # .

    # . . , . , .

    , , # . #, . # , , : , . # .

    # . # , . , , , , , #. , ; , , . , # .

    , , . , , , .

    - - . - IEEE Soft-ware 2001 . , , .

  • 3 , : 49

    ? , # . # GUI, , , #, , , . # GUI# #, : #, , , , . .

    , # , , , # .

    , , . ., , # , # .

    , # , # . # , , , . . , . , .

    . , . # , # , , # . # : , # , , . . , # , # .

    - . - - 30.3.

    - . 28.2.

    , - .

    . (Ferrnando J. Corbat)

  • 50 I

    , . , #, if , . # , #

    , .

    , #, , .

    , . # , #

    , , (Brooks, 1995). #. , , . , .

    , . # . # , # , .

    . , # , , , .

    . # . . # , # . , , #, , , . ? : , . # . : , . . : , . , .

    , . , , # , . , .

    , , . - 5.3.

    - . 20.1.

  • 3 , : 51

    . , ; . , .

    , # .

    . , , . . , # , # (Kruchten, 1995).

    , . # , #. , . , ?

    :

    . - , . . - , - , - .

    ? -

    ? ,

    ? , , -

    , , ? ? ? ? -?

    ? GUI? GUI ,

    ? - ?

    http://cc2e.com/0337

  • 52 I

    , , , , ? -?

    ?

    , ? ? ? /? ? ( )? ? ?

    ? , -

    ? ?

    ? - -

    ? ? ? ,

    ? ? , -

    , ?

    3.6. ?

    , , # , . , # , , 1020% # 2030% (McConnell, 1998; Kruchten, 2000). # .

    , , , , , # . # .

    , - , . - - . 3.2.

  • 3 , : 53

    , , , #. , # .

    #, , # . , # , # . : #, , , . , . : ? : ?, #: , ? ? .

    , , , . , , # , . , , , , , . , .

    , , . , # . , . , # .

    , .

    .

    Wiegers, Karl. Software Requirements, 2d ed. Redmond, WA: Microsoft Press, 2003. , , , # , .

    Robertson, Suzanne and James Robertson. Mastering the Requirements Process. Reading,MA: Addison#Wesley, 1999. , # .

    Gilb, Tom. Competitive Engineering. Reading, MA: Addison#Wesley,2004. #

    - . - -? 3.4.

    http://cc2e.com/0344

    http://cc2e.com/0351

    http://cc2e.com/0358

  • 54 I

    , Planguage. , , , . Web# www.gilb.com.

    IEEE Std 830%1998. IEEE Recommended Practice for Software Requirements Specifications.Los Alamitos, CA: IEEE Computer Society Press. IEEE#ANSI . # , , # .

    Abran, Alain, et al. Swebok: Guide to the Software Engineering Bodyof Knowledge. Los Alamitos, CA: IEEE Computer Society Press,2001.

    . Web# www.swebok.org.

    .

    Lauesen, Soren. Software Requirements: Styles and Techniques. Boston, MA: Addison#Wesley,2002.

    Kovitz, Benjamin L. Practical Software Requirements: A Manual of Content and Style.Manning Publications Company, 1998.

    Cockburn, Alistair. Writing Effective Use Cases. Boston, MA: Addison#Wesley, 2000.

    , . # .

    Bass, Len, Paul Clements, and Rick Kazman. Software Architecture in Practice, 2d ed. Boston,MA: Addison#Wesley, 2003.

    Buschman, Frank, et al. Pattern%Oriented Software Architecture, Volume 1: A System ofPatterns. New York, NY: John Wiley & Sons, 1996.

    Clements, Paul, ed. Documenting Software Architectures: Views and Beyond. Boston, MA:Addison#Wesley, 2003.

    Clements, Paul, Rick Kazman, and Mark Klein. Evaluating Software Architectures: Meth%ods and Case Studies. Boston, MA: Addison#Wesley, 2002.

    Fowler, Martin. Patterns of Enterprise Application Architecture. Boston, MA: Addison#Wesley, 2002.

    Jacobson, Ivar, Grady Booch, and James Rumbaugh. The Unified Software DevelopmentProcess. Reading, MA: Addison#Wesley, 1999.

    IEEE Std 1471%2000. Recommended Practice for Architectural Description of Software%Intensive Systems. Los Alamitos, CA: IEEE Computer Society Press. # IEEE#ANSI .

    http://cc2e.com/0365

    http://cc2e.com/0372

  • 3 , : 55

    , # . # , .

    McConnell, Steve. Software Project Survival Guide. Redmond, WA: Microsoft Press, 1998. , # , , #. , # .

    Kruchten, Philippe. The Rational Unified Process: An Introduction, 2d ed. Reading, MA:Addison#Wesley, 2000. # # . Software Project Survival Guide, # , # , # . , Software Project Survival Guide Extreme Programming Explained:Embrace Change.

    Jacobson, Ivar, Grady Booch and James Rumbaugh. The Unified Software DevelopmentProcess. Reading, MA: Addison#Wesley, 1999. # , The Rational Unified Process: An Introduction,2d ed.

    Beck, Kent. Extreme Programming Explained: Embrace Change. Reading, MA: Addison#Wesley, 2000. , # . , .

    Gilb, Tom. Principles of Software Engineering Management. Wokingham, England: Addison#Wesley, 1988. #, . , # . , Software Project Survival Guide Extreme Programming Explained: Embrace Change.

    McConnell, Steve. Rapid Development. Redmond, WA: Microsoft Press, 1996. . # , , .

    Boehm, Barry and Richard Turner. Balancing Agility and Discipline: A Guide for the Per%plexed. Boston, MA: Addison#Wesley, 2003. # , .

    http://cc2e.com/0379

  • 56 I

    3: A Typical Day using PSP/TSP, A Typical Dayusing Extreme Programming, A Crisis Day using PSP/TSP A Crisis Day using ExtremeProgramming. 5 , , . 6 . # .

    Larman, Craig. Agile and Iterative Development: A Managers Guide. Boston, MA: Add#ison Wesley, 2004. # Scrum, ExtremeProgramming, Unified Process Evo.

    :

    , -, ? -

    ? (. ).

    -? (. ).

    , , ?

    . #

    , , .

    , . # .

    # , .

    , : # , .

    # .

    , # . # 20100 , , # .

    http://cc2e.com/0386

  • 3 , : 57

    , # . #, .

    .

  • 58 I

    http://cc2e.com/0489

    4

    ,

    4.1.

    4.2.

    4.3.

    4.4.

    : 3

    , : 3.2

    : 27

    : 28

    : 59

    , # , , . 3 . , # , 3 , . , # . # # .

    , , 5.

  • 4 , 59

    4.1. , % . , %. , % , , . % .

    (Alfred North Whitehead)

    , , , # .

    , # # .

    , ., Cocomo II, , #, , , # 30% , , , (Boehm et al., 2000). , IBM, , , # , , (Walston andFelix, 1977). ( , # Cocomo II .)

    , , # , , . ,

    , C++, Java, Smalltalk Visual Basic, # , , # 515 , , C (Brooks, 1987; Jones, 1998; Boehm, 2000). # , # C , , . , # . # . . 4#1 C. , 1, , # , C.

  • 60 I

    . 4-1. C

    C

    C 1

    C++ 2,5

    Fortran 95 2

    Java 2,5

    Perl 6

    Python 6

    Smalltalk 6

    Microsoft Visual Basic 4,5

    : Estimating Software Costs (Jones, 1998), Software Cost Estimation withCocomo II (Boehm, 2000) An Empirical Comparison of Seven Programming Languages(Prechelt, 2000).

    , . , # , Java C++. # , (Sapir and Whorf) #, . # # , . , # , , (Whorf, 1956).

    ., , #, , , , .

    , # , . : # C++, C++. Fortran. , C++, Fortran. C++ Fortran ( goto ) # C++. (Hanson, 1984; Yourdon, 1986a).

    #. , .

    Ada , Pascal. # ,

  • 4 , 61

    , . Ada , . Ada (Ada Lovelace) #, . Ada , .

    , . # , Intel Motorola. # . , .

    C , UNIX. ( , # , ) . C , , , .

    C, 1970# Bell Labs, # DEC PDP#11. C , C UNIX DEC PDP#11. 1988 . C ANSI, # 1999 . . 1980# 1990# . C # #.

    C++ # C BellLabs 1980#. C, , , , #, C. , .

    C# # Microsoft. C# , # C, C++ Java, , # Microsoft.

  • 62 I

    Cobol 19591961 . # . Cobol ## , VisualBasic (Feiman and Driver, 2002). ## . Cobol COmmonBusiness#Oriented Language ( , # ).

    Fortran . # FORmula TRANslation ( ). 1950#, Fortran : , 1977 . # Fortran 77, if#then#else . Fortran 90 # , , , . Fortran # .

    Java # , Sun Micro#systems, Inc., C C++. Java # : # Java #, , . Java Web#.

    JavaScript Java. , , #, Web#.

    Perl C UNIX. Perl , # , . , Web#, Slashdot. Perl Practical Extraction and Report Language (# ).

    PHP , Perl, JavaScript, C Bourne Shell. PHP

  • 4 , 63

    , . PHP# Web# . PHP # Personal Home Page, PHP: Hypertext Processor.

    Python # # . Web#, , .

    SQLSQL (Structured Query Language, ) # # , . , , SQL , . . , # .

    Visual BasicBasic (Beginners All#purpose Symbolic Instruction Code, # ) , 1960#. Visual Basic # Basic, . Visual Basic Microsoft Microsoft Windows. # Microsoft Office , Web# . XXI Visual Basic # (Feiman and Driver, 2002).

    4.2. . # # . #, , , , .

    , , # . , . , # .

    - . - 11.311.5.

  • 64 I

    , , , . # , # . . : 5.2.

    , , # , , #? , . . .

    #. , .

    .

    4.3. , , . , GUI. , Web#. , , , , Web# (2004) . # , , #.

    Web# 2000# # . #, , #. . # , Web#. , UI, , ## . # . , .

    Web# 1990# # . , . # , . , #. . ,

  • 4 , 65

    . , # . , # UI, , # # # . # # . # , # .

    , , . , , Turbo Pascal,Lotus 123, Microsoft Word Mosaic. , , . # #. , , # # , , # , , # # . .

    , , , . (Gries, 1981), # . # (programming in language) % (programming into language). , , , # . , .

    , , , , , .

    Visual Basic, # , , #, GUI . , , , Visual Basic #, , # , , . C++, , .

    , .frm () , .

  • 66 I

    IsFormCompleted(), , . IsFormCompleted() , . #. , # , .bas.

    Visual Basic . .frm , # .frm .bas.

    , , , # . , , , , . , IsFormCompleted() . #, IsFormCompleted() .

    Visual Basic , # # .

    # .

    , . , . , , # .

    4.4. , # . # , . , .

    , , . .

  • 4 , 67

    : , -

    , ? , -

    ? , -

    ? , -, , , , - , . .?

    - ? , , , ?

    ? , -

    ?

    , ?

    ?

    ?

    ?

    ? ?

    ? , -

    ? (

    J2EE Microsoft .NET) ? , -

    ? , : ,

    , , . .? ?

    http://cc2e.com/0496

    - 20.

    - . 30.

  • 68 I

    . #

    .

    . .

    , . , #.

    , . , , .

    # . # .

  • 4 , 69

    II

    5.

    6.

    7.

    8.

    9.

    CC2_Part2_ch5_2010.indd 69 22.06.2010 12:31:11

  • 70 II

    5

    5.1. ,

    5.2.

    5.3. :

    5.4.

    5.5.

    : 3.5

    : 6

    : 7

    : 8

    : 24

    : 27

    , -, , . - # , . , - , , .

    . - - .

    http://cc2e.com/0578

    - , - , . - 27.

    CC2_Part2_ch5_2010.indd 70 22.06.2010 12:31:31

  • 5 71

    . - . , , , , .

    , . - , , , (. 3.5). , 6 7.

    , - 5.1, -, 5.3, .

    5.1. ,

    - . , . . - .

    # .

    - , (Rittel and Webber, 1973). , - , , . - (Peters and Tripp, 1976).

    - Tacoma Narrows. , - . Tacoma Nar-rows , -

    - - . 2.

    , - - - , . , , -. - , , . - , , -, , .

    - (David Parnas and

    Paul Clements)

    CC2_Part2_ch5_2010.indd 71 22.06.2010 12:31:31

  • 72 II

    . 1940 . , (. 5#1).

    : , . (- ), , , .

    . 5'1. Tacoma Narrows

    , , , , -, , , -, , . , . , , , . .

    ( ) , , - .

    CC2_Part2_ch5_2010.indd 72 22.06.2010 12:31:31

  • 5 73

    , -, . . . : , . , # .

    , , . ? - , ? ? -, : .

    , , , . - . , , . , .

    , . , , - , . . , . .

    , , -. , .

    . A Ratio nal Design Process: How and Why to Fake It (Parnas and Clements, 1986).

    . - - ? 5.4.

    CC2_Part2_ch5_2010.indd 73 22.06.2010 12:31:32

  • 74 II

    , , . . # , , - , . - . , , . .

    -, , . - . , , .

    - . , , - .

    5.2. . , - .

    : -

    , - No Silver Bullets: Essence and Accidents of Software Engineering (Brooks, 1987).

    , . , , . - , , . , # , .

    () , , , . , , - .

    http://cc2e.com/0539

    -, . ; . How Buildings Learn (Brand, 1995).

    - . 34.1.

    CC2_Part2_ch5_2010.indd 74 22.06.2010 12:31:32

  • 5 75

    , . , , .

    , - . , , , . , - , , , , . -, .

    , . , . - , , , . . , , , # . , , .

    , .

    . , . # , . , , # , . , , , .

    . #, , # .

    . - ,

    - , (. 4.3).

    : , , , , .

    . . . (C. A. R. Hoare)

    CC2_Part2_ch5_2010.indd 75 22.06.2010 12:31:32

  • 76 II

    , , , 1 109, (Dijkstra, 1989). . : . -, , . , 1989 . , 15 .

    , -, (Dijkstra, 1972), . - , . , - . : - , , - .

    , . , . . , - . , . .

    -. , , - .

    , , - , .

    ?

    :

    ;

    , ;

    .

    , -, - , -. - , - , .

    . . (P. J. Plauger)

    CC2_Part2_ch5_2010.indd 76 22.06.2010 12:31:32

  • 5 77

    , -, , , , . , :

    , # ;

    .

    , - , - .

    . , . - , . - , . . , .

    .

    - . : , . - . - , .

    , -, . , . , .

    (loose coupling) . - , . , - .

    , , . - . .

    , - . -. - , , .

    . (R. Buckminster Fuller)

    - (. 20.1).

    CC2_Part2_ch5_2010.indd 77 22.06.2010 12:31:32

  • 78 II

    , .

    (fan#in) . , - .

    , . (fan#out) ( ) , , , . , , (Card and Glass, 1990; Basili, Briand, and Melo, 1996).

    , - .

    , - (Wirth, 1995; McConnell, 1997). , , , . , - , , , . , . : ?

    -, . , , .

    , , - , , , . , ,

    . - . : 1) 2) # , .

    - , . , - .

    . - 24.5.

    - - . - - 5.3.

    CC2_Part2_ch5_2010.indd 78 22.06.2010 12:31:33

  • 5 79

    . , # (. 5#2).

    . 5'2. . (1) (2), (3), (4); (5)

    1:

    . - , , .

    2:

    .

    - , , - .

    (Douglas Adams)

    CC2_Part2_ch5_2010.indd 79 22.06.2010 12:31:33

  • 80 II

    , , GUI, # , . . - . , . -: , . . 5#2 2.

    -. , . , .

    , (. 5#3). # . (. 5#4).

    . 5'3. ,

    . 5'4. , -

    , , :

    -, # ?

    CC2_Part2_ch5_2010.indd 80 22.06.2010 12:31:33

  • 5 81

    , # ?

    , - (, , )?

    , - ?

    . , - . , . , .

    , . , -. : , , - . . 5#5 , , . 5#4.

    . 5'5. , -

    , - . , . , . .

    : , . 5#5, . , , A B, B C, C A.

    - . ,

    CC2_Part2_ch5_2010.indd 81 22.06.2010 12:31:34

  • 82 II

    , , .

    . , .

    ' # , , , . , # - ,

    . , , . . .

    - , . , , GUI, , , , . .

    , - #. , , - , . , - .

    , -. , , Microsoft Windows, Windows? Windows - , Mac OS Linux, . , , .

    3:

    . , - , . . 5#2 , 2; , .

    - - . 18.

    - - Agile Data base Techniques (Ambler, 2003).

    CC2_Part2_ch5_2010.indd 82 22.06.2010 12:31:35

  • 5 83

    , , . , .

    -, . , . .

    # . - , . , , . , Person (), , , , . . nancy, hank, diane, tony . . , . , . - , . .

    4:

    . 3, - . 4 . , .

    , , . . - 3.

    , . , - .

    5:

    , , . , , , - .

    - . 6.

    - - . 7 8.

    CC2_Part2_ch5_2010.indd 83 22.06.2010 12:31:35

  • 84 II

    , . . 5#2 5.

    5.3. :

    : A, B C, - X, Y Z. , -, , , , . , . .

    , - - . , . - . , . - .

    , , # - .

    -:

    ( );

    , ;

    , ;

    , , . . ;

    .

    -. .

    . , , , , (. 5#6).

    , , !

    (Bertrand Meyer)

    - . 6.

    CC2_Part2_ch5_2010.indd 84 22.06.2010 12:31:35

  • 5 85

    . 5'6. ( )

    , . , . , , /, . , , / , . .

    GUI , , - . , , .

    , - . , . .

    , . - , , (containment) . (?) ? (-?) ? . 5#6 , -. , , , . - .

    , , , , . , .

    CC2_Part2_ch5_2010.indd 85 22.06.2010 12:31:35

  • 86 II

    - . , , . , ,

    . , - .

    # - , : , - , , .

    , . , . , , , . - , .

    , . -, , . , .

    , , - . . , , , , , , - . , . - , .

    . , , , , . (. 5#7).

    . ( -) 5.3.

    CC2_Part2_ch5_2010.indd 86 22.06.2010 12:31:35

  • 5 87

    . 5'7.

    , # -. , .

    -, ( , , ), .

    , . : . : , .

    : , , , . - , , , , ( , , ), .

    , (. 5#8). 6.2 .

    . 5'8. , . , !

    - - . - 6.2.

    CC2_Part2_ch5_2010.indd 87 22.06.2010 12:31:35

  • 88 II

    , , . , , , . , , . # , - , . , , . , .

    -, , , .

    , . . , -, , #, . , , , , .

    , , , . , Open() Close(), : , , , - . Open() Close() . # , C++, Java Microsoft Visual Basic, , .

    # . , . . - ( ) 6.3.

    CC2_Part2_ch5_2010.indd 88 22.06.2010 12:31:36

  • 5 89

    ( ) , -# . . . - , .

    1972 . (David Parnas) On the Criteria to Be Used in Decomposing Systems Into Modules ( , ). , # .

    20# # , , - . , , (Brooks, 1995). , , , (Boehm, 1987).

    - , .

    (, ) , . , , , . . - , .