24 Pages

01_Abstract_Classes

Course: CSE 335, Spring 2009
School: Oregon State
Rating:
 
 
 
 
 

Word Count: 1162

Document Preview

OO Synthetic Design Concepts & Reuse Lecture 1: Program Fragments and Abstract Classes Topics: Economics of software development Design for change and program families Abstract operations (and pure virtual functions) Abstract classes Composite object structures Synthetic OO Concepts and Reuse Foundational OO concepts: Identity Classification Inheritance Polymorphism Synthetic concepts: New...

Register Now

Unformatted Document Excerpt

Coursehero >> Oregon >> Oregon State >> CSE 335

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
OO Synthetic Design Concepts & Reuse Lecture 1: Program Fragments and Abstract Classes Topics: Economics of software development Design for change and program families Abstract operations (and pure virtual functions) Abstract classes Composite object structures Synthetic OO Concepts and Reuse Foundational OO concepts: Identity Classification Inheritance Polymorphism Synthetic concepts: New design patterns and abstractions built by composing existing concepts in some novel way Often motivated by desire to produce assets of value to an organization Economics of Software Development Problem: Financing development of software systems Big software is notoriously expensive over long term Many software projects run out of money before they ever yield a product Question: What can a project manager do to minimize cost and maximize value? Economics of Software Development Problem: Financing development of software systems Big software is notoriously expensive over long term Many software projects run out of money before they ever yield a product Answer: The manager can... Outsource development to cheaper programmers Buy vs. build Amortize costs over long term: Design for change Create assets that have intrinsic value and that pay dividends: Reusable libraries Buy vs. Build (Brooks 16) Dominant cost of software has always been development cost, not replication cost Sharing that cost among even a few clients is a win Use of n copies of a system multiplies the productivity of the programmer by n. Any existing product is cheaper to buy than to build from scratch Even at $100K, a product costs only about as much as one programmer year Delivery is immediate Such products tend to be much better documented Key issue: Applicability Can I use an off-the-shelf product to do my task? Economics of Software Development Problem: Financing development of software systems Big software is notoriously expensive over long term Many software projects run out of money before they ever yield a product Note: Assumes level of design skill and Answer: The manager can... discipline among Outsource development to cheaper programmers developers. Buy vs. build Amortize costs over long term: Design for change Create assets that have intrinsic value and that pay dividends: Reusable libraries Design for Change Idea: Amortize development costs over the long term of a project or organization Model for thinking about how to design for change based on the notion of program families: We consider a set of programs to constitute a family, whenever it is worthwhile to study programs from this set first by studying their common properties and then determining the special properties of the individual members. D.L. Parnas (TSE1976) What Is a Program Family? Is Netscape a program? Netscape .9 Mosaic Netscape 1.1 All of these are internet browsers that do about the same thing = family Navigator 2.0 Navigator 3.0 Netscape 6.0 Netscape 1.2 Communicator 2.0 Communicator 3.0 How Are Families Developed? Sequential-completion model of program-family evolution (Parnas, 1976) Program fragments: incomplete programs; exist only in mind of the developer 5 0 1 2 3 Initial spec X 4 6 X 7 X 9 X 8 Programs in the family Problems with Model Much of the important design knowledge is not represented (may even be obscured) in the code. Thus: Very expensive to produce new members of the family Involves reverse engineering to infer designers intent Expensive Difficult to do without introducing errors No easy way to put a boundary around what needs to be tested Example void func (Item a[], unsigned n) { if (n == 1) return; for (unsigned i = n-2; i >= 0; --i) { for (unsigned j = i; j < n-1; ++j) { if (a[j] > a[j+1]) { swap(a[j], a[j+1]); } } } } Question: What does this procedure compute? Design Knowledge: A Terrible Thing Waste! Idea: to Reduce cost by recording and using these intermediate program fragments Amortizes costs over development of whole family Dramatically reduces costs involved in reverse engineering from code to determine designers intent Dramatically reduces likelihood of introducing faults [recall that testing consumes up to 50% of development costs] May increase cost in developing first member of the family A savage finds his way skillfully through a wilderness by reading certain obscure indications; civilized man builds a highway which shows the road to all. John Dewey Example Fragment void func (Item a[], unsigned n) { if (n == 1) return; Note: Method for "bubbling" replaced with an abstract operation for (unsigned i = n-2; i >= 0; --i) { a := a' such that a'[0..i-1] = a[0..i-1], and a[i..n-1] and a'[i..n-1] have the same elements, but a'[i..n-1] is in sorted order } } Abstract Operations Invented by designer of a program fragment Signify designers intentional deferment of detail Named and documented so as to declare what is to be done without defining how that goal is to be accomplished Subsequent refinements must flesh out the operation Example Fragment (More Abstract) void func (Item a[], unsigned n) { a := a' such that a' has the same elements as a, only the elements of a' are in sorted order } Abstract Decisions Model of ProgramFamily Evolution Program fragments: retained; refined to produce new fragments and programs defer implementation/design decisions to fragments or programs down the tree. abstract operations specify what, not how X X X X Abstract Operations in OOP Recall: A base class might declare an operation for which there is no reasonable default method Example: Class Shape Defines an area() operation But there is no general method for computing area of a shape Such an operation should be declared abstract In C++, abstract operations are called pure virtual functions Pure Virtual Function Definition: Mechanism by which a class can declare an operation w/o providing a method class BaseClass { public: virtual void pvf() = 0; }; class DerivedClass : public BaseClass { public: void pvf() { } }; Example: Class Shape class Shape { public: virtual unsigned area() = 0; }; Class Rectangle : public Shape { public: Rectangle(unsigned l, unsigne...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Pace - DCS - 801
SOFTWARE DEVELOPMENTGet Ready for Agile Methods, with CareAlthough many of their advocates consider the agile and plan-driven software development methods polar opposites, synthesizing the two can provide developers with a comprehensive spectrum of tool
MD University College - CS - 3660
0 1 0 1 0 111 0 1 0 1 0 1111 0 0 0 111 0 1 0 1 0 11 0 11 0 1 0 1 0 1 0 1 0 111 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 111 0 1 0 1 0 1111 0 0 0 111 0 1 0 1 0 11 0 11 0 1 0 1 0 1 0 1 0 111 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 111 0 1 0 1 0 1 0 111 0 1 0
Rutgers - PHYSICS - 124
ELASTICITY In this workshop you will explore the elastic response of a thin wire to an applied tension. The aim is to obtain a rough understanding of the size of the forces necessary to measurably deform the wire (Young's modulus). While large forces can
Rutgers - PHYSICS - 124
Names_Section_ SIMPLEHARMONICMOTION Introduction Theobjectiveofthisworkshopistomeasurethetimedependentdisplacement,velocity andaccelerationofanobjectundergoingsimpleharmonicmotion.Anobjectinsimple harmonicmotionoscillatesaboutitsrestpointxowithapositionxg
Rutgers - PHYSICS - 124
Physics 124 Minilab 2 CONSERVATION OF ANGULAR MOMENTUM Purpose: To demonstrate the conservation of angular momentum.DISCUSSION: The picture above shows a rotating disc of mass M and radius R. The timer is used to determine the time for one rotation, T, u
Oklahoma State - DOCUMENT - 1011
Oklahoma Cooperative Extension ServiceEPP-7643Black Rot of GrapesSharon von BroembsenExtension Plant PathologistPhillip W. PrattOklahoma Cooperative Extension Fact Sheets are also available on our website at: http:/osufacts.okstate.eduArea Extensio
Rutgers - PHYSICS - 124
Names _ _ _ Section _ ABSOLUTE ZERO TEMPERATURE In this experiment you will determine the absolute zero of temperature the lowest possible temperature. Your instructor will use a gas thermometer, which is a container filled with air at constant volume, co
Oklahoma State - DOCUMENT - 2157
Oklahoma Cooperative Extension ServiceCurrent ReportFoot Rot ControlExtension Sheep SpecialistCR-39010902Oklahoma Cooperative Extension Fact Sheets are also available on our website at: http:/osufacts.okstate.eduGerald Q. FitchFoot rot is a diseas
University of Alabama in Huntsville - CHE - 294
Example PlotsMaple 6J. J. Weimer September 8, 2002IntroductionThis example provides the following information for making graphs in Maple 6 (or later): 1. a setupplot procedure that can be used to prepare a graph in &quot;good&quot; quality 2. procedures to put
Utah - CS - 3700
MM74HC14 Hex Inverting Schmitt TriggerSeptember 1983 Revised February 1999MM74HC14 Hex Inverting Schmitt TriggerGeneral DescriptionThe MM74HC14 utilizes advanced silicon-gate CMOS technology to achieve the low power dissipation and high noise immunity
Utah - CS - 3700
INTEGRATED CIRCUITSDATA SHEETFor a complete data sheet, please also download: The IC06 74HC/HCT/HCU/HCMOS Logic Family Specifications The IC06 74HC/HCT/HCU/HCMOS Logic Package Information The IC06 74HC/HCT/HCU/HCMOS Logic Package Outlines74HC/HCT10 Tr
Utah - CS - 3700
MM74HC165 Parallel-in/Serial-out 8-Bit Shift RegisterSeptember 1983 Revised February 1999MM74HC165 Parallel-in/Serial-out 8-Bit Shift RegisterGeneral DescriptionThe MM74HC165 high speed PARALLEL-IN/SERIAL-OUT SHIFT REGISTER utilizes advanced silicon-g
Illinois State - CHEM - 315
CHE315EXAM1February10,2009EQUATIONSS = mc + S bl=m sSS m = S bl + ksblS = ma ca + mbcb + mc cc + . + S bl = ma (ca + kb ,a cb + kc ,a cc + .) + S blkc ,a =mc ma=K B kB t R ,B t M = = K A kA tR ,A tMu=L tMv=L u 1 =u = tR 1 + KVS / VM 1 + k
Illinois State - CHEM - 315
CHE315:INSTRUMENTALANALYSISEXAM2REVIEWGUIDE Wednesday,April1,2009Exam2isworth75pointsandwillcontaindefinitions,calculationproblems,shortanswerquestions,andsome multiplechoice.Wecovered4chaptersandAppendix2.AsinExam1,thequestionswillbeapproximately evenl
Texas A&M - BMEN - 482
Chapter 2: Answers to suggested problems 2. Because of increased molecular motion (entropy), heating causes an increase in hydrodynamic volume. In a poor solvent, this effect is greater because the molecules initially are more compact/collapsed. This unco
UPenn - P - 94
MULTI-PARAGRAPH SEGMENTATION EXPOSITORY TEXTMarti A. Hearst C o m p u t e r Science Division, 571 E v a n s Hall U n i v e r s i t y of California, B e r k e l e y Berkeley, C A 94720 and Xerox Palo Alto Research Center m a r t i @cs. berkeley, eduOFAb
UCF - CSE - 782
Photographic Tone Reproduction for Digital ImagesErik Reinhard University of Utah Michael Stark University of Utah Peter Shirley University of Utah James Ferwerda Cornell UniversityAbstractA classic photographic task is the mapping of the potentially h
UMass (Amherst) - MOD - 337
&lt;h1&gt; Applying What We've Learned &lt;/h1&gt;
Lehigh - BAD - 22
Week 5 Homework: Pre-view 10.2 Calculus on parametric curves 10.3 Polar coordinates: a. translations (x, y) to (r, ) b. translations (r, ) to (x, y) c. standard curves (r = a cos ; r = a + b cos ; r = cos n.) 10.4 Area and arc length in polar coordinates
Lehigh - BAD - 22
Week 3 Homework: Wed, Thurs, Mon 7.3 trig substitution text ex 3, #27 7.4 partial fractions #21 below, #25 7.7 approximate integration - answers as sums 7.8 improper integrals (first case) 8.2 surface areas (rotation about x-axis)2Homework notes: In 7.3
Lehigh - BAD - 22
Week 4 Homework: Pre-view 7.1 - 7.5 as needed on new homework 7.8 improper integrals (rest of cases) 8.2 surface areas (rotation about y-axis) 8.3 centroid (with sketch) 9.1 (no hw), 9.3 separable differential eqn. 8.1 arc length 10.1, 10.2 (start paramet
Lehigh - BAD - 22
Week 2 Homework: Wed, Thurs, Mon 3.6 Implicit diff #49 3.8 Log derivatives #4 5.5 Integration by substitution continued Text Ex 2, #2626.1 areas #19, #9 (today) 6.2 volumes: disks, washers Text #2, #6, 26, 28 7.1 integration by parts #6, text #3, #10 (l
Lehigh - BAD - 22
Math 22, Summer II 2005 B. Dodson21. Course Info 2. Week 1 Homework: first day 3.2 Quotient rule (product rule) in-class examples #3, 14 3.4 Trig derivatives #15 3.5 Chain rule #37 5.3 Fundamental theorem see below 5.5 Integration by substitution #2, 6
Lehigh - BAD - 22
MATH 22Quiz 4 Take-homeAugust 3, 2005NAME: (Last, First) 1. Are the terms bn = n n+1increasing, decreasing or &quot;not monotone&quot;? Does theseriesn=1(-1)nn converge? Give a reason. n+12. Find the ratio of the terms of the series correct answer include
Lehigh - BAD - 22
MATH 22PretestJuly 5, 2005NAME: (Last, First)(from Math 21, Exams 4 &amp; 5 June, 2004) (a) 3x2 + 53. (25 points) Find the most general anti-derivatives.(b)x+1 x2(c) 3ex + 2 cos x3. (20 points) Find the general indefinite integral.(a)3x2 + 5 dx(b
Lehigh - BAD - 22
Exam Instructions for verifying convergence tests 3. Use the p-series test (&quot;Example 2, 11.3&quot;) to determine . . . State explicitly the value of p for each series, and why that value passes or fails this convergence test. 4. For each of the given series, e
Lehigh - BAD - 22
MATH 22Course PoliciesSummer II, 20051. Instructor. B. Dodson, Room 231 XS, Phone x8-3745, Email bad0. 2. Text. We will cover material from Stewart, Calculus, Early Transcentals, Fifth Edition. We begin with some review material from Calculus I; then s
Rutgers - MATH - 153
USC - EE - 459
1N/FDLL 914/A/B / 916/A/B / 4148 / 4448Discrete POWER &amp; Signal Technologies1N/FDLL 914/A/B / 916/A/B / 4148 / 4448COLOR BAND MARKING DEVICE FDLL914 FDLL914A FDLL914B FDLL916 FDLL916A FDLL916B FDLL4148 FDLL4448 1ST BAND 2ND BAND BLACK BLACK BROWN BLACK
Rutgers - MATH - 153
Oregon State - CS - 325
u i WC 2R ` E tQ V4 @ QC Q4e R 8u t @ bU~&amp;~7sUXP9xp7Ie9G9Uv959IQs i u Cu @ 8 62C EC @ C V4 yFG~FU5XBe9aDGGDIADBAUdBA@ t Q4 u i Cu @ 8 62 C E C @ @ u i 8 642 f R d y z y 9UdUPUghGvDBe99HGGDIABAdggP7k9U5G398 apyhky q i @ @ FIQBAr r Uw5y98 u4 8u cC Q4 8u
FIU - EML - 4809
BASIC Stamp Syntax and Reference ManualVersion 2.2WarrantyParallax Inc. warrants its products against defects in materials and workmanship for a period of 90 days from receipt of product. If you discover a defect, Parallax Inc. will, at its option, rep
Iowa State - UI - 181
CS 181 Formal Methods in Software Engineering Homework 7 $Date: 2001/04/30 20:43:25 $Due: Problems 1-7, Tuesday, April 24, 2001; problems 8-10, Thursday, April 26, 2001; problems 11-12,14, Tuesday, May 1, 2001.Readings:- JML: A Notation for Det
Iowa State - UI - 181
CS 181 Formal Methods in Software EngineeringExample for Homework 6 $Date: 2001/04/17 22:13:31 $Here's an example of the kind of solution we're asking for in homework 6 for the loop problems. It's based on Cohen's section 10.2 (thanksto Kevin Lil
Iowa State - UI - 181
CS 181 Formal Methods in Software Engineering Homework 5 $Date: 2001/03/28 18:25:53 $Due: Problems 1,3-6, Tuesday, March 27, 2001; Problem 9 Thursday, March 29, 2001.Readings: Chapters 8 and 9 of Cohen's Programming in the 1990s.The aim of this
Iowa State - UI - 181
Notes on Homework 3 by Gary T. Leavens $Date: 2001/03/07 04:54:37 $ Lemma: To prove equality of statements, it is necessary and sufficient to prove that they have the same Hoare triple annotations. That is, for all statements, S, T, (\forall P
Iowa State - UI - 181
CS 181 Formal Methods in Software Engineering Homework: 3 $Date: 2001/02/27 18:03:35 $Due: Problems 1-5, Tuesday, February 27, 2001; Problems 8-12, 14-15 Tuesday, March 6, 2001Readings: Chapters 4 and 5 of Cohen's Programming in the 1990s.The ai
Iowa State - UI - 181
CS 181 Formal Methods in Software Engineering Homework: 1 $Date: 2001/02/01 20:08:26 $Due: problems 1,2 on Tuesday, February 6, 2001; problems 3-5 on Thursday, February 8, 2001.Readings: E. Cohen. Programming in the 1990s. Springer-Verlag, 1990.
Iowa State - UI - 181
CS 181 Formal Methods in Software Engineering Homework 0 $Date: 2001/01/15 18:10:42 $Due: problems 1-4, Tuesday January 23, 2001; problem 5, January 30, 2001.Readings for this homework: - Michael G. Hinchey and Jonathan P. Bowen. Applications of
Iowa State - UI - 181
meeting -*- Outline -*-* not excluding miracles Ref: Wim Hesselink. Programs, Recursion and Unbounded Choice. Cambridge, 1992.* excluded miracle and excluded middle X \/ !X (excluded middle) wp.S.false = false (excluded miracle) Excluded middle r
Iowa State - UI - 181
meeting -*- Outline -*-* What Are Formal Methods? Three intersecting circles: mathematics, computing, engineering* main terms formal = unambiguous, rigorous =&gt; capable of automation specification = mathematical description of program behavior not ne
Iowa State - UI - 181
CS 181 Formal Methods in Software Engineering Study Problems for Exam 2 $Date: 2001/03/29 23:21:49 $Note: it's easy to come up with problems when I don't have to worryabout how hard they might be; if some of these seem too hard, skipthem and go o
Iowa State - UI - 181
PreSup =&gt; (PreSub =&gt; PostSub) =&gt; PostSup)&lt;=&gt; &lt;uncurrying&gt; PreSup /\ (PreSub =&gt; PostSub) =&gt; PostSup&lt;=&gt; &lt;symmetry&gt; (PreSub =&gt; PostSub) /\ PreSup =&gt; PostSup&lt;=&gt; &lt;currying&gt; (PreSub =&gt; PostSub) =&gt; (PreSup =&gt; PostSup)
Iowa State - UI - 181
meeting -*- Outline -*-* JML method specifications* preliminaries- ANNOTATIONSJML is an annotation language for JavaIn .java files,annotations start with /@ and end with a newline or start with /*@ and end with @*/ or start with /*+@ and end with
Penn State - IST - 220
IST 220 Sample Test 3 - Answer Name: _ 1. For each question (3 points), there are multiple choices, but only one is correct1.1) The IP address 191.192.193.194 belongs to class _ (a) A (b) B (c) C Answer: [b] 1.2) The job of a router is to store and forwa
Iowa State - UI - 181
meeting -*- Outline -*-* JML ADT specifications* background- ADTsabstract data type = data + operationsAbstract (public) view: model fields + method specsConcrete (private) view: fields + method codeConnection is made by (private) represents claus
Utah - ARCH - 6570
ARCH-6570 Historic Preservation TechnologyBuilding Systems: Lighting, Electrical, Mechanical
Utah - ARCH - 6570
ARCH-6570 Historic Preservation TechnologyWindowsCrown GlassCylinder or Muff GlassPlate Glass
Utah - ARCH - 6570
ARCH-6570 Historic Preservation TechnologyLog and TimberSingle-Pen Log Cabins and BuildingsDouble-Pen CabinsAttachedDog TrotLog HousesCrown ReplacementSection ReplacementStabilize and ProtectSplits and Checks can be repaired with fillerRepair,
Utah - ARCH - 6570
ARCH-6570 Historic Preservation TechnologyHistoric Construction Methods/ Structural SystemsStructural Systems Failure and Remediation
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391
Michigan State University - ME - 391