Cse 111 object oriented design
1 / 19

CSE 111: Object Oriented Design - PowerPoint PPT Presentation

  • Uploaded on

CSE 111: Object Oriented Design. Design. “To program is human but to design is divine” (WEH). What is a Design?. Different possibilities, e.g. Algorithmic strategy e.g. rate-monotonic scheduling strategy for a real time system Decomposition of a system

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about ' CSE 111: Object Oriented Design' - halla-hobbs

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript


“To program is human but to design is divine” (WEH)

What is a design
What is a Design?

  • Different possibilities, e.g.

    • Algorithmic strategy

      • e.g. rate-monotonic scheduling strategy for a real time system

    • Decomposition of a system

      • modules with well-defined consistent interfaces

    • Abstract function hierarchy

      • abstract functions defined in terms of less abstract functions

Design and abstraction
Design and Abstraction

  • Design uses abstraction to create views that are comprehensible

    • Vs the complete code for the program that cannot be comprehended all at the same time

    • breaking down a system into pieces involves an abstract model that ties the pieces together

Why design
Why Design?

  • Provides an overall picture of the system

  • Allows us to focus on one thing at a time

  • A harmonious, understandable design is our best hope for constructing a program that works

  • Facilitates (design) reuse (NOT code reuse): transmission of expert knowledge

No design
No Design?

  • Possible for simple or small well- understood programs

  • For complex systems: 85% phenomenon

    • milestone 1: 50% done

    • milestone 2: 75% done

    • milestone 3: 85% done

    • milestone 4: 85% done

    • milestone 5: 85% done .........

Design paradigms functional 1
Design Paradigms – Functional 1

  • Basic components: functions/procedures

  • Component relationships: one function calls other functions

  • Abstraction

    • one function calls another

      • defined in terms of less abstract or concrete functions

Design paradigms functional 2
Design Paradigms - Functional 2

  • Design strategy

    • top level function corresponds to program requirements

    • define this in terms of less abstract functions

    • continue on down until all functions are concrete

  • Refactoring: go back and re-design higher level functions if design becomes ugly

Design paradigms object oriented 1
Design Paradigms – Object Oriented 1

  • Basic components:

    • classes: state plus function

  • Component relationships

    • one class uses other classes to help it fulfill its responsibilities (by its methods calling methods in the other classes)

    • inheritance

    • classes grouped into packages/subsystems

Design paradigms object oriented 2
Design Paradigms – Object Oriented 2

  • Abstraction

    • inheritance where a superclass is an abstraction of subclasses

      • usefulness much more restricted than functional top down abstraction

    • when one class’s methods call methods in another class, this is often a peer relationship not a (top down) abstraction relationship

Design paradigms object oriented 3
Design Paradigms – Object Oriented 3

  • Layers abstraction

    • group classes into “layers” in which the classes in the upper layers can use classes in lower layers but not vice-versa

    • lower layers simulate existence of an abstract machine that can be “used” by higher layers

Design paradigms object oriented 4
Design Paradigms – Object Oriented 4

  • Design Strategy

    • identify basic objects/concepts in application domain, and use these as foundation classes

    • select a design architecture/metaphor

    • add additional classes for desired functionality

    • abstract out superclasses to facilitate understanding and possible re-use

    • refactor as necessary

Functional versus object oriented design
Functional versus Object Oriented Design?

  • Application types

    • Functional

      • input – computation – output

        • input may include persistent data (data base or files)

    • Object oriented

      • interactive programs with retained distributed session state between interactions

      • object methods are functions that can be functionally designed but are often simple


  • Development Process

  • Design Paradigms

  • Design Patterns

    • mid to low level design ideas that are useful in certain commonly occurring contexts

  • UML Modeling and Design Language


  • Two phases

    • due at midterm and end of class

  • Purpose: help learn UML and design patterns

  • Deliverables

    • assigned at the end of the lecture in which they are described

    • not due until end of first and second phase

Running example
Running Example

  • Use to illustrate patterns and corresponding UML diagrams

  • Template for required simple project

  • Very simple toy dating system

Dating system example
Dating System Example

  • Initial Start/End screen

  • Member and Admin Users

    • Admin recognized by special name at login

  • Admin can add and delete users

  • Member can ask for date or update/initialize member data

  • After each request reset to Start/End

Some dating system details
Some Dating System Details

  • Member properties:

    • world view: spiritual/ secular

    • gender: M/F

  • Exact matches only

  • Members identified by their names

  • If date found, member info returned (name, email address)

Assignment 1
Assignment 1

  • Form a project team

  • Choose a project topic

    • .5 to 1 page brief description

    • “concept document”

  • Submit for approval by the end of the week