Relationships amongst Objects

Size: px
Start display at page:

Download "Relationships amongst Objects"

Transcription

1 Relationships amongst Objects By Rick Mercer with help from Object-Oriented Design Heuristics Arthur Riel Addison-Wesley, 1996, ISBN X 8-1

2 Outline Consider six relationships between objects Offer some guidelines for better OO design A few design heuristics Low coupling and high cohesion 8-2

3 Relationship Between Objects Object relationships occur when one object 1. sends messages to an instance variables 2. sends a message to another object 3. is passed as an argument in a message 4. creates another object 5. reference is returned from a message 6. stores a referential attribute A reference to an object needed by other objects Example: Jukebox stores a reference to a JukeboxAccount stored in a JukeboxAccountCollection 8-3

4 Object A sends message to Object B #1 A uses relationship occurs when one object sends a message to another object. Example: a listener sends an updateui() message to a JList object private class ButtonListener implements ActionListener { public void actionperformed(actionevent event) { } rollinputfield.settext(""); // set text field to blank The sender, the new ButtonListener()object, must know the receiver's name: rollinputfield 8-4

5 Example: Cars and Gas Stations #2 If a Car "contains" a gas station instance variable send a fillup message to its own gas station this.fillup(exxon126); If a Car does not "contain" a gas station how can a Car send a fillup message? #3 A Car could be given the name of the gas station (Exxon126) as an argument // adispatcher object sends this message car[currentcar].fillup(exxon126); 8-5

6 Other uses relationships #4 Let the car find a gas station on its own Assume map is a global variable everyone knows mygasstation = map.getnearestgasstation(); mygasstation.fillup(); #5 Whenever a car needs gas, let the car build it It will know the name of the object it creates construct a new one in the Cars fillup method Note: the gas station will be destroyed upon exit 8-6

7 Who constructs needed objects? What object creates object X? Choose an object B to create an X such that: B contains X B closely uses X B has the initializing data for X 8-7

8 Referential attribute (can be bad) #6 Store a reference to a gas station that was created elsewhere Known to some as a referential attribute This provides access to an entire object that was constructed elsewhere The car has a reference needed by someone else Be careful: This can lead to incorrect behavior Could be better to have just one instance with a global point of reference 8-8

9 Design Heuristic Riel's Heuristic 4.1 Minimize the number of objects with which another object collaborates Worst case: The design has a collection of simple objects where each one uses all others Could one class contain several smaller objects? 8-9

10 A Meal Class Wrap 3 Smaller Classes cost() Melon Restaurant Patron cost() cost() Steak Pie cost() Meal Melon Restaurant Patron cost() cost() Steak cost() Pie 8-10

11 Meal Wrapper Class Encapsulation makes 4 messages look like one Containment simplifies things RestaurantPatron collaborates with one object now, instead of three 8-11

12 If you have instance variables, use them Containment implies a relationship, messages should be sent to contained objects If no messages are sent to a contained object, it doesn't belong, Put the attribute in the right class An exception: Container classes ArrayList, HashMap, TreeMap, and so on, may not send messages to their elements other than equals or compareto message Their job is to add, find, and remove elements 8-12

13 Don't use too many instance variables Most of the methods in a class should be using most of the instance variables most of the time If not, perhaps there should be two classes Classes should not contain more objects than a developer can fit in short term memory Maximum should be 7 plus or minus 2 That's about 5 to 9 instance variables 8-13

14 Contained objects don t talk to their containers A class must know what it contains, but the contained class should not know who contains it It's okay for a bedroom to know it has a clock, but the clock should not be dependent on the bedroom currentaccount should not send messages to Jukebox The JukeboxAccountCollection need not know it is contained in an instance of Jukebox All contained objects are loosely coupled they are not very dependent on each other 8-14

15 Use a Mediator to Coordinate Activities Objects that share lexical scope -- those in the same containment --need not have relationships between them Consider an ATM that contains a card reader and a display screen The card reader should not send a message to the display screen better reuse--could use the card reader software for a security entrance without taking the display screen 8-15

16 Violation Increases Complexity An ATM may contain card reader, display screen, and keypad The ATM should coordinate activities between these three objects Don t need additional collaborations ATM HaveACard? Card Reader getpin() Keypad displaypin() Display 8-16

17 Coupling Coupling: A measure of how strongly one class is connected to, has knowledge of, or relies upon other classes Low coupling: the class is not dependent on many other classes--good High Coupling: class is dependent on many others--bad A change to one class forces changes in others More difficult to understand a type in isolation Assign responsibilities so that coupling remains low 8-17

18 Which is the better design? If a POST object records an instance of Payment, perhaps the POST object constructs Payment Then POST asks Sale to add the new payment POST is coupled to Payment in the following design With this design, POST needs to know 2 classes makepayment() :POST 1: create() p : Payment 2: addpayment(p) :Sale 8-18

19 An alternative design Try associating Payment with Sale In both designs, Sale is coupled to Payment Low coupling favors this 2nd design makepayment() :POST 1: makepayment() :Sale 1.1. create() :Payment 8-19

20 Try to keep coupling low Common forms of coupling Class B has an instance of Class X Class B send a message to an instance of Class X Class B is a subclass of Class X (inheritance) Class B implements interface X So coupling does occur, in any OO program Dangerous case of high coupling: Allow one object to use ins. vars. of another type 8-20

21 Coupling Hard to say what high coupling is Will have some coupling: instance variables, one object asks another for help,

22 High Cohesion Assign responsibilities so that cohesion remains high cohesion: consistency, pulling together Cohesion: A measure of how strongly related and focused the responsibilities of a class are High functional cohesion is good Low cohesion is bad hard to understand hard to reuse hard to maintain fragile; constantly affected by change 8-22

23 Several types of cohesion Functional cohesion is when parts of a module are grouped because they all contribute to a single well-defined task of the module Examples Tokenizing a string of XML BankAccount has no blast off method Any well structured class (String) 8-23

24 High vs. Low Cohesion High functional cohesion exists when the elements of a class "all work together to provide some well-bounded behavior" Grady Booch Examples of low cohesion One class is responsible for many things in different functional areas Example: Model arranges views, builds menus,... One class has sole responsibility of one complex task in one functional area Example: Jukebox determines if a song can play, an account may play, play the mp3 by itself, maintain collections with add, find, remove,

25 High Cohesion A class has moderate responsibilities in one functional area and collaborates with other objects to fulfill tasks: e.g. PokerDealer coordinates but gets help from a deck of cards that can shuffle and deal cards the player that can figure out what to do next and knows what he or she can bet a view to show poker hands, pot, cards, animations Small number of methods, highly related functionality, doesn't do too much 8-25

26 Benefits of High Cohesion Design is clearer and more easily understood Maintenance (bug fixes, enhancements, changing business rules) is easier The fewer classes you touch the better Adele Goldberg High cohesion can help you attain lower coupling 8-26

27 Information Expert The most basic, general principle of assigning responsibilities (behavior/methods) is to Assign the responsibility to the object that has the information necessary to fulfill it. That which has the information, does the work. Who decides if the jukebox object can select? Important skill in OO Design: Which objects should do what? Find objects Assign responsibilities 8-27

28 Role Play a Scenario Jukebox: Now I need to determine whether or not the current user can play the selected Song. Who is responsible for knowing the playing time of any Song? Song: It seems like I should be responsible for knowing the duration of my Song. For example, it might take 3 minutes and 34 seconds to be completely played. I'll add the responsibility knowplaytime. Jukebox: Okay, now I should check to make sure the user is able to select this Song before telling the AudioFilePlayer to play it. I seem to remember I cannot simply play a Song without checking on a few things. I know the current JukeboxAccount and the selected Song. What do I do now? 8-28

29 Alternative #1 JukeBox: So tell me Song, how many minutes and seconds do you require to be played? Song: 3 minutes and 34 seconds. JukeBox: JukeboxAccount, do you have 3 minutes and 34 seconds credit? JukeboxAccount: I'll be responsible for maintaining remaining time credit, so I can answer that, Yes, I have enough credit. JukeBox: JukeboxAccount, have you played fewer than 2 Songs? JukeboxAccount : I have not played 2 songs today. JukeBox: Okay, now we can play the Song. Here it is AudioFilePlayer. AudioFilePlayer : Okay JukeBox, I am willing and able to play this Song. I'll take care of the playtrack(string filename) responsibility 8-29

30 Alternative #2 JukeBox: JukeboxAccount, can you play this Song? JukeBoxAccount: It feels as though I should be responsible for maintaining my own time credit, it seems appropriate that I should also know how many Songs I've played today. So I should be able to do some simple calculations to give you the answer you seek. Yes JukeBox, I can play the Song you sent me. I'll add these responsibilities to my CRC card: know how much time credit I have left know how many Songs I've played on this date respond to a message like this: JukeboxAccount.canSelect(currentTrack) 8-30

Information Expert (or Expert)

Information Expert (or Expert) Page 2 Page 3 Pattern or Principle? Information Expert (or Expert) Class Responsibility Sale Knows Sale total SalesLineItem Knows line item total ProductDescription Knows product price The GRASP patterns

More information

CSE 403 Lecture 8. UML Class Diagrams. Thanks to Marty Stepp, Michael Ernst, and other past instructors of CSE 403

CSE 403 Lecture 8. UML Class Diagrams. Thanks to Marty Stepp, Michael Ernst, and other past instructors of CSE 403 CSE 403 Lecture 8 UML Class Diagrams Thanks to Marty Stepp, Michael Ernst, and other past instructors of CSE 403 http://www.cs.washington.edu/403/ See also: Object-Oriented Design Heuristics by Arthur

More information

Principles of Software Construction: Objects, Design, and Concurrency. Assigning Responsibilities to Objects. toad. Jonathan Aldrich Charlie Garrod

