2 Pages

cse335-H5

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

Word Count: 832

Document Preview

Interface H5: Classes and Adapters CSE 335, Spring 2009 Due by Tuesday, March 3 at 11:59 p.m. Objectives 1. Exercise use of abstract classes and interfaces. 2. Understand reasons for refactoring a set of classes in order to support maintenance goals. 3. Apply the adapter and observer patterns. Description The files in /user/cse335/S09/H5-src/ comprise a small GUI application that allows users to enter an...

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.
Interface H5: Classes and Adapters CSE 335, Spring 2009 Due by Tuesday, March 3 at 11:59 p.m. Objectives 1. Exercise use of abstract classes and interfaces. 2. Understand reasons for refactoring a set of classes in order to support maintenance goals. 3. Apply the adapter and observer patterns. Description The files in /user/cse335/S09/H5-src/ comprise a small GUI application that allows users to enter an unsigned integer in some interval [lower bound . . . upper bound]. The GUI itself contains a text-entry box, into which the user may type the integer, and a reset button. The text-entry box ensures that any input is valid and within the prescribed range when the user presses the Enter key. In addition, this text-entry object is actively polled for changes by the main event loop that drives the GUI. When the value in the text-entry box is changed, the event loop queries the new value and prints this value to standard error. The code for the event loop is encapsulated in a function called process GUI behavior. The text-entry box itself, an object of class Ival Text, provides public methods with which the event loop can make these queries. Unfortunately, this design suffers from two problems. First, the monitoring code in the event loop operates on an object of class Ival Text. This complicates replacing the text-entry box with another widget -- say, a graphical slider -- that allows the user to enter an unsigned integer in some range. As it just so happens, we have a class Ival Slider that we would like to use in some configurations as a replacement for text-entry objects. It should be easy to swap out an Ival Text with an Ival Slider, but the current design does not allow this. The second problem is that while there is a reset button in this application, at the moment, it doesn't do anything. We would like to extend class Button so that it is easy to make objects (in this case Ival Slider or Ival Text objects) collaborate with the button. To complete this assignment, you will make use of the adapter and observer patterns. The adapter pattern allows you to extend existing classes so that they can be used with a new interface. This will allow you to solve the first problem described in the above paragraph. The observer pattern is used to have certain parts of your program notify other parts when an event occurs. You will use this to complete the reset button. For more information on these two patterns, pages see 139-150 and 293-303 in the Design Patterns book. 1 Tasks 1. Problem #1: (a) Import the contents of /user/cse335/S09/H5-src/ into a new branch in your SVN repository named H5. To review from past homeworks, you can accomplish this by logging in to black and running the following sequence of commands: > setenv REPOS file:///user/cse335/S09/homework-repos/USERNAME > cd /user/cse335/S09/H5-src/ > svn import ./ $REPOS/branches/H5 Once you have done this, you can move back into your home directory and check out a working copy of the new H5 branch. You should see several new files. (b) Design an interface class called Ival, that abstracts the public interfaces of both Ival Text and Ival Slider. Modify the existing code to work with this interface instead of assuming that Ival Text will be used everywhere. After your modifications, it should be possible to edit app.cpp to use either an Ival Slider or an Ival Text object without having to recompile process GUI behavior.cpp. 2. Problem #2: (a) Create an interface called Button Listener that provides an operation button pressed, which will be invoked with the label of the button that is pressed. It is intended that any object that implements this interface will be able to receive button pressed events. (b) Now go modify class Button to: i. allow objects that implement the Button Listener interface to register interest in button pressed events, and ii. notify all registered li...

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:

Oregon State - CSE - 335
Synthetic OO Design Concepts & ReuseLecture 10: Mediator Topics:Configuration/maintenance complexities that arise from collaboration synthesis The mediator design patternRecall from last timeSynthesis: Construction of new, composite collaborations fro
Oregon State - CSE - 335
Synthetic OO Design Concepts & ReuseLecture 2: Abstract Classes and Composite Structures Topics: Elaboration of the expression class hierarchy New modeling concepts: Aggregation and composition associations (Blaha and Rumbaugh 4.4) Composite object stru
Oregon State - CSE - 335
H1: Bowling Score ComputerCSE 335, Spring 2009Due by Tuesday, January 20 at 11:59 p.m.ObjectivesReview fundamentals and design skills from CSE 231 and CSE 232, and learn the basics of Subversion. Specically: Use of Subversion to manage source code and
Oregon State - CSE - 335
Software Architecture and Larger System Design IssuesLecture 5: Finite state modeling and analysis Topics: Using finite-state modeling to reason about a high level design prior to implementation Introduction to UML State Diagram notation Chapter 5 in Bl
Oregon State - CSE - 335
CSE 335: Software DesignSpring 2009Tuesday, Thursday 12:402:00 p.m. 1225 Engineering Bldg. http:/www.cse.msu.edu/~cse335/InstructorScott D. Fleming <sdf@cse.msu.edu> Office Hours: Tuesday, Thursday 2:003:30 p.m., or by appointment Office: 1126 Enginee
Oregon State - CSE - 335
CSE 335: Software DesignScott D. Fleming 1126 Engineering Building Email: sdf@cse.msu.edu Homepage: http:/www.cse.msu.edu/~cse335/Review of the SyllabusTeaching Assistant: Greg SingerHomework and ProjectsTypically, due at 11:59pm Subversion as submis
Oregon State - CSE - 335
Synthetic OO Design Concepts & ReuseLecture 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 str
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 "good" 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
<h1> Applying What We've Learned </h1>
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 "not monotone"? 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 & 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 ("Example 2, 11.3") 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 & 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~&~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 => 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 => (PreSub => PostSub) => PostSup)<=> <uncurrying> PreSup /\ (PreSub => PostSub) => PostSup<=> <symmetry> (PreSub => PostSub) /\ PreSup => PostSup<=> <currying> (PreSub => PostSub) => (PreSup => 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