CSC172 Class Design - PowerPoint PPT Presentation

About This Presentation
Title:

CSC172 Class Design

Description:

CSC172 Class Design Pepper Goals How to design classes How to think in terms of objects StarUML Code Generation How to Design Classes What objects to choose to solve ... – PowerPoint PPT presentation

Number of Views:118
Avg rating:3.0/5.0
Slides: 11
Provided by: Adel71
Learn more at: https://home.adelphi.edu
Category:
Tags: class | csc172 | design | home

less

Transcript and Presenter's Notes

Title: CSC172 Class Design


1
CSC172 Class Design
  • Pepper

2
Goals
  • How to design classes
  • How to think in terms of objects
  • StarUML
  • Code Generation

3
How to Design Classes
  • What objects to choose to solve a given problem?
  • What classes will we need to implement a system
    that meets our requirements?
  • What fields and methods will each class have?
  • How will the classes interact with each other?

http//www.yyu.edu.tr/abis/admin/dosya/5637/files/
UML20TasarC4B1m.pdf
4
Good Class Design
  • Cohesive
  • only one abstraction
  • No unnecessary coupling
  • No printing to a specific device such as screen
    scanner
  • Related data in the same class

5
Class UML Diagram
  • Each class box
  • Name / state / behavior
  • Relations
  • Has a
  • Knows a
  • Uses a
  • Is a
  • Great Explanation matched to code
  • http//www.cse.buffalo.edu/faculty/adrienne/ClassR
    esources/ClassDiagramsInANutshell/

6
CRC cards
  • One per noun / entity / object
  • Class Noun is the class name on the top
  • Responsibility List responsibilities on the left
  • Collaboration List collaborating objects on the
    right
  • If a class is being used in a collaboration, its
    card will not show the collaboration the user
    shows the collaboration

7
CRC Exercise
  • 5 card draw
  • List objects / entities
  • Make one card for each
  • Walk through the game
  • Draw a UML diagram

8
StarUML
  • Card
  • Deck
  • Hand
  • Players
  • Dealer
  • Game

9
StarUML Code Generation
  • UML diagram generates code
  • Can reverse engineer
  • Link to Diagram
  • Link to Code

10
Summary
  • StarUML
  • CRC Cards
  • Good design principles
  • Cohesive - one abstraction
  • No unnecessary coupling
  • Related data in the same class
Write a Comment
User Comments (0)
About PowerShow.com