Principles of Software Construction: Objects, Design, and Concurrency. Assigning Responsibilities to Objects. toad. Jonathan Aldrich Charlie Garrod Principles of Software Construction: Objects, Design, and Concurrency Assigning Responsibilities to Objects toad Fall 2014 Jonathan Aldrich Charlie Garrod School of Computer Science Key concepts from Thursday

More information

GRASP: Patterns for. chapter18

GRASP: Patterns for. chapter18 GRASP: Patterns for assigning responsibility chapter18 1 Chapter Objectives Learn about design patterns Learn how to apply five GRASP patterns 2 Building Collaboration diagrams System Design: how the system

More information

Expanding Our Horizons. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 9 09/25/2011

Expanding Our Horizons. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 9 09/25/2011 Expanding Our Horizons CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 9 09/25/2011 1 Goals of the Lecture Cover the material in Chapter 8 of our textbook New perspective on objects and encapsulation

More information

Last Time: Object Design. Comp435 Object-Oriented Design. Last Time: Responsibilities. Last Time: Creator. Last Time: The 9 GRASP Patterns

Last Time: Object Design. Comp435 Object-Oriented Design. Last Time: Responsibilities. Last Time: Creator. Last Time: The 9 GRASP Patterns Last Time: Object Design Comp435 Object-Oriented Design Week 7 Computer Science PSU HBG The main idea RDD: Responsibility-Driven Design Identify responsibilities Assign them to classes and objects Responsibilities

More information

FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011

FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011 FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011 1 Goals of the Lecture Introduce two design patterns Facade Adapter Compare and contrast the two patterns 2 Facade

More information

ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE

ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE ADVANCED SOFTWARE DESIGN LECTURE 4 SOFTWARE ARCHITECTURE Dave Clarke 1 THIS LECTURE At the end of this lecture you will know notations for expressing software architecture the design principles of cohesion

More information

CHAPTER 5 GENERAL OOP CONCEPTS

CHAPTER 5 GENERAL OOP CONCEPTS CHAPTER 5 GENERAL OOP CONCEPTS EVOLUTION OF SOFTWARE A PROGRAMMING LANGUAGE SHOULD SERVE 2 RELATED PURPOSES : 1. It should provide a vehicle for programmer to specify actions to be executed. 2. It should

More information

Object-Oriented Technology. Rick Mercer

Object-Oriented Technology. Rick Mercer Object-Oriented Technology Rick Mercer 1 Object-Oriented Technology: Outline Consider a few ways in which data is protected from careless modification Mention the key features object-oriented style of

More information

CS 170 Java Programming 1. Week 15: Interfaces and Exceptions

CS 170 Java Programming 1. Week 15: Interfaces and Exceptions CS 170 Java Programming 1 Week 15: Interfaces and Exceptions Your "IC" or "Lab" Document Use Word or OpenOffice to create a new document Save the file as IC15.doc (Office 97-2003 compatible) Place on your

More information

Object Analysis & Design in the textbook. Introduction to GRASP: Assigning Responsibilities to Objects. Responsibility-Driven Design

Object Analysis & Design in the textbook. Introduction to GRASP: Assigning Responsibilities to Objects. Responsibility-Driven Design Object Analysis & Design in the textbook Chapter 2 Object Oriented Design Process Introduction to GRASP: Assigning Responsibilities to Objects CS 4354 Summer II 2016 Jill Seaman Much of the material in

More information

PRINCIPLES OF SOFTWARE DESIGN

PRINCIPLES OF SOFTWARE DESIGN F. Tip and M. Weintraub PRINCIPLES OF SOFTWARE DESIGN Thanks go to Andreas Zeller for allowing incorporation of his materials THE CHALLENGE 1. Software may live much longer than expected 2. Software must

More information

Assigning Responsibilities (Patterns of Responsibility Assignment Principles: GRASP)

Assigning Responsibilities (Patterns of Responsibility Assignment Principles: GRASP) Subsystem design basics Assigning Responsibilities (Patterns of Responsibility Assignment Principles: GRASP) Dept. of Computer Science Baylor University Focus on modeling how subsystems accomplish goals

More information

Fundamental Concepts (Principles) of Object Oriented Programming These slides are based on:

Fundamental Concepts (Principles) of Object Oriented Programming These slides are based on: 1 Fundamental Concepts (Principles) of Object Oriented Programming These slides are based on: [1] Timothy A. Budd, Oregon State University, Corvallis, Oregon, [Available] ClickMe, September 2001. 2 What

More information

Patterns and Testing

Patterns and Testing and Lecture # 7 Department of Computer Science and Technology University of Bedfordshire Written by David Goodwin, based on the lectures of Marc Conrad and Dayou Li and on the book Applying UML and (3

More information

COMP 6471 Software Design Methodologies

COMP 6471 Software Design Methodologies COMP 6471 Software Design Methodologies Fall 2011 Dr Greg Butler http://www.cs.concordia.ca/~gregb/home/comp6471-fall2011.html Page 2 Sample UP Artifact Relationships Domain Model Context Business Modeling

More information

02. OBSERVER PATTERN. Keep your Objects in the know. Don t miss out when something interesting happens

02. OBSERVER PATTERN. Keep your Objects in the know. Don t miss out when something interesting happens BIM492 DESIGN PATTERNS 02. OBSERVER PATTERN Keep your Objects in the know Don t miss out when something interesting happens Congrats! Your team has just won the contract to build Weather-O-Rama, Inc. s

More information

GRASP Design Patterns A.A. 2018/2019

GRASP Design Patterns A.A. 2018/2019 GRASP Design Patterns A.A. 2018/2019 Objectives Introducing design patterns Introduzione ai design pattern Designing objects and responsibilities GRASP design patterns A long corridor A passage room Does

More information

Design Patterns. CSC207 Winter 2017

Design Patterns. CSC207 Winter 2017 Design Patterns CSC207 Winter 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe

More information

Object-Oriented Programming and Design

Object-Oriented Programming and Design C Sc 335 Course Overview Object-Oriented Programming and Design Rick Mercer Major Topics in C Sc 335 1. Java 2. Object-Oriented Programming 3. Object-Oriented Design 4. Technology 5. Object-Oriented Principles

More information

Thread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections

Thread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections Thread Safety Today o Confinement o Threadsafe datatypes Required reading Concurrency Wrapper Collections Optional reading The material in this lecture and the next lecture is inspired by an excellent

More information

CS342: Software Design. November 21, 2017

CS342: Software Design. November 21, 2017 CS342: Software Design November 21, 2017 Runnable interface: create threading object Thread is a flow of control within a program Thread vs. process All execution in Java is associated with a Thread object.

More information

CSE 70 Final Exam Fall 2009

CSE 70 Final Exam Fall 2009 Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15

More information

Summary. Recursion. Overall Assignment Description. Part 1: Recursively Searching Files and Directories

Summary. Recursion. Overall Assignment Description. Part 1: Recursively Searching Files and Directories Recursion Overall Assignment Description This assignment consists of two parts, both dealing with recursion. In the first, you will write a program that recursively searches a directory tree. In the second,

More information

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible

Inheritance. EEC 521: Software Engineering. Dealing with Change. Polymorphism. Software Design. Changing requirements Code needs to be flexible Inheritance EEC 521: Software Engineering Software Design Design Patterns: Decoupling Dependencies 10/15/09 EEC 521: Software Engineering 1 Inheritance is the mechanism by which one class can acquire properties/responsibilities

More information

Introduction to Python Code Quality

Introduction to Python Code Quality Introduction to Python Code Quality Clarity and readability are important (easter egg: type import this at the Python prompt), as well as extensibility, meaning code that can be easily enhanced and extended.

More information

Object-Oriented Concepts and Design Principles

Object-Oriented Concepts and Design Principles Object-Oriented Concepts and Design Principles Signature Specifying an object operation or method involves declaring its name, the objects it takes as parameters and its return value. Known as an operation

More information

STAUNING Credit Application Internet Sales Process with /Voic Templates to Non-Responsive Prospects 2018 Edition

STAUNING Credit Application Internet Sales Process with  /Voic Templates to Non-Responsive Prospects 2018 Edition STAUNING Credit Application Internet Sales Process with Email/Voicemail Templates to Non-Responsive Prospects 2018 Edition Contents 30-DAY CREDIT APPLICATION INTERNET SALES PROCESS... 2 DAY 1 AUTO-RESPONSE

More information

CSE 331. Guidelines for Class Design

CSE 331. Guidelines for Class Design CSE 331 Guidelines for Class Design slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/ 1 What is class design? class

More information

Google Groups. Using, joining, creating, and sharing. content with groups. What's Google Groups? About Google Groups and Google Contacts

Google Groups. Using, joining, creating, and sharing. content with groups. What's Google Groups? About Google Groups and Google Contacts Google Groups Using, joining, creating, and sharing content with groups What's Google Groups? Google Groups is a feature of Google Apps that makes it easy to communicate and collaborate with groups of

More information

Comp-304 : Object-Oriented Design What does it mean to be Object Oriented?

Comp-304 : Object-Oriented Design What does it mean to be Object Oriented? Comp-304 : Object-Oriented Design What does it mean to be Object Oriented? What does it mean to be OO? What are the characteristics of Object Oriented programs (later: OO design)? What does Object Oriented

More information

Object Fundamentals Part Two. Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 3 09/01/2009

Object Fundamentals Part Two. Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 3 09/01/2009 Object Fundamentals Part Two Kenneth M. Anderson University of Colorado, Boulder CSCI 4448/5448 Lecture 3 09/01/2009 1 Lecture Goals Continue our tour of the basic concepts, terminology, and notations

More information

Create your first workbook

Create your first workbook Create your first workbook You've been asked to enter data in Excel, but you've never worked with Excel. Where do you begin? Or perhaps you have worked in Excel a time or two, but you still wonder how

More information

Intro to: Design Principles

Intro to: Design Principles Intro to: Design Principles Pragmatic Programmer: Eliminate Effects Between Unrelated Things design components that are: self-contained, independent, and have a single, well-defined purpose Software Design

