slide-6
slide-6
All copyright information MUST appear if these slides are posted on a website for student
use.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 1
Class-Based Modeling
Class-based modeling represents:
objects that the system will manipulate
operations (also called methods or services) that
will be applied to the objects to effect the
manipulation
relationships (some hierarchical) between the
objects
collaborations that occur between the classes that
are defined.
The elements of a class-based model include
classes and objects, attributes, operations,
CRC models, collaboration diagrams and
packages.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 2
Potential Classes
Retained information. The potential class will be useful during
analysis only if information about it must be remembered so that
the system can function.
Needed services. The potential class must have a set of identifiable
operations that can change the value of its attributes in some way.
Multiple attributes. During requirement analysis, the focus should
be on "major" information; a class with a single attribute may, in
fact, be useful during design, but is probably better represented as
an attribute of another class during the analysis activity.
Common attributes. A set of attributes can be defined for the
potential class and these attributes apply to all instances of the
class.
Common operations. A set of operations can be defined for the
potential class and these operations apply to all instances of the
class.
Essential requirements. External entities that appear in the
problem space and produce or consume information essential to
the operation of any solution for the system will almost always be
defined as classes in the requirements model.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 3
Defining Attributes
Attributes describe a class that has been
selected for inclusion in the analysis
model.
build two different classes for professional
baseball players
• For Playing Statistics software: name,
position, batting average, fielding percentage, years
played, and games played might be relevant
• For Pension Fund software: average salary,
credit toward full vesting, pension plan options chosen,
mailing address, and the like.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 4
Defining Operations
Do a grammatical parse of a processing
narrative and look at the verbs
Operations can be divided into four
broad categories:
(1) operations that manipulate data in some
way (e.g., adding, deleting, reformatting,
selecting)
(2) operations that perform a computation
(3) operations that inquire about the state of
an object, and
(4) operations that monitor an object for the
occurrence of a controlling event.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 5
Class Types
Entity classes, also called model or business classes, are
extracted directly from the statement of the problem (e.g.,
FloorPlan and Sensor).
Boundary classes are used to create the interface (e.g.,
interactive screen or printed reports) that the user sees and
interacts with as the software is used.
Controller classes manage a “unit of work” [UML03] from start to
finish. That is, controller classes can be designed to manage
the creation or update of entity objects;
the instantiation of boundary objects as they obtain information from
entity objects;
complex communication between sets of objects;
validation of data communicated between objects or between the
user and the application.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 6
Composite Aggregate Class
Design a sample aggregate class diagram for a cricket game character
(i.e.: cricket player). The basic characteristics of a player to be
considered are listed below:
Player arms
Player legs All classes that are part of an aggregate
Player head class are connected to the aggregate class
via an is-part-of relationship.
Player body
Consider the classes defined for the video
Etc. game, the class PlayerBody is-part-of
Player, as are PlayerArms, PlayerLegs, and
PlayerHead.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 7
Skeleton Diagram
Player
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 8
Multiplicity
Player
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 9
Dependencies
Bat Arm
<<control>>
Dependent Independent
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 10
Dependencies (contd.)
Ball Arm
<<throw>>
Dependent Independent
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 11
Dependencies (contd.)
Body Jersey
<<identification>>
Dependent Independent
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 12
Dependencies (contd.)
Head Helmet
<<safety>>
Dependent Independent
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 13
Dependencies (contd.)
Arms Ball
<<catch>>
Dependent Independent
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 14
Dependencies (contd.)
Ask the students to generate at least 5 more
dependencies based on real-life metaphor
regarding cricket game.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 15
Analysis Packages
Various elements of the analysis model (e.g., use-cases,
analysis classes) are categorized in a manner that
packages them as a grouping
The plus sign preceding the analysis class name in each
package indicates that the classes have public visibility
and are therefore accessible from other packages.
Other symbols can precede an element within a
package. A minus sign indicates that an element is
hidden from all other packages and a # symbol indicates
that an element is accessible only to packages
contained within a given package.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 16
Class
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 17
Analysis Packages
Cricket Game
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 19
Task: 15 min
Design and develop an aggregate class
diagram for PUBG game. Consider the
elements based on game scenario. While
designing make sure to include skeleton
diagram, multiplicity, dependencies, and
analysis packages with regular notations.
These slides are designed to accompany Software Engineering: A Practitioner’s Approach, 8/e
(McGraw-Hill, 2014). Slides copyright 2014 by Roger Pressman. 20