Lecture26 - Chapter 13 Design Design We have discussed the specification and implementation of individual data abstraction We have emphasized

Lecture26 - Chapter 13 Design Design We have discussed the...

This preview shows page 1 - 10 out of 40 pages.

Chapter 13 Design
Image of page 1
2 Design We have discussed the specification and implementation of individual data abstraction We have emphasized abstractions because they are the building blocks out of which programs are constructed. Now, we discuss how to put them together to build good programs.
Image of page 2
3
Image of page 3
4 Design We start a design with the requirements specification. Sometimes, it describe a single abstraction.Sometime, several that together make up the system. For example, the file system abstraction: the file and directory abstraction We pick one of these abstractions to start work on. It becomes the initial target abstraction.
Image of page 4
5 Design Process Select a target abstraction (eg. file or directory abstraction) whose implementation has not yet been studied. Identify and inventing a number of helper abstractions that would be useful in implementing the target and that facilitate decomposition of the problem Sketch how the helper will be used in implementing the target by providing a specification for each one Iterate until the implementations of all abstractions have been studied.
Image of page 5
6 Design Process
Image of page 6
7 Search engine example (Requirements Specification) Allows the user to run queries against a collection of documents Documents are specified by a URL of a site containing the documents User should be able to search for a document with a particular title User should be able to search for a document with a query consisting of a keyword Some words (“the”,”is”) are uninteresting as keywords, the search engine knows about them A match of documents is ordered by the number of times a keyword occurs
Image of page 7
8
Image of page 8
9 Document a Design The decision made during design must be recorded. The documentation should be kept in a design notebook. The design notebook contains: a module dependency diagram shows code modules (classes & interfaces)
Image of page 9
Image of page 10

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture