OOAD Unit 2
OOAD Unit 2
1)
2) REUSABILITY plays a key role in reducing a cost and improving the quality of the
software.It is a major contributor to the development goal of achieving high speed, low cost
and quality.
The concept of reusability is widely used in order to reduce cost, effort, and time of
software development. Reusability also increases the , maintainability, portability, and
reliability of the software products.
4)
1)
Swimlanes group related activities into one column or one row. Swimlanes can
be vertical and horizontal. Swimlanes are used to add modularity to the
activity diagram. Swimlanes are used to show which activities are performed by which
organisation in the activity diagram.
2)
Difference between static and dynamic models:
Staticmodelincludes: DynamicModellingincludes:
CLASSDIAGRAM USE-CASEDIAGRAM
OBJECTDIAGRAM INTERACTIONDIAGRAM
COMPONENTDIAGRAM STATEDIAGRAM
DEPLOYMENT DIAGRAM ACTIVITY DIAGRAM
e.g. Class has same number of students E.g. ATM can accept card only when it is
in an year. in ready state.
3)
UML Behavioural Diagrams:
UML behavioral diagrams visualize, specify, construct, and document the dynamic aspects
of a system.
The behavioral diagrams are categorized as follows: use case diagrams, interaction
diagrams, state–chart diagrams, and activity diagrams.
4)
The multiplicity is an indication of how many objects may participate in the given
relationship or the allowable number of instances of the element.
For example, one company will have one or more employees, but each
employee works for one company only.
5)
Interaction Diagrams:
Interaction diagrams depict interactions of objects and their relationships.
They also include the messages passed between them. There are two types of interaction
diagrams −
• Sequence Diagrams
• Collaboration Diagrams
Drawbacks:
Drawbacks:
• Sequence diagrams can Collaboration diagrams can become
become complex when too complex when too many objects are
many lifelines are involved in present within the system.
the system.
• If the order of message • It is hard to explore each object
sequence is changed, then inside the system.
incorrect results are produced. • Collaboration diagrams are
time consuming.
6)
State Transistion diagram:
A state-transition diagram presents a sequence of states that an object goes through during its
lifecycle. It is used to describe the changes of states for an object or for a component.
A state is defined by its duration and by its stability.
A transition represents the instantaneous change from one state to another one.
components of a state-transition diagram:
A state-transition diagram includes the following elements:
• state: represents the value of object attributes at a given time.
• initial state: represents the state when the system is started.
• final state: represents the status of system at the end of operation.
• super-state: used to structure the diagram by specifying several distinction levels between the
states.
• history: represent the last active state of a super-state.
• stump: used to symbolize the states found in a super-state. This allows you to link these states to
other states that do not belong to the super-state.
• transition: represents the switch from one state to another one.
• package: divides and organizes the diagram representation (like the directories organize the
files).
For example, the diagram below presents the different steps for a car wash:
7)
EXTEND INCLUDE
Include = reuse of functionality (i.e. the Extends =adding functionality (not reusing
included functionality is used or could be and also any optional functionality.
used elsewhere in the system). Include
therefore denotes a dependency on Extends therefore can denote one of two
another use case. things:
For example, imagine "Withdraw Cash" is a use case of an Automated Teller Machine
(ATM). "Assess Fee" would extend Withdraw Cash and describe
the conditional "extension point" that is instantiated when the ATM user doesn't bank at
the ATM's owning institution. Notice that the basic "Withdraw Cash" use case stands on
its own, without the extension.
Include is used to extract use case fragments that are duplicated in multiple use cases.
The included use case cannot stand alone and the original use case is not complete
without the included one. This should be used sparingly and only in cases where the
duplication is significant and exists by design (rather than by coincidence).
For example, the flow of events that occurs at the beginning of every ATM use case
(when the user puts in their ATM card, enters their PIN, and is shown the main menu)
would be a good candidate for an include.
Example :
I often use this to remember the two:
"Fill the petrol" may not be required at all times, but may optionally be required based
on the amount of petrol left in the car. "Drive the car" is a prerequisite hence I am
including.
8)
Aggregation Relationship:
For example:
Here we are considering a car and a wheel example. A car cannot move without a
wheel. But the wheel can be independently used with the bike, scooter, cycle, or any
other vehicle. The wheel object can exist without the car object, which proves to be an
aggregation relationship.
9)
10)
Component diagram
Deployment diagram:
11)
12)
13)
14)
15)
E diagram lo classes
,mothods,attributes,association,aggregation,
inheritance identify cheyyandi…….
16)