L3cs2110f09-6up - 23/08/2009 Overview Today: Design...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
23/08/2009 1 CS 2110 Software Design Principles I Based on a slide set by Juan Altmayer Pizzorno port25.com Overview ± Today : Design Concepts & Principles ² Top-Down, Bottom-Up Design ² Software Process (briefly) ² Modularity ² Information Hiding, Encapsulation ² Principles of Least Astonishment and “DRY” ² Refactoring (if there’s time) ± Next week: Test-Driven Development Our Challenge ± For simple applications, writing code is “linear” ± You pin down the problem ² Example: “search files and list lines that contain the string SnortBlat” ± You make minor decisions, such as where the list of files will come from, and whether SnortBlat will be a constant or an input to the program ± And then you write the code ± Easy as pie! But it isn’t always so easy! ± Interesting applications are often challenging in ways that simple ones aren’t ± Data sets may be enormous ± The thing being computed may be complex ± The amount of code required to do it in the most obvious way may seem huge (and perhaps also, repetitious) A more complex example ± Garmin GPS unit tracks your bike ride … making display easy
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
23/08/2009 2 … or comparisons ± How did I do today compared to the last time I rode this same route? … or comparisons ± Suppose we wanted to automate “finding previous rides on the same route” ± A rides is a long list of location points and won’t be identical each time ± How could we search a list of “rides” to see which ones were rides on the same route? ± Is this problem similar to search files for the word SnortBlat, or different? Actual data is an XML document containing a list of “track points” <?xml version="1.0" encoding="UTF-8" standalone="no" ?> <TrainingCenterDatabase xmlns="ht p:/ www.garmin.com/xmlschemas/TrainingCenterDatabase/v2" xmlns:xsi="ht p:/ www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ht p:/ www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 ht p:/ www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd"> <Activities> <Activity Sport="Biking"> <Id>2009-08-22T13:17:02Z</Id> <Lap StartTime="2009-08-22T13:17:02Z"> <TotalTimeSeconds>4625.0800000</TotalTimeSeconds> <DistanceMeters>30319.2753906</DistanceMeters> <MaximumSpeed>17.7600002</MaximumSpeed> <Calories>1451</Calories> <Intensity>Active</Intensity> <Cadence>0</Cadence> <TriggerMethod>Manua < TriggerMethod> <Track> <Trackpoint> <Time>2009-08-22T13:17:03Z</Time> <Position> <LatitudeDegrees>42.5619387</LatitudeDegrees> <LongitudeDegrees>-76.6450787</LongitudeDegrees> </Position> <AltitudeMeters>229.4117432</AltitudeMeters> <DistanceMeters>9.2514458</DistanceMeters> <SensorState>Absent</SensorState> </Trackpoint> <Trackpoint> <Time>2009-08-22T13:17:06Z</Time> <Position> <LatitudeDegrees>42.5618390</LatitudeDegrees> <LongitudeDegrees>-76.6449268</LongitudeDegrees> </Position> <AltitudeMeters>227.4891357</AltitudeMeters> <DistanceMeters>26.0653191</DistanceMeters> <SensorState>Absent</SensorState> </Trackpoint> …. </Track> (Time=2009-08-22T13:17:03Z,Latitude=42.5619387, Longitude=- 76.6450787,Altitude=229.4117432) (Time=2009-08-22T13:17:06Z,Latitude=42.5618390, Longitude=-76.6449268,Altitude=227.4891357) Each ride is in a separate file ± Sort of like a set of documents ± I want to find the ones that “describe” the same route – the same list of roads in the same route
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

L3cs2110f09-6up - 23/08/2009 Overview Today: Design...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online