More information

Understading Refactorings

Understading Refactorings Understading Refactorings Ricardo Terra terra@dcc.ufmg.br Marco Túlio Valente mtov@dcc.ufmg.br UFMG, 2010 UFMG, 2010 Understanding Refactorings 1 / 36 Agenda 1 Overview 2 Refactoring 3 Final Considerations

More information

On to Object-oriented Design

On to Object-oriented Design Dr. Michael Eichberg Software Engineering Department of Computer Science Technische Universität Darmstadt Software Engineering On to Object-oriented Design Object-oriented Design 2 A popular way of thinking

More information

INTERNAL ASSESSMENT TEST III Answer Schema

INTERNAL ASSESSMENT TEST III Answer Schema INTERNAL ASSESSMENT TEST III Answer Schema Subject& Code: Object-Oriented Modeling and Design (15CS551) Sem: V ISE (A & B) Q. No. Questions Marks 1. a. Ans Explain the steps or iterations involved in object

More information

CS342: Software Design. Oct 9, 2017

CS342: Software Design. Oct 9, 2017 CS342: Software Design Oct 9, 2017 Outline Facade pattern Observer pattern Homework 1 classes Human player replaces a card 1. Main UserPlayer 2. Main ->CardPile 3. CardPile -> Card -> Main 4. Main

More information

Konark - Writing a KONARK Sample Application

Konark - Writing a KONARK Sample Application icta.ufl.edu http://www.icta.ufl.edu/konarkapp.htm Konark - Writing a KONARK Sample Application We are now going to go through some steps to make a sample application. Hopefully I can shed some insight

More information

1: Introduction to Object (1)

1: Introduction to Object (1) 1: Introduction to Object (1) 김동원 2003.01.20 Overview (1) The progress of abstraction Smalltalk Class & Object Interface The hidden implementation Reusing the implementation Inheritance: Reusing the interface

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Department of Computer Engineering Lecture 12: Object-Oriented Principles Sharif University of Technology 1 Open Closed Principle (OCP) Classes should be open for extension but closed

More information

Object Visibility: Making the Necessary Connections

Object Visibility: Making the Necessary Connections Object Visibility: Making the Necessary Connections Reprinted from the October 1991 issue of The Smalltalk Report Vol. 2, No. 2 By: Rebecca J. Wirfs-Brock An exploratory design is by no means complete.

More information

Exam Questions. Object-Oriented Design, IV1350. Maximum exam score is 100, grade limits are as follows. Score Grade 90 A 80 B 70 C 60 D 50 E

Exam Questions. Object-Oriented Design, IV1350. Maximum exam score is 100, grade limits are as follows. Score Grade 90 A 80 B 70 C 60 D 50 E Object-Oriented Design, IV1350 Maximum exam score is 100, grade limits are as follows. Score Grade 90 A 80 B 70 C 60 D 50 E The exam questions will be a subset of the questions below. The exam may contain

More information

From video conversation 2. This is a gap fill exercise and can be used as either a quiz/test of

From video conversation 2. This is a gap fill exercise and can be used as either a quiz/test of Teacher s guide to the quizzes/tests available for Unit 4 Quiz 1 Quiz 2 Quiz 3 Quiz 4 From video conversation 1. This is a gap fill exercise and can be used as either a quiz/test of target language acquisition,

More information

2 GRASP Patterns and basic OO Design. Roel Wuyts OASS

2 GRASP Patterns and basic OO Design. Roel Wuyts OASS 2 GRASP Patterns and basic OO Design Roel Wuyts OASS1 2009-2010 Patterns 2 Bit of history... Christoffer Alexander The Timeless Way of Building, Christoffer Alexander, Oxford University Press, 1979, ISBN

More information

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL

The Unified Modeling Language. Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL The Unified Modeling Language Asst.Prof.Dr. Supakit Nootyaskool IT-KMITL UML: requirement VS. Design models Identify 2 All the classes or things Elementary business process Necessary step to carry out

More information

Software Design Heuristics

Software Design Heuristics Software Design Heuristics Software Design Heuristics CONTENT 1. Introduction 2. Encapsulation/Information Hiding 3. Strong Cohesion 4. Loose Dr. Samira Sadaoui 1 Introduction Introduction Software Design

More information

Object Design with GoF Patterns, continued. Curt Clifton Rose-Hulman Institute of Technology

Object Design with GoF Patterns, continued. Curt Clifton Rose-Hulman Institute of Technology Object Design with GoF Patterns, continued Curt Clifton Rose-Hulman Institute of Technology Applying Patterns to NextGen POS Iteration 3 Local caching Used Adapter and Factory Failover to local services

More information

The 10 Minute Guide to Object Oriented Programming

The 10 Minute Guide to Object Oriented Programming The 10 Minute Guide to Object Oriented Programming Why read this? Because the main concepts of object oriented programming (or OOP), often crop up in interviews, and all programmers should be able to rattle

More information

Design Process Overview. At Each Level of Abstraction. Design Phases. Design Phases James M. Bieman

