Se Unit - Iv
Se Unit - Iv
Se Unit - Iv
Object Modeling And Object Oriented Software Development –Overview of OO concepts – UML- Use
Case Model- Class Diagram – Interaction Diagrams – Activity Diagrams- State Chart Diagrams – Patterns
– Types-Object Oriented Analysis and Design Methodology – Interaction Modeling – OO Goodness
Criteria.
PART-A (2 MARKS)
• Intuitively, use cases represent the different ways in which a system can be used by the users
• It is an important analysis and design artifact.
• In contrast to all other types of UML diagrams, the user case model represents a functional or
process model of a system.
11. What is the difference between sequence diagram and collaboration diagram?
17. Define Pattern. List out the types of patterns. (Nov 2015)
• Design pattern are commonly accepted solutions to some problems that recur during designing
different applications.
▪ Architectural patterns
▪ Design patterns
▪ Idioms
18. Give the advantages of using pattern.
• The basic idea behind patterns is that if you can master a few important patterns, you can easily spot
them in application development problems and effortlessly use the pattern solutions.
• Patterns can be viewed as helping designers to make certain important design decisions.
• At a basic level, patterns can also be viewed as well-documented building blocks for software
design.
22. State the steps for developing the use case model for any problem. (Nov 2015)
• The use case can easily be identified from the SRS document
• High level functional requirements correspond to the use cases
• An overriding principle while identifying and packaging use cases is that there should be a strong
correlation between the GUI prototype, the contents of the user’s manual and the use case model of
the system.
• A controller object co-ordinates the activities of a set of collaborating objects to to deliver the
results corresponding to an actor request
• For every use case, a separate controller object should be created and given the responsibility to
handle actor requests.
28. What are the criteria used to eliminate nouns after lexical analysis?
• Users
• True name word
• Retained information
• Multiple attributes
• Common operations
29. Classify object identification techniques.
• Grammatical analysis of the problem description
• Derivation from data flow
Objects:
• A system is designed as a set of interacting objects
• A tangible real-world entity such as library member, an employee, or a book etc.,
• Certain conceptual entities as objects as well as to simplify the solution eg. A scheduler, a
controller, etc.
• When the system is analyzed, developed, and implemented in terms of natural objects, it becomes
easy to understand the design and the implementation of the system
• Provide an excellent decomposition of a large problem into small parts
• Consists of some data that is private to the object and a set of functions that operate on those data.
• The functions of an object have the sole authority to operate on the private data of that object.
• Each object can be thought of as hiding its internal data from the other objects.
• Data Hiding(Data abstraction)
▪ A mechanism of hiding data from other objects
• Each object stores some data and supports certain operations on the stored data
• For eg, Library Member object of a library automation application. The private data of a Library
Member object can be:
▪ Name of the member
▪ Membership number
▪ Address
▪ Phone number
▪ E-mail number
▪ Date when admitted as a member
▪ Membership expiry date
▪ Books outstanding, etc
• The operations supported by a Library Member object can be:
▪ Issue-book
▪ Find-books-outstanding
▪ Find-books-overdue
▪ Return-book
▪ Find-membership-details, etc
• The data stored internally in an object are called its attributes, and the functions supported by an
object are called its methods.
Class:
Class relationships
• Classes can be related to each other in the following four ways
▪ Inheritance
▪ Association
▪ Aggregation and composition
▪ Dependency
Inheritance
• The inheritance is used to define a new class by extending the features of modifying an existing
class.
• The original class is called the base class(super class or parent class) and the new class obtained
through inheritance is called derived class(sub class or child class)
• An example of inheritance has been shown in figure which shows the classes Faculty, Students, and
Staff as having been derived from the base class Library Member through an inheritance
relationship.
Multiple inheritances
• Multiple inheritance is a mechanism by which a subclass can inherit attributes and methods from
more than one base class.
Ternary association
• Recursive association – Two or more different objects of the same class are linked by the
association relationship.
Abstract class
• Classes that are not intended to produce instances of themselves are called abstract classes. Abstract
classes cannot be instantiated.
• Abstract classes merely exist so that behavior common to a variety of classes can be factored into
one common location, where they can be defined once
• By using abstract classes, code reuse can be enhanced and the effort required to develop software
brought down.
• Abstract classes support generic methods, and the subclasses o the abstract classes are expected to
provide specific implementations of these methods.
Encapsulation
The data of an object is encapsulated within its methods.
• Data hiding – Encapsulation hides the internal structure of an object so that all interactions with the
object are simple and standardized.
• Weak coupling – Since objects communicate among each other using messages only, they are
weakly coupled.
Polymorphism
• Polymorphism literally means poly (many) morphism (forms). It denotes that a method may respond
(behave) differently even when the same operation is initiated depending on the exact polymorphic
method that is bound.
▪ Polymorphism can be implemented using the following two mechanisms:
▪ Static polymorphism
▪ Dynamic polymorphism
Persistence
• Objects usually get destroyed once a program finishes execution. Persistent objects are stored
permanently. That is, they live across different executions. A object can be made persistent by
maintaining copies of the object in a secondary storage or in a database.
Advantage of OOD:
• Code and design reuse
• Increased productivity
• Ease of testing and maintenance
• Better code and design understandability
2. Discuss in detail about UML and Use Case Model. (Nov/Dec 2016)
Unified Modeling Language (UML)
• UML, as the name implies, is a modeling language.
• It may be used to visualize, specify, construct, and document the artifacts of a software
system.
• It provides a set of notations (e.g. rectangles, lines, ellipses, etc.) to create a visual model of
the system.
• Like any other language, UML has its own syntax (symbols and sentence formation rules) and
semantics (meanings of symbols and sentences).
• UML is not a system design or development methodology, but can be used to document
object-oriented and analysis results obtained using some methodology.
Origin of UML
• In the late 1980s and early 1990s, there was a proliferation of object-oriented design
techniques and notations.
• Different software development houses were using different notations to document their
object-oriented designs.
• These diverse notations used to give rise to a lot of confusion.
• UML was developed to standardize the large number of object-oriented modeling notations
that existed and were used extensively in the early 1990s. The principles ones in use were:
✓ Object Management Technology [Rumbaugh 1991]
• It is needless to say that UML has borrowed many concepts from these modeling techniques.
• Especially, concepts from the first three methodologies have been heavily drawn upon. UML
was adopted by Object Management Group (OMG) as a de facto standard in 1997.
Model
• A model captures aspects important for some application while omitting (or abstracting) the
rest.
• A model in the context of software development can be graphical, textual, mathematical, or
program code-based.
• Models are very useful in documenting the design and analysis results.
• Models also facilitate the analysis and design procedures themselves.
• Graphical models are very popular because they are easy to understand and construct.
• UML is primarily a graphical modeling tool. However, it often requires text explanations to
accompany the graphical models.
✓ Specification
✓ Code generation
✓ Design
✓ Testing, etc.
UML diagrams
• UML can be used to construct nine different types of diagrams to capture five different
views of a system.
• Such models can be refined to get the actual implementation of the system.
• The UML diagrams can capture the following five views of a system:
✓ User’s view
✓ Structural view
✓ Behavioral view
✓ Implementation view
✓ Environmental view
User’s view:
• This view defines the functionalities (facilities) made available by the system to its users.
• The users’ view captures the external users’ view of the system in terms of the
functionalities offered by the system.
• The users’ view is a black-box view of the system where the internal structure, the dynamic
behavior of different system components, the implementation etc. are not visible.
• The users’ view is very different from all other views in the sense that it is a functional
model compared to the object model of all other views.
Structural view:
• The structural view defines the kinds of objects (classes) important to the understanding of
the working of a system and to its implementation. It also captures the relationships among
the classes (objects).
• The structural model is also called the static model, since the structure of a system does not
change with time.
Behavioral view:
• The behavioral view captures how objects interact with each other to realize the system
behavior.
• The system behavior captures the time-dependent (dynamic) behavior of the system.
Implementation view:
• This view captures the important components of thesystem and their dependencies.
Environmental view:
• This view models how the different components areimplemented on different pieces of
hardware.
✓ query-book
✓ return-book
✓ create-member
✓ add-book, etc
• The use cases do not mention any specific algorithm to be used or the internal data
representation, internal structure of the software, etc.
• A use case typically represents a sequence of interactions between the user and the system.
These interactions consist of one mainline sequence.
• The mainline sequence represents the normal interaction between a user and the system. The
mainline sequence is the most occurring sequence of interaction.
• In the use case diagram, each use case is represented by an ellipse with the name of the use
case written inside the ellipse.
• All the ellipses (i.e. use cases) of a system are enclosed within a rectangle which represents
the system boundary.
• The name of the system being modeled (such as Library Information System) appears inside
the rectangle.
• The different users of the system are represented by using the stick person icon. Each stick
person icon is normally referred to as an actor.
Example:
• The use case model for the Supermarket Prize Scheme is shown in fig. As discussed earlier,
the use cases correspond to the high-level functional requirements.
• From the problem description and the context diagram in fig., we can identify three use
cases: “register-customer”, “register-sales”, and “select-winners”.
• As a sample, the text description for the use case “register-customer” is shown.
• This makes analysis of the class design much simpler and elegant. However, a word of
caution here.
Includes
• This includes relationship in the older versions of was known as the uses relationship.
• This includes relationship involves one use case including the behavior of another use case
in its sequence of events and actions.
• This includes relationship occurs when a chunk of behavior that is similar across a number
of use cases.
• The factoring of such behavior will help in not repeating the specification and
implementation across different use cases.
• This includes relationship explores the issue of reuse by factoring out the commonality
across use cases.
• It can also be gainfully employed to decompose a large and complex use cases into more
manageable parts. As shown in fig., this includes relationship is represented using a
predefined stereotype <<include>>.
Extends
• The main idea behind these extends relationship among the use cases is that it allows you to
show optional system behavior.
• An optional system behavior is extended only under certain conditions. This relationship
among use cases is also predefined as a stereotype as shown in fig.
• This extends relationship is similar to generalization. But unlike generalization, the
extending use case can add additional behavior only at an extension point only when certain
conditions are satisfied.
• The extension points are points within the use case where variation to the mainline (normal)
action sequence may occur.
The extends relationship is normally used to capture alternate paths or scenario
Class Diagram:
• A class diagram describes the static structure of a system.
• Shows how a system is structured rather than how it behaves.
• The static structure of a system comprises of a number of class diagrams and their
dependencies.
• Class diagram are classes and their relationships – generalization, aggregation, association
and various kinds of dependencies
Classes
• The classes represent entities with common features – attributes and operations.
• Classes are represented as solid outline rectangles with compartments.
• Classes have a mandatory name compartment where the name is written centred in boldface.
• The class name is usually written using mixed case convention and begins with an
uppercase. Eg. LibraryMember
• Object names written using a mixed case convention, but starts with a small case letter. Eg.
studentMember
Attributes
Operation
• The operation names are left justified, in plain type, and always begin with a lower case
letter.
• Abstract operations are written in italics.
• The parameters of a function may have a kind specified.
• The kind may be “in” indicates the parameter is passed into the operation and “out” indicates
the parameter is only returned from the operation or “inout” indicating that the parameter is
used for passing data into the operation and getting result from the operation. The default is
“in”
• Static polymorphism – multiple methods implementing same operation
• An operation may have a return type consisting of a single return type expresision, eg.
issueBook(in bookName):Boolean
Association
• Associations are needed to enable objects to communicate with each other. An association
describes a connection between classes.
• The association relation between two objects is called object connection or link. Links are
instances of associations.
• The name of the association is written alongside the association line. An arrowhead may be
placed on the association line to indicate the reading direction of the association.
• The arrowhead should not be misunderstood to be indicating the direction of a pointer
implementing an association.
• On each side of the association relation, the multiplicity is noted as an individual number or
as a value range.
• The multiplicity indicates how many instances of one class are associated with each other.
Value ranges of multiplicity are noted by specifying the minimum and maximum value,
separated by two dots,
• An asterisk is a wild card and means many (zero or more). The association of fig. should be
read as “Many books may be borrowed by a Library Member”. Observe that associations
(and links) appear as verbs in the problem statement
Aggregation
• Aggregation is a special type of association where the involved classes represent a whole-
part relationship.
• The aggregate takes the responsibility of forwarding messages to the appropriate parts.
• Thus, the aggregate takes the responsibility of delegation and leadership.
• When an instance of one object contains instances of some other objects, then aggregation
(or composition) relationship exists between the composite object and the component object.
• Aggregation is represented by the diamond symbol at the composite end of a relationship.
Composition
• Composition is a stricter form of aggregation, in which the parts are existence-dependent on
the whole.
• The life of the parts closely ties to the life of the whole. When the whole is created, the parts
are created and when the whole is destroyed, the parts are destroyed.
• A typical example of composition is an invoice object with invoice items. As soon as the
invoice object is created, all the invoice items in it are created and as soon as the invoice
object is destroyed, all invoice items in it are also destroyed.
• The composition relationship is represented as a filled diamond drawn at the composite-end.
• Composition has the property of exclusive aggregation i.e. an object can be a part of only
one composite at a time. For example, a Frame belongs to exactly one Window whereas in
simple aggregation, a part may be shared by several objects. For example, a Wall may be a
part of one or more Room objects.
• In addition, in composition, the whole has the responsibility for the disposition of all its
parts, i.e. for their creation and destruction.
Inheritance
• The inheritance relationship is represented by means of an empty arrow pointing from the
subclass to the superclass.
Dependency
• A dependency relationship is shown as dotted arrow that is drawn from the dependent class
to the independent class.
Constraints
• A constraint describes a condition or an integrity rule.
• Constraints are used to describe the permissible set of values of an attribute to specify the
pre- and post-conditions for operations, to define certain ordering of items.
• For example, to denote that the books in a library are sorted on ISBN number we can
annotate the book class with the constraint {sorted}.
• UML allows you to use any free form expression to describe constraints.
• The only rule is that they are to be enclosed within braces.
Sequence Diagram
• A sequence diagram shows interaction among objects as a two dimensional chart.
• The chart is read from top to bottom. The objects participating in the interaction are shown
at the top of the chart as boxes attached to a vertical dashed line.
• Inside the box the name of the object is written with a colon separating it from the name of
the class and both the name of the object and the class are underlined.
• The objects appearing at the top signify that the object already existed when the use case
execution was initiated.
• If some object is created during the execution of the use case and participates in the
interaction (a method call), then the object should be shown at the appropriate place on the
diagram where it is created.
• The vertical dashed line is called the object’s lifeline. The lifeline indicates the existence of
the object at any particular point of time.
• The rectangle drawn on the lifetime is called the activation symbol and indicates that the
object is active as long as the rectangle exists.
• Each message is indicated as an arrow between the lifelines of two objects.
• The messages are shown in chronological order from the top to the bottom.
• That is, reading the diagram from the top to the bottom would show the sequence in which
the messages occur.
• Each message is labeled with the message name. Some control information can also be
included.
• Two types of control information are particularly valuable.
✓ A condition indicates that a message is sent, only if the condition is true.
✓ An iteration marker shows the message is sent many times to multiple receiver objects as
would happen when a collection or the elements of an array are being iterated. The basis
of the iteration can also be indicated
• The sequence diagram for the book renewal use case for the Library Automation Software is
shown in fig.
• The development of the sequence diagram in the development methodology would help us
in determining the responsibilities of the different classes; i.e. what methods should be
supported by each class.
Collaboration Diagram
• A collaboration diagram shows both structural and behavioral aspects explicitly. This is
unlike a sequence diagram which shows only the behavioral aspects.
• The structural aspect of a collaboration diagram consists of objects and the links existing
between them.
• In this diagram, an object is also called a collaborator. The behavioral aspect is described by
the set of messages exchanged among the different collaborators.
• The link between objects is shown as a solid line and can be used to send messages between
two objects.
• The message is shown as a labeled arrow placed near the link.
• Messages are prefixed with sequence numbers because they are only way to describe the
relative sequencing of the messages in this diagram.
5. Describe in detail about Activity diagram and State chart diagram. (Nov 2015)
Activity and State Chart Diagram
Activity diagrams
• The activity diagram is possibly one modeling element which was not present in any of the
predecessors of UML.
• No such diagrams were present either in the works of Booch, Jacobson, or Rumbaugh. It is
possibly based on the event diagram of Odell [1992] through the notation is very different
from that used by Odell.
• The activity diagram focuses on representing activities or chunks of processing which may
or may not correspond to the methods of classes.
• An activity is a state with an internal action and one or more outgoing transitions which
automatically follow the termination of the internal activity.
• If an activity has more than one outgoing transitions, then these must be identified through
conditions.
• An interesting feature of the activity diagrams is the swim lanes. Swim lanes enable you to
group activities based on who is performing them, e.g. academic department vs. hostel
office.
• Thus swim lanes subdivide activities based on the responsibilities of some components. The
activities in a swim lane can be assigned to some model elements, e.g. classes or some
component, etc.
• Activity diagrams are normally employed in business process modeling. This is carried out
during the initial stages of requirements analysis and specification.
• Activity diagrams can be very useful to understand complex processing activities involving
many components.
• Later these diagrams can be used to develop interaction diagrams which help to allocate
activities (responsibilities) to classes.
• The student admission process is shown as an activity diagram in fig.. This shows the part
played by different components of the Institute in the admission procedure.
• After the fees are received at the account section, parallel activities start at the hostel office,
hospital, and the Department.
• After all these activities complete (this synchronization is represented as a horizontal line),
the identity card can be issued to a student by the Academic section
activities in the source state (An activity is an ongoing non-atomic execution within a state
machine).
• Activity diagrams may stand alone to visualize, specify, and document the dynamics of a
society of objects or they may be used to model the flow of control of an operation. State
chart diagrams may be attached to classes, use cases, or entire systems in order to visualize,
specify, and document the dynamics of an individual object.
• Patterns can be viewed as helping designers to make certain important design decisions At
basic level, patterns can also be viewed as well-documented building blocks for software
design.
• Patterns are created and documented by people who spot repeating themes across designs.
Once patterns are created and documented, they can be used by different designers.
• A highly effective means to capture and transfer design knowledge across different design
problems.
✓ The problem
✓ The solution
✓ The context within which the solution would work and would not work
Types of Patterns:-
• Architectural patterns
• Design patterns
• Idioms
Architectural pattern
• It identifies and provides solutions to problems that are identifiable while carrying out
architectural (or very high-level) designs.
• It cannot directly be translated to code, but form the basis for more detailed design.
Design patterns
• Suggests a scheme for structuring the classes in a design solution and defines the interactions
required among those classes.
• Design pattern solutions are described in terms of classes, their instances, their roles and
collaborations.
Idioms
• Idioms are low-level patterns that are programming language-specific
• An idiom describes how to implement a solution to a particular problem using the features of
a given programming language.
• As soon as they see a requirement while working out a programming solution, the required
idiom occurs to them instantly and relieves them from having to select of the exact
constructs to use in the program and at the same time improves the quality of the program
and reduces the bug detection and correction iterations.
• Design patterns are solutions for specific parts of medium-scale problems and recommend
certain structures and behavior of participating entities.
Disadvantages:-
• Design patterns do not directly lead to code reuse
• At present no methodology is available that can be used to select the right design pattern at
the right point during a design exercise.
Antipattern:
• It represents lessons learned from a bad design
• Types of antipattern
✓ Those that describe bad solutions to problems which leads to bad situations
• The results of the analysis activities are be redefined into a design model through several
iterations
The Unified Process
• The unified process is an extensible framework which needs to be customized for specific
types of projects.
✓ Iterative
• Case-driven implies that use cases of the system are considered to be the central and most
important view.
• The use case view should be the first one to be constructed and should be refined iteratively
into an implementation
• The use case model is the central model. All models that constructed in the subsequent
design activities must conform to the use case model
• The unified process involves iterating over the following four phases as follows:
1. Inception:
✓ During this phase, the scope of the project is defined and prototypes may be developed to
form a clear idea about the project.
2. Elaboration:
3. Construction:
✓ Full text descriptions of use cases are written during the construction phase and each use
case is taken up for the start of a new iteration.
4. Transition:
• Any user-centric development process must conform to the use case model.
• The domain model is constructed next through an analysis of the use case model and the
SRS document.
• The domain model is refined into a class diagram through a number of iterations involving
the interaction diagrams.
• Once the class diagram has been constructed, it can easily be translated to code.
• A glossary is a dictionary of terms which can help in understanding the various terms
(concepts) used in the constructed model.
• The glossary lists and defines all the terms that require explanation in order to improve
communication and to reduce the risk of misunderstanding
• For every use case, the details all the scenarios of user interactions with the system are
captured in an accompanying text description.
✓ It is worth noting that there is a close correspondence with structure of the GUI, the
organization of the user’s manual into sections, and the packaging of the use cases.
• An overriding principle while identifying and packaging use cases is that there should be a
strong correlation between the GUI prototype, the contents of the user’s manual and the use
case model of the system.
✓ When large number of use cases are present in the top level of the use case . diagram,
they should be organized into packages
✓ Each use case package should correspond to one chapter or section of the user’s manual
or a top-level menu choice in the GUI
2. Too detailed
✓ Often beginners confuse sub steps of use cases with separate use cases
✓ For eg, one should may inappropriately define a use case print receipt,
✓ A use case model in which the sub functions of a high-level function are represented as
full use cases would make the later analysis and design task difficult
✓ Omitting text description of the use cases makes it very difficult for any one to gain full
understanding of the use case behavior and also makes it very difficult to design the
system
Domain Modeling
• Known as conceptual modeling
• A conceptual model depicts the concepts(objects) that are easily identifiable in the problem
description
✓ Boundary objects
✓ Controller(conceptual) objects
✓ Entity objects
Entity objects
• objects that correspond to physical entities in the problem description
• Eg. In a library automation software are book, book register, member register,etc,
• Store data across use case executions and need to outlive use case executions
• Carry out only simple processing ontheir stored data such as update, store, search retrieve,
etc.
• Entity objects undergo much less changes during the operation phase of the software
compared to the other types of objects and are said to be more stable than the other types of
objects.
• The boundary objects are those with which the actors interact
• The boundary objects are mainly responsible for evaluating user interactions through
suitable graphical user interfaces(GUIs)
• Responsible to read inputs form the user, validate the inputs, format the outputs, and display
the results.
• The initial identification of the boundary classes can be made by defining one boundary
class per actor/use case pair
Controller objects
• objects are entirely conceptual
• Each object involved in the execution of a use case plays its part to help complete the
execution of the use case
• A controller object co-ordinates the activities of a set of collaborating objects to deliver the
results corresponding to an actor request
• For every use case, a separate controller object should be created and given the
responsibility to handle actor requests.
• For every invocation of a use case by the same (or different) actor, a separate controller
object should be instantiated from the corresponding controller class.
• When an actor invokes a use case, the same controller object should handle all the
interactions with that actor.
• To maintain the necessary information about the state of execution of the use case by an
actor
• The state information maintained by a controller can be used to identify the out-of-sequence
actor request and it can then take appropriate actions.
• A controller object orchestrates the activities of a set of entity classes to implement the
behavior of a use case and also manages the user interactions through a set of boundary
classes
• Accepts inputs and displays outputs to the users through two boundary classes, it co-
ordinates the activities of the entity classes to realize the behavior associated with the use
case.
• A domain models are the first-cut class diagram and is obtained from an analysis of the
problem description
• In a domain model, no methods or attributes are associated with classes and only the names
of the classes are represented.
• While boundary and controller objects can be mechanically identified from an inspection of
the use case diagram, identification of entity objects requires practice. So, we can say that
the crux of the domain modeling activity is to identify the entity objects judiciously.
• Several semi-formal and informal approaches proposed for identification of the objects.
• Various object identification techniques classified into the following broad classes
• In Booch’s approach, the nouns mapped to objects and the verbs mapped to methods.
• Derivation from data flow and the entity relationship diagram used to refine the results
obtained using the Booch’s object identification methodology.
• The objects are identified by noting down the nouns in the processing narrative. Synonym of
a noun must be eliminated.
• Otherwise, if an object is necessary only to describe the problem, then it is said to be a part
of the problem space.
• An imperative procedure name, i.e., noun form of a verb actually represents an action and
should not be considered as an object.
A potential object found after lexical analysis is usually considered legitimate, only if it satisfies the
following criteria:
Users:
• Appear as name words in the problem description
• The actors and interactions among actors excluded from the entity identification exercise
• Classes corresponding to the names of the actors should be considered that classes
sometimes called surrogates.
• For example, in the Library Information System need to store information about each library
member such as his name, address, identification number etc.
• This is independent of the fact that the library member also play the role of an actor of to the
system
Retained information.
• Some information about the object should be remembered for the system to function. If an
object does not contain any private data, it can not be expected to play any important role in
the system.
Multiple attributes.
• Usually objects have multiple attributes and support multiple methods.
• It is very rare to find useful objects which store only a single data element or support only a
single method, because an object having only a single data element or method is usually
implemented as a part of another object.
Common operations.
• A set of operations can be defined for potential objects. If these operations apply to all
occurrences of the object, then a class can be defined.
• An attribute or operation defined for a class must apply to each instance of the class.
• If some of the attributes or operations apply only to some specific instances of the class, then
one or more subclasses can be needed for these special objects.
Interaction Modeling
Identify two goals of interaction modeling. The primary goal of interaction modeling are the following:
• To allocate the responsibility of a use case realization among the boundary, entity, and
controller objects.
• The responsibilities for each class is reflected as an operation to be supported by that class.
• To show the detailed interaction that occur over time among the objects associated with each
use case.
• More complex use cases require the use of CRC cards where a number of team members
participate to determine the responsibility of the classes involved in the use case realization.
• On each of these cards, the responsibility of each class is written briefly. The objects with
which this object needs to collaborate its responsibility are also written.
• After assigning the responsibility to classes using CRC cards, it is easier to develop the
interaction diagrams by flipping through the CRC cards
Class diagram