Upcoming SlideShare
×

# Wj 1101-se6-lab2

173 views

Published on

Published in: Education, Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
173
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
2
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Wj 1101-se6-lab2

1. 1. Lab 2Analyzing a Problem and Designing aSolutionObjectives Upon completion of this lab, you should be able to: ● Complete Review Questions ● Analyze a problem using object-oriented analysis (OOA) ● Design classes from which objects will be created 2-1 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A
2. 2. Lab OverviewLab Overview In this lab, you complete review questions and two exercises. The exercises are: ● List the objects, attributes, and operations in a sample problem domain ● Model an object using an UML-like notation2-2 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A
3. 3. Completing Review QuestionsCompleting Review Questions Complete the following questions: 1. Which of the following terms refers to the scope of a problem or a system: a. The problem context b. The problem domain c. The system context d. The problem area 2. Which of the following terms represents two different characteristics of an object: a. Methods and operations b. The problem domain c. Attributes and operations d. Variables and data 3. Which of the following statements is a criteria to test the validity of an object relative to a problem domain: a. Relevance to the problem domain b. Operation order c. Attribute type d. If a class has a super class 4. Which of the following statements are true: a. A class is an instance of an object. b. An object is a blueprint for a class. c. An object and a class are exactly the same. d. An object is an instance of a class. e. An attribute cannot be a reference to another object. Analyzing a Problem and Designing a Solution 2-3 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A
4. 4. Exercise 1: Analyzing a Problem DomainExercise 1: Analyzing a Problem Domain This exercise is based on a small case study. You will identify the objects, their attributes and operations involved in the system domain. Preparation Read the following case study, and then model the system by choosing objects and their attributes and operations. Case Study A soccer league has many players. Each year there are three seasons and the league puts together teams for each season. Each team is comprised of 15 players. The goals scored by each player during each season are tracked. The games played between the teams, their ﬁnal scores, and each team’s standings based on its won and lost games are tracked. Task – Performing an Analysis Your task is to produce an object-oriented analysis for a Java technology application that tracks soccer scores. The program should track: ● The list of players on each team ● The number of goals that each player scores ● The games played during a season, including the teams that play each other, and the ﬁnal score The application should be able to generate statistics for teams, players, and seasons. To ﬁnalize the analysis, complete the following steps: 1. Create a list of the potential objects. 2. Apply the rules in this module to decide if all your objects are valid. 3. Create a list of attributes and operations for each of your objects.2-4 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A
5. 5. Exercise 1: Analyzing a Problem DomainNotes Analyzing a Problem and Designing a Solution 2-5 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A
6. 6. Exercise 2: Designing a SolutionExercise 2: Designing a Solution In this exercise you will use UML notation to represent a class. Task – Producing a Design Your task is to produce a design for each of the classes in the earlier system for tracking soccer scores. Remember to: ● Use short-hand to name your classes, attribute variables, and methods ● Identify a valid range of values for each attribute (where a range is known) ● Use the parentheses to identify methods2-6 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A
7. 7. Exercise 2: Designing a SolutionNotes Analyzing a Problem and Designing a Solution 2-7 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A
8. 8. Exercise SummaryExercise Summary Take a few minutes to identify what experiences, issues, or discoveries you had during the lab exercises. ● Experiences ● Interpretations ● Conclusions ● Applications2-8 Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision A