Kate Gregory1 Week 3 Lab 1 due now Finding Classes in your System CRC Cards Collaboration Diagrams Lab 2.

Slides:



Advertisements
Similar presentations
From use cases to classes (in UML). A use case for writing use cases Use case: writing a use case Actors: analyst, client(s) Client identifies and write.
Advertisements

1COM6030 Systems Analysis and Design © University of Sheffield 2005 COM 6030 Software Analysis and Design Lecture 7 – More on use cases and activity diagrams.
Systems Analysis and Design 8th Edition
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Week 2 Concepts normally in week 1 Software Development Life Cycle Use Cases Lab project Lab 1 Kate Gregory.
Information System Engineering
1 Classes. 2 Finding classes w Choosing classes is first step in defining essence of problem w If you can recognize an abstraction, you’ve found a candidate.
Objects First With Java A Practical Introduction Using BlueJ Designing object-oriented programs How to write code in a way that is easily understandable,
Algorithms and Problem Solving-1 Algorithms and Problem Solving.
From Class Diagrams to Databases. So far we have considered “objects” Objects have attributes Objects have operations Attributes are the things you record.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Lecture 4 Class Responsibility Collaboration Cards
Object Oriented Analysis Process
COMP1007 Intro to Systems Requirements © Copyright De Montfort University 2002 All Rights Reserved COMP1007 Intro to Systems Requirements Lecture 4 Identifying.
University of Toronto Department of Computer Science © Steve Easterbrook. This presentation is available free for non-commercial use with attribution.
Requirements Analysis 2 What objects collaborate to achieve the goal of a use case?
NJIT 1 Domain Model Visualizing Concepts Chapter 9 Applying UML and Patterns Craig Larman.
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Database Design Concepts Info 1408 Lecture 2 An Introduction to Data Storage.
Object-Oriented Development Process Part I: Requirement Gathering Warsun Najib Department of Electrical Engineering Gadjah Mada University.
Introductory case study. 2 The problem The most difficult part of any design project is understanding the task you are attempting You have been contacted.
Sharif University of Technology Session # 7.  Contents  Systems Analysis and Design  Planning the approach  Asking questions and collecting data 
Software Engineering Case Study Slide 1 Introductory case study.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
OO Analysis and Design CMPS OOA/OOD Cursory explanation of OOP emphasizes ▫ Syntax  classes, inheritance, message passing, virtual, static Most.
Use Cases 2 ENGR ♯10 Peter Andreae
Use Cases College of Alameda Copyright © 2007 Patrick McDermott.
Systems Analysis and Design in a Changing World, 6th Edition
1 BTS330 Vision and Scope. √ Determine a vision for the business √ Create initial use-case model showing key actors and use cases by business area Benefits.
Big Java Chapter 12. Software Process - Waterfall Analysis Design Implementation Testing Deployment Does not work well when rigidly applied! established.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2012 John Wiley & Sons, Inc. All rights.
1  Object Modeling Crash Course  Object Analysis –Classification –Identifying Object Relationships, Attributes, and Methods  Class Diagrams Agenda.
1 Object-Oriented Analysis Use Case Driven. 2 The outline method for OOA 1.Identify object classes within the problem domain 2.Define the behaviour of.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
 A software application is like a city  Modeling = Architecture  OOP = Civil Engineering  UML Classes = Blueprints of Buildings  UML is a common.
