josh bloch charlie garrod
play

Josh Bloch Charlie Garrod School of Computer Science - PowerPoint PPT Presentation

Principles of So3ware Construc9on: Objects, Design, and Concurrency Part 1: Introduc9on Course


  1. Principles ¡of ¡So3ware ¡Construc9on: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Objects, ¡Design, ¡and ¡Concurrency ¡ ¡ Part ¡1: ¡Introduc9on ¡ ¡ Course ¡overview ¡and ¡introduc9on ¡to ¡so3ware ¡design ¡ ¡ Josh ¡Bloch ¡ ¡ Charlie ¡Garrod ¡ School ¡of ¡ ¡ Computer ¡Science ¡ 15-­‑214 1

  2. Growth ¡of ¡code—and ¡complexity—over ¡9me ¡ (informal reports) 15-­‑214 2

  3. 15-­‑214 15-313 Software Engineering 3 3

  4. Normal night-time image Blackout of 2003 15-­‑214 4

  5. Principles ¡of ¡So3ware ¡Construc9on: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Objects, ¡Design, ¡and ¡Concurrency ¡ ¡ Part ¡1: ¡Introduc9on ¡ ¡ Course ¡overview ¡and ¡introduc9on ¡to ¡so3ware ¡design ¡ ¡ Josh ¡Bloch ¡ ¡ Charlie ¡Garrod ¡ School ¡of ¡ ¡ Computer ¡Science ¡ 15-­‑214 5

  6. graph search primes binary tree GCD sorting BDDs 15-­‑214 6

  7. From ¡programs ¡to ¡systems ¡ Wri9ng ¡algorithms, ¡data ¡ Reuse ¡of ¡libraries, ¡ structures ¡from ¡scratch ¡ frameworks ¡ ¡ ¡ Func9ons ¡with ¡inputs ¡ ¡ Asynchronous ¡and ¡ ¡ and ¡outputs ¡ reac9ve ¡designs ¡ ¡ ¡ Sequen9al ¡and ¡local ¡ Parallel ¡and ¡distributed ¡ computa9on ¡ computa9on ¡ ¡ ¡ Full ¡func9onal ¡ Par9al, ¡composable, ¡ ¡ specifica9ons ¡ targeted ¡models ¡ Our goal: understanding both the building blocks and also the design principles for construction of software systems at scale 15-­‑214 7

  8. Principles ¡of ¡So3ware ¡Construc9on: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Objects, ¡Design, ¡and ¡Concurrency ¡ ¡ Part ¡1: ¡Introduc9on ¡ ¡ Course ¡overview ¡and ¡introduc9on ¡to ¡so3ware ¡design ¡ ¡ Josh ¡Bloch ¡ ¡ Charlie ¡Garrod ¡ School ¡of ¡ ¡ Computer ¡Science ¡ 15-­‑214 8

  9. Objects ¡in ¡the ¡real ¡world ¡ 15-­‑214 9

  10. Object-­‑oriented ¡programming ¡ • Programming ¡based ¡on ¡structures ¡ that ¡contain ¡both ¡data ¡and ¡methods ¡ public ¡class ¡Bicycle ¡{ ¡ ¡ ¡private ¡int ¡speed; ¡ ¡ ¡private ¡final ¡Wheel ¡frontWheel, ¡rearWheel; ¡ ¡ ¡private ¡final ¡Seat ¡seat; ¡ ¡ ¡… ¡ ¡ ¡ ¡public ¡Bicycle(…) ¡{ ¡… ¡} ¡ ¡ ¡ ¡public ¡void ¡accelerate() ¡{ ¡ ¡ ¡ ¡ ¡ ¡speed++; ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡public ¡int ¡getSpeed() ¡{ ¡return ¡speed; ¡} ¡ } ¡ 15-­‑214 10

  11. Principles ¡of ¡So3ware ¡Construc9on: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ Objects, ¡Design, ¡and ¡Concurrency ¡ ¡ Part ¡1: ¡Introduc9on ¡ ¡ Course ¡overview ¡and ¡introduc9on ¡to ¡so3ware ¡design ¡ ¡ Josh ¡Bloch ¡ ¡ Charlie ¡Garrod ¡ School ¡of ¡ ¡ Computer ¡Science ¡ 15-­‑214 11

  12. Semester ¡overview ¡ Introduc9on ¡ Explicit ¡concurrency ¡ • • Design ¡goals, ¡principles, ¡paSerns ¡ Distributed ¡systems ¡ – • Design ing ¡classes ¡ • Design ¡for ¡change: ¡Subtype ¡polymorphism ¡ – CrosscuZng ¡topics: ¡ • and ¡informa9on ¡hiding ¡ Modern ¡development ¡tools: ¡IDEs, ¡version ¡ – Design ¡for ¡reuse: ¡inheritance ¡and ¡delega9on ¡ – control, ¡build ¡automa9on, ¡con9nuous ¡ Design ing ¡(sub)systems ¡ • integra9on, ¡sta9c ¡analysis ¡ Modeling ¡and ¡specifica9on, ¡formal ¡and ¡ What ¡to ¡build: ¡Domain ¡models, ¡system ¡ – – informal ¡ sequence ¡diagrams ¡ Assigning ¡responsibili9es: ¡GRASP ¡paSerns ¡ Func9onal ¡correctness: ¡Tes9ng, ¡sta9c ¡ – – analysis, ¡verifica9on ¡ Design ¡for ¡robustness: ¡Excep9ons, ¡modular ¡ – protec9on ¡ Design ¡for ¡change ¡(2): ¡Façade, ¡Adapter, ¡ – Observer ¡ Design ¡case ¡studies ¡ • Graphical ¡user ¡interfaces ¡ – Streams, ¡I/O ¡ – Collec9ons ¡ – Design ¡for ¡large-­‑scale ¡reuse ¡ • Libraries, ¡APIs, ¡ ¡ – Frameworks ¡ – Product ¡lines ¡ – 15-­‑214 12

  13. Sorting with a configurable order, version A ¡ void ¡sort(int[] ¡list, ¡boolean ¡ascending) ¡{ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡ ¡boolean ¡mustSwap; ¡ ¡ ¡ ¡if ¡(ascending) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡mustSwap ¡= ¡list[i] ¡< ¡list[j]; ¡ ¡ ¡ ¡} ¡else ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡mustSwap ¡= ¡list[i] ¡> ¡list[j]; ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡… ¡ } ¡ ¡ 15-­‑214 13

  14. Sorting with a configurable order, version B interface ¡Comparator ¡{ ¡ ¡ ¡boolean ¡compare(int ¡i, ¡int ¡j); ¡ } ¡ ¡ class ¡AscendingComparator ¡ ¡implements ¡Comparator ¡{ ¡ ¡ ¡boolean ¡compare(int ¡i, ¡int ¡j) ¡{ ¡return ¡i ¡< ¡j; ¡} ¡ } ¡ class ¡DescendingComparator ¡implements ¡Comparator ¡{ ¡ ¡ ¡boolean ¡compare(int ¡i, ¡int ¡j) ¡{ ¡return ¡i ¡> ¡j; ¡} ¡ } ¡ ¡ void ¡sort(int[] ¡list, ¡Comparator ¡cmp) ¡{ ¡ ¡ ¡… ¡ ¡ ¡ ¡boolean ¡mustSwap ¡= ¡ ¡ ¡ ¡ ¡cmp.compare(list[i], ¡list[j]); ¡ ¡ ¡… ¡ } ¡ 15-­‑214 14

  15. Sorting with a configurable order, version B' interface ¡Comparator ¡{ ¡ ¡ ¡boolean ¡compare(int ¡i, ¡int ¡j); ¡ } ¡ ¡ final ¡Comparator ¡ASCENDING ¡ ¡= ¡(i, ¡j) ¡-­‑> ¡i ¡< ¡j; ¡ final ¡Comparator ¡DESCENDING ¡= ¡(i, ¡j) ¡-­‑> ¡i ¡> ¡j; ¡ ¡ void ¡sort(int[] ¡list, ¡Comparator ¡cmp) ¡{ ¡ ¡ ¡… ¡ ¡ ¡ ¡boolean ¡mustSwap ¡= ¡ ¡ ¡ ¡ ¡cmp.compare(list[i], ¡list[j]); ¡ ¡ ¡… ¡ } ¡ 15-­‑214 15

  16. Which version is better? Version A: void ¡sort(int[] ¡list, ¡boolean ¡ascending) ¡{ ¡ ¡ ¡ ¡… ¡ ¡ ¡ ¡ ¡boolean ¡mustSwap; ¡ ¡ ¡ ¡if ¡(ascending) ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡mustSwap ¡= ¡list[i] ¡< ¡list[j]; ¡ ¡ ¡ ¡} ¡else ¡{ ¡ ¡ ¡ ¡ ¡ ¡ ¡mustSwap ¡= ¡list[i] ¡> ¡list[j]; ¡ ¡ ¡ ¡} ¡ ¡ ¡ ¡… ¡ } ¡ Version B': interface ¡Comparator ¡{ ¡ ¡ ¡boolean ¡compare(int ¡i, ¡int ¡j); ¡ } ¡ final ¡Comparator ¡ASCENDING ¡= ¡ ¡(i, ¡j) ¡-­‑> ¡i ¡< ¡j; ¡ final ¡Comparator ¡DESCENDING ¡= ¡(i, ¡j) ¡-­‑> ¡i ¡> ¡j; ¡ ¡ void ¡sort(int[] ¡list, ¡Comparator ¡cmp) ¡{ ¡ ¡ ¡… ¡ ¡ ¡ ¡boolean ¡mustSwap ¡= ¡ ¡ ¡ ¡ ¡cmp.compare(list[i], ¡list[j]); ¡ ¡ ¡… ¡ } ¡ 15-­‑214 16

  17. It depends? 15-­‑214 17

  18. Software engineering is the branch of computer science that creates practical, cost-effective solutions to computing and information processing problems, preferably by applying scientific knowledge, developing software systems in the service of mankind. Software engineering entails making decisions under constraints of limited time, knowledge, and resources. […] Engineering quality resides in engineering judgment. […] Quality of the software product depends on the engineer’s faithfulness to the engineered artifact. […] Engineering requires reconciling conflicting constraints. […] Engineering skills improve as a result of careful systematic reflection on experience. […] Costs and time constraints matter, not just capability. […] Software Engineering for the 21st Century: A basis for rethinking the curriculum Manifesto, CMU-ISRI-05-108 15-­‑214 18

  19. So3ware ¡Engineering ¡(SE) ¡at ¡CMU ¡ • 15-­‑214: ¡ ¡Code-­‑level ¡design ¡ – Extensibility, ¡reuse, ¡concurrency, ¡func9onal ¡correctness ¡ • 15-­‑313: ¡ ¡Human ¡aspects ¡of ¡so3ware ¡development ¡ – Requirements, ¡teamwork, ¡scalability, ¡security, ¡scheduling, ¡costs, ¡risks, ¡ business ¡models ¡ • 15-­‑413 ¡Prac9cum, ¡17-­‑413 ¡Seminar, ¡Internship ¡ • Various ¡Master's ¡level ¡courses ¡on ¡requirements, ¡architecture, ¡ so3ware ¡analysis, ¡etc. ¡ • SE ¡Minor: ¡hSp://isri.cmu.edu/educa9on/undergrad ¡ 15-­‑214 19 19

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend