Slide design: Dr. Mark L. Hornick

Slides:



Advertisements
Similar presentations
2-May-15 GUI Design. 2 HMI design There are entire college courses taught on HMI (Human-Machine Interface) design This is just a very brief presentation.
Advertisements

Microsoft Office Word 2013 Expert Microsoft Office Word 2013 Expert Courseware # 3251 Lesson 4: Working with Forms.
With Windows XP, you can share files and documents with other users on your computer and with other users on a network. There is a new user interface.
Designing a Graphical User Interface (GUI) Krisana Chinnasarn, Ph.D. January 2007.
Detailed design – class design Domain Modeling SE-2030 Dr. Rob Hasker 1 Based on slides written by Dr. Mark L. Hornick Used with permission.
Object-Oriented Programming (OOP) CSC-2071 (3+1=4 Credits) Lecture No. 1 MBY.
Cohesion and Coupling CS 4311
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Module 3 Configuring File Access and Printers on Windows 7 Clients.
Technology Vocabulary By: Rakeysha Patterson. Search Engine  A computer program that searches documents, especially on the World Wide Web, for a specified.
Windows 2000 Unit A A1 – A24 and Ap1 – Ap3 (Formatting a Disk)
SE1011 Week 3, Class 2 Today Sit down by someone you don't know Learn their name Find out who came farther to get to MSOE at the start of the quarter Designing.
February 19, February 19, 2016February 19, 2016February 19, 2016 Azusa, CA Sheldon X. Liang Ph. D. Software Engineering in CS at APU Azusa Pacific.
OOD OO Design. OOD-2 OO Development Requirements Use case analysis OO Analysis –Models from the domain and application OO Design –Mapping of model.
Week 9, Day 2 Object-oriented Design Acknowledgement: These slides by Dr. Hasker SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 6, Class 3: Composite Swing composites File composites Computer composites SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors:
Week 5, Class 3: Decorators Lab questions? Example: Starbuzz coffee Basic Pattern More examples Design Principles Compare with alternatives SE-2811 Slide.
Chapter Objectives In this chapter, you will learn:
User Manual for Contact Management Customer Relationship Management (CRM) for Bursa Malaysia 2014 Version 1.0 | 4 September 2014.
Introduction To DBMS.
Information Systems in Organizations 2
Computer Literacy BASICS
Creating Oracle Business Intelligence Interactive Dashboards
Lesson 4: Configuring File and Share Access
The Desktop Screen image displayed when a PC starts up A metaphor
Chapter 5: Using System Software
Week 2, Day 1: The Factory Method Pattern
SOFTWARE DESIGN AND ARCHITECTURE
System Design Ashima Wadhwa.
Chapter 11 Object-Oriented Design
Copyright © by Curt Hill
Note 11 Command Pattern SE2811 Software Component Design
CHAPTER 2 CREATING AN ARCHITECTURAL DESIGN.
MANAGEMENT INFORMATION SYSTEM MEHTAP PARLAK Industrial Engineering Department, Dokuz Eylul University, Turkey 1.
Enterprise Content Management, Shared Services, & Contract Management
Exploring Microsoft Office Access 2007
SE-2811 Software Component Design
Intro To Design 1 Elementary School Library: User Sub-System Class Diagrams Software Engineering CSCI-3321 Dr. Tom Hicks Computer Science Department.
12. Command Pattern SE2811 Software Component Design
Representing Structure and Behavior with Trees
3. Object-oriented Design
Chapter 2: The Linux System Part 2
SE-2811 Software Component Design
Bacyal, Grace Luzcelyn B.
UML Class Diagram.
Week 7, Class 1: The Command Pattern (cont.)
Java Applets.
Starting Design: Logical Architecture and UML Package Diagrams
REAL-TIME, INTERACTIVE DOCUMENT AUTOMATION
GUI Design 24-Feb-19.
Operating Systems : Overview
State Pattern By the Group of Four.
7. Decorator SE2811 Software Component Design
Operating Systems : Overview
4: Object-oriented Analysis & Design
SE-2811 Software Component Design
Applying Use Cases (Chapters 25,26)
Applying Use Cases (Chapters 25,26)
12. Command Pattern SE2811 Software Component Design
Slide design: Dr. Mark L. Hornick
11. MVC SE2811 Software Component Design
Use Case Analysis – continued
Week 8, Class 3: Model-View-Controller
Administrator’s Manual
5. Strategy, Singleton Patterns
DIY GP Maintenance Paul Johnson.
Chapter 6: Architectural Design
Information Systems in Organizations 2. 1
Software Development Process Using UML Recap
Windows Operating System
Presentation transcript:

Slide design: Dr. Mark L. Hornick SE-2811 12/1/2017 Week 9, Day 3 Object-oriented Design Acknowledgement: These slides by Dr. Hasker SE-2811 Slide design: Dr. Mark L. Hornick Content: Dr. Hornick Errors: Dr. Yoder Dr. Yoder

What’s an object? What does it mean to say Java is object-oriented? 1st year: oo programming; 2811: object-oriented design So what’s an object? What are the elements of a class? State Capture information, provide it on request, record events Student: name, id, classes taking, GPA Behavior Operations that do things Student: compute GPA for term, add a class to schedule Responsibility What the object provides to the rest of the system Student: record classes taking, progress Ensure discuss: ways

What’s an object? What are the responsibilities of… SE-2811 12/1/2017 What’s an object? What are the responsibilities of… A house? A roof? door? window? Bank account? Student record in registration system? How many responsibilities should a class have? Textbook: just one! What would happen if Student had just one responsibility? Responsibilities: clear, limited, but complete! When would it make sense to have just one responsibility? Dr. Yoder

What’s an object? What is the responsibility of java.util.Date? SE-2811 12/1/2017 What’s an object? What is the responsibility of java.util.Date? See first line of Java API Dr. Yoder

What’s an object? What is the responsibility of java.util.Date? SE-2811 12/1/2017 What’s an object? What is the responsibility of java.util.Date? See first line of Java API Does this match something in the physical world? A concept, not an object! Identity Something you can point at An address: this is just some text A building: there is a specific building at a specific location Helps distinguish between pieces of information about something (color, name, identification number, temperature) and the things that have that information (people, hurricanes, cars, boats) Objects without identity: attributes Dr. Yoder

What characterizes an object SE-2811 12/1/2017 What characterizes an object An object is something with Responsibility Identity Behavior State Dr. Yoder

What characterizes an object SE-2811 12/1/2017 What characterizes an object An object is something with Responsibility Identity Behavior State But where do objects come from? How do we know we have all the ones we need? Consider a simple example… Dr. Yoder

How to build a system? Meal Wheel SE-2811 12/1/2017 How to build a system? Meal Wheel As a hungry student, I want my phone to randomly select from different restaurants so I know where to eat. As a picky student, I want my phone to suggest close restaurants that serve sashimi so I can choose a place to eat within 10 minutes walk. As a restaurant owner, I want to distribute menus to potential customers. As a restaurant owner, I want potential customers to know of dietary restrictions that I support so I can attract customers who do not eat particular foods. What classes should be in this system? Why? Dr. Yoder

SE-2811 12/1/2017 Domain classes Possible classes: table of restaurants to GPS coordinates, table of restaurants to menus, table of dietary restrictions to menu items But if add tracking popularity, wait times, etc., will need to add more tables Solution: domain classes Classes that are part of the problem space Alternative: solution space Classes that are in a particular solution Why prefer domain classes? Solution independent – less likely to change to support new features Natural: these are the entities that form the problem to solve Dr. Yoder

How to identify domain classes? 12/1/2017 How to identify domain classes? Solution 1: just sit there and think them up Solution 2: mine the stories/scenarios/requirements Objects: lead to classes Verbs: actions Dr. Yoder

Finding classes: Meal Wheel 12/1/2017 Finding classes: Meal Wheel As a hungry student, I want my phone to randomly select from different restaurants so I know where to eat. As a picky student, I want my phone to suggest close restaurants that serve sashimi so I can choose a place to eat within 10 minutes walk. As a restaurant owner, I want to distribute menus to potential customers. As a restaurant owner, I want potential customers to know of dietary restrictions that I support so I can attract customers who do not eat particular foods. Dr. Yoder

Finding classes: Meal Wheel 12/1/2017 Finding classes: Meal Wheel As a hungry student, I want my phone to randomly select from different restaurants so I know where to eat. As a picky student, I want my phone to suggest close restaurants that serve sashimi so I can choose a place to eat within 10 minutes walk. As a restaurant owner, I want to distribute menus to potential customers. As a restaurant owner, I want potential customers to know of dietary restrictions that I support so I can attract customers who do not eat particular foods. Dr. Yoder

Finding classes: Meal Wheel Noun identification method 12/1/2017 Finding classes: Meal Wheel As a hungry student, I want my phone to randomly select from different restaurants so I know where to eat. As a picky student, I want my phone to suggest close restaurants that serve sashimi so I can choose a place to eat within 10 minutes walk. As a restaurant owner, I want to distribute menus to potential customers. As a restaurant owner, I want potential customers to know of dietary restrictions that I support so I can attract customers who do not eat particular foods. Noun identification method Classes: groups of objects w/ RIBS Attributes: simple data Methods: actions on objects Dr. Yoder

Other sources of classes 12/1/2017 Other sources of classes Active objects Objects which consume, produce others; objects which control actions Passive objects Data storage, inputs, basic output Example: light switch, sensors, printers Real-world items – domain classes discussed earlier Physical devices – things with internal state to capture Transactions – sales receipt, todo item Persistent information: configuration User interface elements – menus, dialogs Dr. Yoder

Sound designs Start with domain classes RIBS: test whether a thing is an object or an attribute, when to make 2+ objects Start with domain classes These persist across problem changes Capture things clients, users will recognize Capture requirements that go with those items Add containers, architectural elements Decisions about time/space/complexity tradeoffs Databases, network communications, GUI elements Introduce design patterns, refine These generally reduce coupling, increase flexibility May REMOVE classes from previous steps Be careful about removing domain classes! Might remove a domain class, but document why, especially where it’s responsibilities have moved

Common mistakes How would these violate RIBS? 12/1/2017 Common mistakes “doit” class: does everything Generally surrounded by lots of passive objects VERY low cohesion System class – no need to document main()! Often becomes a doit class Classes for actions “parser”, “artificial intelligence”, “list maintainer” Roll these into domain objects! Patterns excepted! Poor inheritance If A extends B, then anywhere a B can appear, so can an A Liskov Substitution Principle Never violate contracts How would these violate RIBS? Dr. Yoder

Review Noun identification method RIBS Other sources for classes 12/1/2017 Review Noun identification method RIBS Other sources for classes Doit, passive classes and their dangers Liskov Substitution Principle Dr. Yoder

SE-2811 12/1/2017 https://www.polleverywhere.com/free_text_polls/zIp2tH2IVWjXv4H SE-2811 Dr. Mark L. Hornick Dr. Yoder

Exercise In the user stories on the next slide, identify Domain-level objects Attributes Behaviors / methods for the objects SE-2811 Dr. Mark L. Hornick

Class Exercise Consider the user stories below: 12/1/2017 Class Exercise Consider the user stories below: As a user, I can backup my entire hard drive. As a power user, I can specify files or folders to backup based on file size, date created and date modified. As a user, I can indicate folders not to backup so that my backup drive isn't filled up with things I don't need saved. https://www.mountaingoatsoftware.com/agile/user-stories Dr. Yoder