Design Process Overview. At Each Level of Abstraction. Design Phases. Design Phases James M. Bieman CS314, Colorado State University Software Engineering Notes 4: Principles of Design and Architecture for OO Software Focus: Determining the Overall Structure of a Software System Describes the process

More information

Design Patterns. CSC207 Fall 2017

Design Patterns. CSC207 Fall 2017 Design Patterns CSC207 Fall 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe the

More information

On to Object-oriented Design

On to Object-oriented Design Dr. Michael Eichberg Software Technology Group Department of Computer Science Technische Universität Darmstadt Introduction to Software Engineering On to Object-oriented Design Object-oriented Design 2

More information

17. GRASP: Designing Objects with Responsibilities

17. GRASP: Designing Objects with Responsibilities 17. GRASP: Designing Objects with Responsibilities Objectives Learn to apply five of the GRASP principles or patterns for OOD. Dr. Ziad Kobti School of Computer Science University of Windsor Understanding

More information

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis

OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis UNIT I INTRODUCTION OBJECT ORIENTED SYSTEM DEVELOPMENT Software Development Dynamic System Development Information system solution Steps in System Development Analysis Design Implementation Testing Maintenance

More information

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator.

Keywords: Abstract Factory, Singleton, Factory Method, Prototype, Builder, Composite, Flyweight, Decorator. Comparative Study In Utilization Of Creational And Structural Design Patterns In Solving Design Problems K.Wseem Abrar M.Tech., Student, Dept. of CSE, Amina Institute of Technology, Shamirpet, Hyderabad

More information

P1_L3 Operating Systems Security Page 1

P1_L3 Operating Systems Security Page 1 P1_L3 Operating Systems Security Page 1 that is done by the operating system. systems. The operating system plays a really critical role in protecting resources in a computer system. Resources such as

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration

More information

The Software Design Process. CSCE 315 Programming Studio, Fall 2017 Tanzir Ahmed

The Software Design Process. CSCE 315 Programming Studio, Fall 2017 Tanzir Ahmed The Software Design Process CSCE 315 Programming Studio, Fall 2017 Tanzir Ahmed Outline Challenges in Design Design Concepts Heuristics Practices Challenges in Design A problem that can only be defined

More information

CS 160: Evaluation. Professor John Canny Spring /15/2006 1

CS 160: Evaluation. Professor John Canny Spring /15/2006 1 CS 160: Evaluation Professor John Canny Spring 2006 2/15/2006 1 Outline User testing process Severity and Cost ratings Discount usability methods Heuristic evaluation HE vs. user testing 2/15/2006 2 Outline

More information

Object-Oriented Software Development

Object-Oriented Software Development Chapter Sixteen Object-Oriented Software Development Inheritance and Polymorphism Summing Up The previous chapter introduced dynamic memory allocation and a linked list. The notions of indirection and

More information

Object- Oriented Design with UML and Java Part I: Fundamentals

Object- Oriented Design with UML and Java Part I: Fundamentals Object- Oriented Design with UML and Java Part I: Fundamentals University of Colorado 1999-2002 CSCI-4448 - Object-Oriented Programming and Design These notes as free PDF files: http://www.softwarefederation.com/cs4448.html

More information

Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts. Object-Oriented Design CRC Cards - UML class diagrams

Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts. Object-Oriented Design CRC Cards - UML class diagrams Review: Cohesion and Coupling, Mutable, Inheritance Screen Layouts Software methodologies Extreme Programming Object-Oriented Design CRC Cards - UML class diagrams Analysis Design Implementation Software

More information

Design Pattern- Creational pattern 2015

Design Pattern- Creational pattern 2015 Creational Patterns Abstracts instantiation process Makes system independent of how its objects are created composed represented Encapsulates knowledge about which concrete classes the system uses Hides

More information

How to Improve Your Campaign Conversion Rates

How to Improve Your  Campaign Conversion Rates How to Improve Your Email Campaign Conversion Rates Chris Williams Author of 7 Figure Business Models How to Exponentially Increase Conversion Rates I'm going to teach you my system for optimizing an email

More information

Digital Marketing Manager, Marketing Manager, Agency Owner. Bachelors in Marketing, Advertising, Communications, or equivalent experience

Digital Marketing Manager, Marketing Manager, Agency Owner. Bachelors in Marketing, Advertising, Communications, or equivalent experience Persona name Amanda Industry, geographic or other segments B2B Roles Digital Marketing Manager, Marketing Manager, Agency Owner Reports to VP Marketing or Agency Owner Education Bachelors in Marketing,

More information

References: Applying UML and patterns Craig Larman

References: Applying UML and patterns Craig Larman References: Applying UML and patterns Craig Larman 1 2 What are patterns? Principles and solutions codified in a structured format describing a problem and a solution A named problem/solution pair that

More information

Core Java Syllabus. Pre-requisite / Target Audience: C language skills (Good to Have)