Object oriented classification Classification is the process of checking to see if an object belongs to a category or a class, is regarded as a basic attribute.
Requirements Analysis and Design Engineering Southern Methodist University CSE 7313.
Systems Analysis & Design 7 th Edition Chapter 5.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
Kate Gregory1 Week 4 Lab 2 due now Why document? Unified Modeling Language Class diagrams.
CS Overview of CRC CS 4311 B. Beck and W. Cunningham, A Laboratory for Teaching Object-Oriented Thinking, OOPSLA ’89, October 1-6, R. Wirfs-Brock,
Kate Gregory Week 10 State diagrams Activity Diagrams Summary and Conclusion / The Future Critique discussion Lab 4 is marked.
Chapter 9 Applying UML and Patterns -Craig Larman
INFO1408 Database Design Concepts Week 15: Introduction to Database Management Systems.
Week 9 Lab 4 due now Design Patterns Good Design Modules and Packages –Deployment diagram –Component diagram SOLID Principles Metrics Lab 5 available –
Systems Analysis and Design in a Changing World, 6th Edition
1 System Analysis and Design Using UML INSTRUCTOR: Jesmin Akhter Lecturer, IIT, JU.
Object Oriented Analysis and Design COM327 week 7 COM252 week 1 Register! (Not petition!)
Kate Gregory Week 8 Midterm discussion Interaction / Sequence Diagrams Design Patterns RAII Lab 4.
1 Examining Execution Sequences Introducing Sequence Diagrams.
Kate Gregory Week 6 Lab 3 due now –Rating your group Inheritance Multiple Inheritance Polymorphism Midterm Review.
Analysis Modeling CpSc 372: Introduction to Software Engineering
Kate Gregory Week 5 Static Object Model –Attributes –Methods –Associations –Visibility Lab 3 available –Rating your group.
CSC480 Software Engineering Lecture 8-9 September 20, 2002.
MODULE:VII OBJECT ANALYSIS: CLASSIFICATION
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
Identification of Classes. Object Oriented Analysis (OOA) OOA is process by which we identify classes that play role in achieving system goals & requirements.
Documentation An effective document can serve as a communication vehicle among the project's team members, or it can serve as initial understanding of.
CHAPTER 6 OBJECT ANALYSIS.
Requirements capture: Using UML Use Cases David Millard and Yvonne Howard {dem,
An informal, team oriented, OO design system
Elaboration popo.
Week 10: Object Modeling (1)Use Case Model
Object Analysis: Classification
OO Domain Modeling With UML Class Diagrams and CRC Cards
OO Domain Modeling With UML Class Diagrams and CRC Cards
Chapter 11 Following the Trail; Examining Execution Sequences
Algorithms and Problem Solving
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

Kate Gregory1 Week 3 Lab 1 due now Finding Classes in your System CRC Cards Collaboration Diagrams Lab 2

DateWeekTopicHand OutDue BackTest 6-Sep-131Administrivia / Overview / Motivation, benefits of OO 13-Sep-132Use CasesLab 1: Use cases 20-Sep-133CRC Cards, collab graphsLab 2: CRC cardslab 1 5% 27-Sep-13 4start class diaglab 2 5% 4-Oct-135Finish class diag, AssociationsLab 3: Class Diag 11-Oct-136Inh & Polymorphism / midterm reviewlab 3 5% 18-Oct-137midtermMidterm 25% 25-Oct-13Reading Break 1-Nov-138Interaction diag / Design PatternsLab 4: Interaction Diag 8-Nov-139Good Design / Modules & Packages / Deployment and component diagrams /Metrics / SOLID Lab 5: Critiqueslab 4 5% 15-Nov-1310State diagrams / Activity diagrams / Summary and Conclusion / The Future 22-Nov-1311Critiquescritique lab (before class) 15% 29-Nov-1312Critiques TBDFinal ExamFinal 40%

Need Meeting Space? If you are having trouble finding a quiet place for group work, the library offers study rooms you can book for up to two hours… Kate Gregory

Imagine Cup Student programmer competition sponsored by Microsoft Very generous prizes Great opportunity to meet industry professionals and experience reality of software development Kate Gregory4

5 What Classes does the system have? Finding the classes in your system is the first step in analysis and design These classes will encapsulate your business logic and will live in the business layer(s) Some people think of it as looking at all the “stuff” and sorting it into classes Others look at it as making up classes and then thinking of examples of them

Kate Gregory6 Techniques for finding classes Thinking about classifications Looking through use cases for nouns Considering common patterns Class responsibilities collaboration (CRC) analysis Collaboration diagram

Kate Gregory7 Grady Booch says…... Intelligent classification is intellectually hard work, and it best comes about through an incremental and iterative process... There is no such thing as the perfect class structure, nor the right set of objects. As in any engineering discipline, our design choice is compromisingly shaped by many competing factors.

Kate Gregory8 Classification Theory Classification is the process of checking to see if an object belongs to a category or a class Most humans find classification irresistible

Kate Gregory9 Objects and Classes A class is a specification of structure, behavior, and the description of an object. –An object is an instance of a class Classification is more concerned with identifying classes than identifying the individual objects in a system. Intelligent classification is intellectually hard work and may seem rather arbitrary.

Kate Gregory10 Use-case Driven Approach Describe the system Look at the words in the description or steps of each scenario Classes and objects needed for the scenario will present themselves to you

Kate Gregory11 Use case example - Banking Customer Withdraws Money A. Client provides Teller amount of withdrawal and account B. Teller checks balance in account and status of account C. Teller reduces balance of account by withdrawal amount D. Teller gives money to customer

Kate Gregory12 Banking use case cont. At B, if balance is lower than amount to be withdrawn, teller refuses transaction. Customer may return to A with a lower amount, or use case may end At B, if account is frozen, teller refuses transaction. Use case ends. At D, if customer leaves without money, teller reverses transaction and returns money to drawer

Kate Gregory13 Bank Nouns Client Teller Amount Account Balance Status Withdrawal Money Transaction Customer Hold Drawer

Implied Data Look for verbs in the use case that imply storage and retrieval of data –The clerk looks up the reservation –The receptionist records the appointment on the calendar The nouns in these sentences are almost certainly classes This is the information that passes between use cases Kate Gregory14

Kate Gregory15 Syntactic Lexical Analysis Read use cases, interviews, and requirements, looking for nouns and noun phrases –Mark verbs too; you’ll need them later Make a list –Change all plurals to singular –Drop irrelevant nouns –Combine synonyms –Establish if a noun is a class or an attribute

Kate Gregory16 Drop Irrelevant Classes Scrap candidate classes that have nothing to do with the system under study –Out of scope –Represent an actor But be aware of info about an actor –Nouns not related to the system

Kate Gregory17 Redundant Classes Do not keep two classes that express the same information. If more than one word is being used to describe the same idea, select the one that is the most meaningful in the context of the system. –Customer / Client / Member / Purchaser –Reservation / Booking / Prearranged Stay Remember to use the language of the user

Kate Gregory18 Adjective Classes Adult Membership, Youth Membership Checking Account, Savings Account Does the adjective change the behaviour of the object represented by the noun? –If the use of the adjective signals that the behaviour of the object is different, then make a new class. –If not, keep a single class and add the type as an attribute It is difficult for an object to change its class (you make a whole new object and copy values) but it’s easy to change an attribute –Can you convert a savings account to a checking account? If not, it’s more likely they are different classes

Kate Gregory19 Attribute or Class? Candidate classes which are used only as values should be defined or restated as attributes and not as a class. Example: age, salary, description. If it doesn't do anything, just holds information, it's usually not a class

The Power of Words

Kate Gregory21 Statement of Purpose Each class must have a purpose, must do something, not just hold information You must be able to formulate a statement of purpose for each candidate class –The Account class holds and manages information about a customer's money –The EmployeeInformation class holds salary and contact information and performs payroll calculations No statement of purpose? Not a class

Kate Gregory22 Common Class Patterns Tangible Things and Devices Concepts Events People Places Organization Communicating with Actors Information about Actors

Kate Gregory23 CRC Cards CRC stands for Class, Responsibilities and Collaborators developed by Cunningham, Wilkerson and Beck. CRC analysis helps you to –identify classes you need –Work out which responsibilities each class will have –Test your analysis

Kate Gregory24 CRC Process

Kate Gregory25 Collaborations An object can accomplish either a certain responsibility itself, or it may require the assistance of other objects. –Does it know all it needs to know to do it? If it requires the assistance of other objects, it must collaborate with those objects to fulfill its responsibility.

Kate Gregory26 Collaborations Invoice asks customer to print itself Invoice asks invoice items to print themselves Schedule asks task for its effort Schedule sets task’s start date

Kate Gregory27 CRC Cards CRC cards are 4" x 6" index cards. All the information for an object is written on a card. ClassName Collaborators... Responsibilities

Kate Gregory28 Manages balance Processes withdrawal Processes deposit Transaction log Savings Account Adds Transaction Deletes Transaction Knows list of Transactions Transaction Log One way

Kate Gregory29 Calculates total Prints paper invoice Updates inventory Customer, Line Item Inventory, Line Item Invoice Line Item

Kate Gregory30 How do you create them? Start with one or two obvious cards. If the situation calls for a responsibility not already covered by one of the classes: –Add a responsibility to a class, or –Create a new class to address that responsibility. Information held is a responsibility: “knows” or “manages” Don’t create an exhaustive list of attributes –Just say “manages contact info” for now Keep going until you can cover all the behaviour you listed in the use cases

Kate Gregory31 Collaboration diagram One box for each class, all on one diagram One line between boxes for each collaboration Arrow shows direction Savings account Transaction log

Kate Gregory32 Two kinds of collaboration diagram

Kate Gregory33 Overview collaboration diagram

Kate Gregory34 Using Collaboration Diagrams to explain relationships C++ managed C++CRT, STL, etc One call to foo() Hundreds of calls C# or C++ managed C++CRT, STL, etc One call to foo() Hundreds of calls C#C++CRT, STL, etc Hundreds of calls C++ One call to foo() One call

Testing your CRC Cards Go through the use cases Map sentences in the use cases to responsibilities on your cards –“Clerk records start and end date” Yes, we have a class responsible for keeping that –“Clerk calculates invoice total” Yes, we have a class responsible for calculating that –etc Kate Gregory35

36 Naming Classes The class should describe a single object, so it should be the singular form of the noun. –If you think you need Employee and Employees, try Employee and ListOfEmployees for now Use names that the users are comfortable with. The name of a class should reflect its intrinsic nature. –Not a CS concept like hash table, heap, stack –Queue and list are ok in their informal meanings

Kate Gregory37 Summary Finding classes is not easy. You get better with practice. There is no such thing as one “right set of classes.” Finding classes is an incremental and iterative process. Filling out the contents of proposed classes helps you to find more, or to gain confidence in the ones you have.

Kate Gregory38 Summary Unless you are starting with a lot of domain knowledge, you are probably missing more classes than you will eliminate. Naming a class is important. The class should describe a single object, so it should be a singular noun or an adjective and a noun.

Kate Gregory39 Lab 2 You are given a list of nouns Reject those that are not classes Add more if you feel some are missing Write a statement of purpose for all you keep Make a CRC card for all you keep Make an overview collaboration diagram that summarizes all the collaborations at once

Kate Gregory40 Next Time Read up to where we are Lab 2 will be due at the start of class –I will try to have Lab 1 marked for you If you want to read ahead, next lecture we start class diagrams