Core Java Syllabus. Pre-requisite / Target Audience: C language skills (Good to Have) Overview: Java programming language is developed by Sun Microsystems. Java is object oriented, platform independent, simple, secure, architectural neutral, portable, robust, multi-threaded, high performance,

More information

Outline. Operating System Security CS 239 Computer Security February 23, Introduction. Server Machines Vs. General Purpose Machines

Outline. Operating System Security CS 239 Computer Security February 23, Introduction. Server Machines Vs. General Purpose Machines Outline Operating System Security CS 239 Computer Security February 23, 2004 Introduction Memory protection Interprocess communications protection File protection Page 1 Page 2 Introduction Why Is OS Security

More information

OO design. Classes, Responsibilities, Collaborations (CRC) 13/9/1999 COSC

OO design. Classes, Responsibilities, Collaborations (CRC) 13/9/1999 COSC OO design Classes, Responsibilities, Collaborations (CRC) 1 bank accounts the system to be modelled: bank accounts with differing fee structures purpose: evaluate different account types with respect to

More information

Responders Users Guide

Responders Users Guide Volume 1 SPOTTED DOG TECHNOLOGIES RoVER Responders Users Guide R O V E R Responders Users Guide Copyright 2009, 2010 Trumbull Software Associates PO Box 844 Monroe, CT 06468 Table of Contents Introduction...

More information

Cheng, CSE870. More Frameworks. Overview. Recap on OOP. Acknowledgements:

Cheng, CSE870. More Frameworks. Overview. Recap on OOP. Acknowledgements: More Frameworks Acknowledgements: K. Stirewalt. Johnson, B. Foote Johnson, Fayad, Schmidt Overview eview of object-oriented programming (OOP) principles. Intro to OO frameworks: o Key characteristics.

More information

TABLE OF CONTENTS. TECHNICAL SUPPORT APPENDIX Appendix A Formulas And Cell Links Appendix B Version 1.1 Formula Revisions...

TABLE OF CONTENTS. TECHNICAL SUPPORT APPENDIX Appendix A Formulas And Cell Links Appendix B Version 1.1 Formula Revisions... SPARC S INSTRUCTIONS For Version 1.1 UNITED STATES DEPARTMENT OF AGRICULTURE Forest Service By Todd Rivas December 29, 1999 TABLE OF CONTENTS WHAT IS SPARC S?... 1 Definition And History... 1 Features...

More information

2. Classes & Inheritance. Classes. Classes. Éric Tanter Objects and Design in Smalltalk. How do you create objects?

2. Classes & Inheritance. Classes. Classes. Éric Tanter Objects and Design in Smalltalk. How do you create objects? Objects and Design in Smalltalk 2. Classes & Inheritance Éric Tanter etanter@dcc.uchile.cl 1 Classes How do you create objects? Ex-nihilo in prototype-based languages With a class in class-based languages

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

Accessibility Interview Questions:

Accessibility Interview Questions: Accessibility Interview s: When hiring staff, you can question them about their general accessibility knowledge during the interview process. Though typically not a requirement for most jobs, accessibility

More information

Chapter 10 Object-Oriented Design Principles

Chapter 10 Object-Oriented Design Principles Chapter 10 Object-Oriented Design Principles Dr. Supakit Nootyaskool Faculty of Information Technology King Mongkut s Institute of Technology Ladkrabang Outline Object-oriented design: bridging from analysis

More information

Software Design Fundamentals. CSCE Lecture 11-09/27/2016

Software Design Fundamentals. CSCE Lecture 11-09/27/2016 Software Design Fundamentals CSCE 740 - Lecture 11-09/27/2016 Today s Goals Define design Introduce the design process Overview of design criteria What results in a good design? Gregory Gay CSCE 740 -

More information

CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D

CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D CTIS 359 Principles of Software Engineering SOFTWARE DESIGN OO(A)D Today s Objectives To explain the basic concepts of OO(A)D To describe some best practices regarding to OO(A)D What is NOT UML? The UML

More information

05. SINGLETON PATTERN. One of a Kind Objects

05. SINGLETON PATTERN. One of a Kind Objects BIM492 DESIGN PATTERNS 05. SINGLETON PATTERN One of a Kind Objects Developer: What use is that? Guru: There are many objects we only need one of: thread pools, caches, dialog boxes, objects that handle

More information

Assigning Responsibilities by Larman

Assigning Responsibilities by Larman Assigning Responsibilities by Larman Core design activity: The identification of objects and responsibilities and providing a solution in terms of an interaction diagram this is the creative part where

More information

Principles of Object-Oriented Design

Principles of Object-Oriented Design Principles of Object-Oriented Design 1 The Object-Oriented... Hype What are object-oriented (OO) methods? OO methods provide a set of techniques for analysing, decomposing, and modularising software system

More information

Analysis of the Test Driven Development by Example

Analysis of the Test Driven Development by Example Computer Science and Applications 1 (2013) 5-13 Aleksandar Bulajic and Radoslav Stojic The Faculty of Information Technology, Metropolitan University, Belgrade, 11000, Serbia Received: June 18, 2013 /

More information

Maintainable Software. Software Engineering Andreas Zeller, Saarland University

Maintainable Software. Software Engineering Andreas Zeller, Saarland University Maintainable Software Software Engineering Andreas Zeller, Saarland University The Challenge Software may live much longer than expected Software must be continuously adapted to a changing environment

More information

Model-Based Systems Engineering: Documentation and Analysis

Model-Based Systems Engineering: Documentation and Analysis Week 1: What Is MBSE? Project Name Jane Doe 1 Instructions Before you begin, you should save your Project Portfolio on your local drive. We recommend the following format: Lastname_Firstname_Course3_Week1

More information

Semantic Analysis. Lecture 9. February 7, 2018

Semantic Analysis. Lecture 9. February 7, 2018 Semantic Analysis Lecture 9 February 7, 2018 Midterm 1 Compiler Stages 12 / 14 COOL Programming 10 / 12 Regular Languages 26 / 30 Context-free Languages 17 / 21 Parsing 20 / 23 Extra Credit 4 / 6 Average

More information

PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 05.2 GOOD DESIGN = FLEXIBLE SOFTWARE. Give Your Software a 30-minute Workout

PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 05.2 GOOD DESIGN = FLEXIBLE SOFTWARE. Give Your Software a 30-minute Workout PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 05.2 GOOD DESIGN = FLEXIBLE SOFTWARE Give Your Software a 30-minute Workout previously on bim 209 Rick s Guitars is expanding previously on bim 209 3

More information

Responsibility Driven Design

Responsibility Driven Design Responsibility Driven Design Responsibility Driven Design, Rebecca Wirfs Brock, 1990 The Coffee Machine Design Problem, Alistair Cockburn, C/C++ User's Journal, May and June 1998. Introducing Object-Oriented

More information

ADVANCED SOFTWARE DESIGN LECTURE 4 GRASP. Dave Clarke

ADVANCED SOFTWARE DESIGN LECTURE 4 GRASP. Dave Clarke ADVANCED SOFTWARE DESIGN LECTURE 4 GRASP Dave Clarke TODAY S LECTURE We will discuss and apply the GRASP design patterns. These provide principles for evaluating and improving designs. friends User Name??

More information

Design Patterns. Gunnar Gotshalks A4-1

Design Patterns. Gunnar Gotshalks A4-1 Design Patterns A4-1 On Design Patterns A design pattern systematically names, explains and evaluates an important and recurring design problem and its solution Good designers know not to solve every problem

More information

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation Module Outline Fundamentals of Object Positioning Object Oriented Analysis Fundamentals of Object 1. Encapsulation 2. Abstraction 3. Inheritance 4. Polymorphism The need of Modeling Unified modeling language

More information

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.

Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple magazine data system. Milestones:

More information

Object interconnections גרא וייס המחלקה למדעי המחשב אוניברסיטת בן-גוריון

Object interconnections גרא וייס המחלקה למדעי המחשב אוניברסיטת בן-גוריון Object interconnections גרא וייס המחלקה למדעי המחשב אוניברסיטת בן-גוריון 2 Roadmap In this chapter we move up a level of abstraction, and consider collections of objects working together Our focus will

More information

JUnit Test Patterns in Rational XDE

JUnit Test Patterns in Rational XDE Copyright Rational Software 2002 http://www.therationaledge.com/content/oct_02/t_junittestpatternsxde_fh.jsp JUnit Test Patterns in Rational XDE by Frank Hagenson Independent Consultant Northern Ireland

More information

Close Your File Template

Close Your File Template In every sale there is always a scenario where I can t get someone to respond. No matter what I do. I can t get an answer from them. When people stop responding I use the Permission To. This is one of

More information

Music Recommendation System

Music Recommendation System Music Recommendation System Using Genetic Algorithm Date > May 26, 2009 Kim Presenter > Hyun-Tae Kim Contents 1. Introduction 2. Related Work 3. Music Recommendation System - A s MUSIC 4. Conclusion Introduction

More information

Business Writing In English

Business Writing In English Business Writing In English It isn t always easy to write a clear, concise e-mail or a formal letter in another language. Often, we know words and phrases we should use, but putting everything together

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 20: GoF Design Patterns Creational 1 Software Patterns Software Patterns support reuse of software architecture and design. Patterns capture the static

More information

Relay For Life Fundraising

Relay For Life Fundraising Relay For Life Fundraising The Art and Science of Asking for Donations Relay For Life Online Committee Table of Contents TABLE OF CONTENTS... 2 INTRODUCTION... 3 THE ART OR HUMAN SIDE OF ASKING... 4 THERE

More information

CS 160: Evaluation. Outline. Outline. Iterative Design. Preparing for a User Test. User Test

CS 160: Evaluation. Outline. Outline. Iterative Design. Preparing for a User Test. User Test CS 160: Evaluation Professor John Canny Spring 2006 2/15/2006 1 2/15/2006 2 Iterative Design Prototype low-fi paper, DENIM Design task analysis contextual inquiry scenarios sketching 2/15/2006 3 Evaluate

More information