Professional Documents
Culture Documents
cs8592 Ooad PDF
cs8592 Ooad PDF
WHAT WE DO
Faculties Talkies team typically do the following:
Course Objectives:
In this course, the students will learn how to produce detailed object models and
designs from system requirements; use the modeling concepts provided by UML;
identify use cases and expand into full behavioral designs; expand the analysis into a
design ready for implementation and construct designs that are reliable. The course
begins with an overview of the object oriented analysis and design.
Course Outcomes:
At the end of this course student will:
COA60524.1) Be able to discuss the overview of object oriented modeling and
benefits of each.
COA60524.2) Identify the characteristics of the UML and why the UML is
relevant to the process development.
COA60524.6) Be able to describe the use cases, use cases Diagrams and
Activity Diagram.
COA60524.7) Identify and discuss the concept of events and signals, process
and threads and state chart Diagrams.
1.
Brief Notes on the importance of the course and how it fits into the curriculum
Object-oriented analysis and design (OOAD) is a popular technical approach for analyzing,
designing an application, system, or business by applying the object-oriented paradigm and
visual modeling throughout the development life cycles to foster better stakeholder
communication and product quality.
According to the popular guide Unified Process, OOAD in modern software engineering is
best conducted in an iterative and incremental way. Iteration by iteration, the outputs of
OOAD activities, analysis models for OOA and design models for OOD respectively, will be
refined and evolve continuously driven by key factors like risks and business value.
Prerequisites
Object Oriented Programming System
Contents Plan
S.L Unit Total Topics to be covered Page
no No no. of No
hours
1 1 Introduction to OOAD with OO Basics
2 1 Unified Process in Object Oriented Analysis and Design
3 1 UML diagrams in OOAD
4 1 Case study:the Next Gen POS system
5 1 Inception Concepts in OOAD
6 I 1 Use Case Modelling in OOAD
7 2 Relating Use Cases Include, Extend and Generalization
8 1 When to use Use-Cases in OOAD
9 1 Class Diagram in OOAD
10 1 Elaboration Concepts in OOAD
11 1 Domain Model in OOAD
12 1 Finding Conceptual Classes and Description Classes in
OOAD
13 1 Associations and Attributes in OOAD
14 1 Domain Model Refinement in OOAD
15 1 Finding Conceptual Class Hierarchies in OOAD
16 II 1 Aggregation and Composition in OOAD
17 1 Relationship Between Sequence and Use Cases in
OOAD
18 1 When to Use Class Diagrams in OOAD
19 1 Dynamic and Interaction Diagram in OOAD
20 1 System Sequence and Collaboration Diagram in OOAD
21 1 When to use Communication Diagrams
22 1 State machine diagram and Modelling
23 1 When to use State Diagrams
524 III 1 Activity Diagram and When to Use in OOAD
25 1 UML Package Diagram and When to Use it
26 1 Component Diagrams in OOAD
27 1 Deployment Diagrams in OOAD
28 IV 2 General Responsibility Assignment Software
Patterns(GRASP)
29 3 Design Patterns in OOAD
30 3 Applying GoF Design Patterns
31 V 2 Object Oriented Methodologies in OOAD
32 2 Software Quality Assurance in OOAD
33 V 2 Impact of Object Orientation on Testing
34 2 Develop Test Cases and Test Plans in OOAD
Introduction to OOAD with OO Basics – Unified Process – UML diagrams – Use Case –Case study –
the Next Gen POS system, Inception -Use case Modelling – Relating Use cases – include, extend and
generalization – When to use Use-cases
Topic 1: Introduction to OOAD with OO Basics
Object-Oriented Analysis
Object–Oriented Analysis (OOA) is the procedure of identifying software engineering
requirements and developing software specifications in terms of a software system’s
object model, which comprises of interacting objects.
The primary tasks in object-oriented analysis (OOA) are:
Identifying objects
Organizing the objects by creating object model diagram
Defining the internals of the objects, or object attributes
Defining the behavior of the objects, i.e., object actions
Describing how the objects interact
Object-Oriented Design
Object–Oriented Design (OOD) involves implementation of the conceptual model
produced during object-oriented analysis.
The implementation details generally include:
Object-Oriented Programming
Object-oriented programming (OOP) is a programming paradigm based upon objects
(having both data and methods) that aims to incorporate the advantages of
modularity and reusability.
The important features of object–oriented programming are:
Object
An object is a real-world element in an object–oriented environment that may have a
physical or a conceptual existence.Class
A class represents a collection of objects having same characteristic properties that
exhibit common behavior
Scan this QR Code From QR Code Scanner App Using Your Smart Phone
**************************************************************************************************
Unified Process
Unified Process is based on the enlargement and refinement of a system
through multiple iterations, with cyclic feedback and adaptation. The system
is developed incrementally over time, iteration by iteration, and thus this
approach is also known as iterative and incremental software development.
Four Phases
Inception
the first and the shortest phase in the project. It is used to prepare basis
for the project, including preparation of business case
establishing project scope and setting boundaries,
outlining key requirements, and possible architecture solution together
with design trade offs,
identifying risks, and development of initial project plan
schedule with main milestones and cost estimates.
Elaboration
Construction
the longest and largest phase within Unified Process. During this phase,
the design of the system is finalized and refined and the system is built
using the basis created during elaboration phase.
The construction phase is divided into multiple iterations, for each
iteration to result in an executable release of the system.
The final iteration of construction phase releases fully completed system
which is to be deployed during transition phase.
Transition
the final project phase which delivers the new system to its end-users.
Transition phase includes also data migration from legacy systems and
user training.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
*********************************************************************************************
A UML diagram is a diagram based on the UML (Unified Modeling Language) with the
purpose of visually representing a system along with its main actors, roles,
actions, artifacts or classes, in order to better understand, alter, maintain, or
document information about the system.
What is UML?
UML is an acronym that stands for Unified Modeling Language. Simply put, UML is
a modern approach to modeling and documenting software. In fact, it’s one of the
most popular business process modeling techniques.
UML was created as a result of the chaos revolving around software development and
documentation. In the 1990s, there were several different ways to represent and
document software systems. The need arose for a more unified way to visually
represent those systems and as a result, in 1994-1996, the UML was developed by
three software engineers working at Rational Software. It was later adopted as the
standard in 1997 and has remained the standard ever since, receiving only a few
updates.
Activity Diagram
Use Case Diagram
Interaction Overview Diagram
Timing Diagram
State Machine Diagram
Communication Diagram
Sequence Diagram
Class Diagram
Object Diagram
Component Diagram
Composite Structure Diagram
Deployment Diagram
Package Diagram
Profile Diagram
Activity Diagram
Activity diagrams are probably the most important UML diagrams for doing business
process modeling. In software development, it is generally used to describe the flow of
different activities and actions. These can be both sequential and in parallel. They
describe the objects used, consumed or produced by an activity and the relationship
between the different activities. All the above are essential in business process
modeling.
Use Case Diagram
A cornerstone part of the system is the functional requirements that the system
fulfills. Use Case diagrams are used to analyze the system’s high-level requirements.
These requirements are expressed through different use cases. We notice three main
components of this UML diagram:
Component Diagram
When dealing with documentation of complex systems, component UML diagrams
can help break down the system into smaller components. Sometimes it is hard to
depict the architecture of a system because it might encompass several departments
or it might employ different technologies.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
***************************************************************************************
A use case diagram is a graphic depiction of the interactions among the elements of a
system.
1. identify,
2. clarify,
3. Organize system requirements.
In this context, the term "system" refers to something being developed or operated,
such as a mail-order product sales and service Web site. Use case diagrams are
employed in UML (Unified Modeling Language), a standard notation for the modeling
of real-world objects and systems.
Actor
Use case
System
Package
Actor
Actor in a use case diagram is any entity that performs a role in one given system.
This could be a person, organization or an external system and usually drawn like
skeleton shown below.
Use Case
A use case represents a function or an action within the system. It’s drawn as an
oval and named with the function.
System
The system is used to define the scope of the use case and drawn as a rectangle.
This an optional element but useful when you’re visualizing large systems. For
example, you can create all the use cases and then use the system object to define
the scope covered by your project. Or you can even use it to show the different areas
covered in different releases.
Package
The package is another optional element that is extremely useful in complex
diagrams. Similar to class diagrams, packages are used to group together use
cases. They are drawn like the image shown below.
The SpecialOrder and NormalOrder use cases are extended from Order use case.
Hence, they have extended relationship. Another important point is to identify the
system boundary, which is shown in the picture. The actor Customer lies outside the
system as it is an external user of the system.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
***************************************************************
The NextGen case study primarily emphasizes the problem domain objects,
allocating responsibilities to them to fulfill the requirements of the application.
Object-oriented design is also applied to create a technical service subsystem
for interfacing with a database.
In this design approach, the UI layer has very little responsibility; it is said to
be thin. Windows do not contain code that performs application logic or
processing. Rather, task requests are forwarded on to other layers.
In this apparently straightforward problem domain, we shall see that there are
interesting requirement and design problems to solve. In addition, it’s a real
problem groups really do develop POS systems with object technologies.
A POS system is a computerized application used (in part) to record sales and handle
payments;
computer
and bar code scanner,
and software to run the system.
It interfaces to various service applications, such as a third – party tax calculator and
inventory control. These systems must be relatively fault – tolerant; that is, even if
remote services are temporarily unavailable (such as the inventory system), they
must still be capable of capturing sales and handling at least cash payments (so that
the business is not crippled).
POS Support:
A POS system increasingly must support multiple and varied client – side terminals
and interfaces. These include a thin – client Web browser terminal, a regular
personal computer with something like a Java Swing graphical user interface, touch
screen input, wireless PDAs, and so forth.
Development Strategy
Using an iterative development strategy, we are going to proceed through
requirements,
object –oriented analysis,
design,
and implementation.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
The life of a software system can be represented as a series of cycles. A cycle ends with the release of a
version of the system to customers.
Each phase contains one or more iterations. We'll explore the concept of iterations in
the section "Iterations and Increments"
The following subsections describe the key aspects of each of these phases.
Inception
The primary goal of the Inception phase is to establish the case for the viability of
the proposed system.
The tasks that a project team performs during Inception include the following:
Defining the scope of the system (that is, what's in and what's out)
Outlining a candidate architecture, which is made up of initial versions of six
different models
Identifying critical risks and determining when and how the project will
address them
Starting to make the business case that the project is worth doing, based on
initial estimates of cost, effort, schedule, and product quality
The major milestone associated with the Inception phase is called Life-Cycle
Objectives. The indications that the project has reached this milestone include the
following:
Elaboration
The primary goal of the Elaboration phase is to establish the ability to build the new
system given the financial constraints, schedule constraints, and other kinds of
constraints that the development project faces.
The tasks that a project team performs during Elaboration include the following:
The architectural baseline contains expanded versions of the six models initialized
during the Inception phase.The major milestone associated with the Elaboration
phase is called Life-Cycle Architecture.
The indications that the project has reached this milestone include the following:
Most of the functional requirements for the new system have been captured in
the use case model.
The architectural baseline is a small, skinny system that will serve as a solid
foundation for ongoing development.The business case has received a green
light, and the project team has an initial project plan that describes how the
Construction phase will proceed.
The use case model is described in the upcoming section "The Five Workflows." Risks
are discussed in the section "Iterations and Increments" later in this chapter.
Construction
Transition
The primary goal of the Transition phase is to roll out the fully functional
system to customers.
During Transition, the project team focuses on correcting defects and
modifying the system to correct previously unidentified problems.
The major milestone associated with the Transition phase is called Product
Release.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
***************************************************************
Topic 7 Use Case Modelling in OOAD
A use-case model is a model of how different types of users interact with the system
to solve a problem. As such, it describes the goals of the users, the interactions
between the users and the system, and the required behavior of the system in
satisfying these goals.
use cases,
actors
and the relationships between them.
The use-case model may contain packages that are used to structure the model
to simplify
analysis,
communications,
navigation,
development,
maintenance
and planning.
Use Case
A model element representing each use case. Properties include the use case name
and use case specification. See Artifact: Use Case and Concept: Use Case for more
information.
Associations
Associations are used to describe the relationships between actors and the use cases
they participate in. This relationship is commonly known as a “communicates-
association”.
Subject
A model element that represents the boundary of the system of interest.
Use-Case Package
A model element used to structure the use case model to simplify analysis,
communications, navigation, and planning. If there are many use cases or actors,
you can use use-case packages to further structure the use-case model in much the
same manner you use folders or directories to structure the information on your
hard-disk.
You can partition a use-case model into use-case packages for several reasons,
including:
To reflect the order, configuration, or delivery units in the finished system thus
supporting iteration planning.
To support parallel development by dividing the problem into bite-sized pieces.
To simplify communication with different stakeholders by creating packages for
containing use cases and actors relevant to a particular stakeholder.
Generalizations
A relationship between actors to support re-use of common properties.
Dependencies
A number of dependency types between use cases are defined in UML. In particular,
<<extend>> and <<include>>.
<<extend>> is used to include optional behavior from an extending use case in an
extended use case.
<<include>> is used to include common behavior from an included use case into a
base use case in order to support re-use of common behavior.
The latter is the most widely used dependency and is useful for:
Factoring out behavior from the base use case that is not necessary for the
understanding of the primary purpose of the use case to simplify
communications.
Factoring out behavior that is in common for two or more use cases to
maximize re-use, simplify maintenance and ensure consistency.Example Use-
Case Diagram
Figure 1 shows a use-case diagram from an Automated Teller Machine (ATM) use-
case model.
Category Function
Activity edges Represent the flow between activities
Associations Indicate that instances of one model element are connected to
instances of another model element
Dependencies Indicate that a change to one model element can affect another
model element
Generalizations Indicate that one model element is a specialization of another model
element
Realizations Indicate that one model element provides a specification that
another model element implements
Transitions Represent changes in state
You can set properties and use keywords to create variations of these relationships.
The following topics describe the relationships that you can use in use-case
diagrams:
Association relationships
In UML models, an association is a relationship between two classifiers, such
as classes or use cases, that describes the reasons for the relationship and the
rules that govern the relationship.
Generalization relationships
In UML modeling, a generalization relationship is a relationship in which one
model element (the child) is based on another model element (the parent).
Generalization relationships are used in class, component, deployment, and
use-case diagrams to indicate that the child receives all of the attributes,
operations, and relationships that are defined in the parent.
Include relationships
In UML modeling, an include relationship is a relationship in which one use
case (the base use case) includes the functionality of another use case (the
inclusion use case). The include relationship supports the reuse of
functionality in a use-case model.
Extend relationships
In UML modeling, you can use an extend relationship to specify that one use
case (extension) extends the behavior of another use case (base). This type of
relationship reveals details about a system or application that are typically
hidden in a use case.
Check out the use case diagram guidelines for other things to consider when adding
an actor.
Generalization of an Actor
Generalization of an actor means that one actor can inherit the role of the other
actor. The descendant inherits all the use cases of the ancestor. The descendant has
one or more use cases that are specific to that role. Let’s expand the previous use
case diagram to show the generalization of an actor.
A generalized actor in an use case diagram
The extending use case is dependent on the extended (base) use case. In
the below diagram the “Calculate Bonus” use case doesn’t make much sense
without the “Deposit Funds” use case.
The extending use case is usually optional and can be triggered
conditionally. In the diagram, you can see that the extending use case is
triggered only for deposits over 10,000 or when the age is over 55.
The extended (base) use case must be meaningful on its own. This means it
should be independent and must not rely on the behavior of the extending use
case.
The base use case is incomplete without the included use case.
The included use case is mandatory and not optional.
Lest expand our banking system use case diagram to show include relationships as
well.
Includes is usually used to model common behavior
For some further reading regarding the difference between extend and include
relationships in use case diagrams check this StackOverflow link.
You can develop the elements of a use-case model in any order but the following
sequence of steps tends to be most efficient.
The actors represent users and external systems that will interact with the system
under development. Actors represent categories of users or external systems. One
way to identify actors is to list the specific users that will use the system and then
organize them into categories based on their role or the purpose they have for using
the system.
Example:
Consider the task of finding actors for a software system which simulates a virtual
mall. A virtual mall connects buyers and merchants.
Customer - A customer represents any person who uses the services of the virtual
mall.
Affiliate - An affiliate represents a person or organization who is authorized to sell
merchandise at the virtual mall.
Credit Bureau - A credit bureau represents an external system used to verify the
creditworthiness of a customer.
For example, the feature list for a virtual mall might include:
1) list item for sale,
2) browse items for sale,
3) purchase an item. Each feature is a potential use case.
Interviews
Use cases emerge during interviews with the client and end users of the system. The
ways that actors use the system will also suggest use cases.
During this step it's sufficient to name each use case and provide a short description
of the use case.
During the next step you will describe each use case in detail. A use case name
should include a noun and a verb. Usually the name will start with an action verb
followed by a noun which represents the recipient of the action. The name should
suggest what is achieved by the use case.
For example: deactivate alarm, post article, find and read article.
Scope
During this step and the next you will need to determine the scope of each use case.
For a given activity the challenge is to decide if the activity should be a use case by
itself or be included as a part of another use case. Use cases tend to split and
combine like lava in a lava lamp until they settle into an well organized group. A well
organized group is one that is easy to understand, review, test, and implement in one
iteration.
Example:
The use cases that emerge from exploring how each actor gets value from or provides
value to the system are:
Browse Inventory - This use cases is used by a customer to shop for items to
purchase.
The following UML use-case diagram shows the relationships between actors and use
cases:
First, it helps determine what order the uses cases will be implemented.
Implementing the highest priority use cases first reduces the risk a high priority item
won't make the schedule and provides more time to insure the item is implemented
correctly.
Developers work from use cases when they implement the system. Therefore, they
must contain all the details of interaction between actors and the system.
It's convenient to organize the interaction between a use case and its associated
actors as a flow of events with one common flow of events though the use case and
zero or more alternate paths or variations. Each path through the use case is called a
scenario. Alternate paths can be listed inline with the common path description or
separately after the common path description. It may be helpful to number the steps
of the use case to indicate order and to facilitate referencing portions of a use case.
Example:
Purchase an Item - This use case is used by a customer to purchase an item.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
Class Diagram gives the static view of an application. A class diagram describes the
types of objects in the system and the different types of relationships that exist
among them. This modeling method can run with almost all Object-Oriented
Methods. A class can refer to another class. A class can have its objects or may
inherit from other classes.
classes,
interfaces,
associations
collaborations
and constraints.
In the example, a class called “loan account” is depicted. Classes in class diagrams
are represented by boxes that are partitioned into three:
Class
A class represents a relevant concept from the domain, a set of persons, objects, or
ideas that are depicted in the IT system:
Attribute
An attribute of a class represents a characteristic of a class that is of interest for the
user of the IT system:
Association
An association represents a relationship between two classes:
An association indicates that objects of one class have a relationship with objects of
another class, in which this connection has a specifically defined meaning (for
example, “is flown with”).
Multiplicity
A multiplicity allows for statements about the number of objects that are involved in
an association:
Aggregation
An aggregation is a special case of an association (see above) meaning “consists of”:
Class Diagram Illustrates data models for even very complex information
systems
It provides an overview of how the application is structured before studying the
actual code. This can easily reduce the maintenance time
It helps for better understanding of general schematics of an application.
Allows drawing detailed charts which highlights code required to be
programmed
Helpful for developers and other stakeholders.
Class diagram is basically a graphical representation of the static view of the system
and represents different aspects of the application. A collection of class diagrams
represent the whole system.
The name of the class diagram should be meaningful to describe the aspect of
the system.
Each element and their relationships should be identified in advance.
Responsibility (attributes and methods) of each class should be clearly
identified
For each class, minimum number of properties should be specified, as
unnecessary properties will make the diagram complicated.
Use notes whenever required to describe some aspect of the diagram. At the
end of the drawing it should be understandable to the developer/coder.
Finally, before making the final version, the diagram should be drawn on plain
paper and reworked as many times as possible to make it correct.
First of all, Order and Customer are identified as the two elements of the
system. They have a one-to-many relationship because a customer can have
multiple orders.
Order class is an abstract class and it has two concrete classes (inheritance
relationship) SpecialOrder and NormalOrder.
The two inherited classes have all the properties as the Order class. In
addition, they have additional functions like dispatch () and receive ().
The following class diagram has been drawn considering all the points mentioned
above.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
The tasks that a project team performs during Elaboration include the following:
Capturing a healthy majority of the remaining functional requirements
Expanding the candidate architecture into a full architectural baseline, which
is an internal release of the system focused on describing the architecture
Addressing significant risks on an ongoing basis
Finalizing the business case for the project and preparing a project plan that
contains sufficient detail to guide the next phase of the project (Construction)
The architectural baseline contains expanded versions of the six models initialized
during the Inception phase.
The major milestone associated with the Elaboration phase is called Life-Cycle
Architecture. The indications that the project has reached this milestone include the
following:
Most of the functional requirements for the new system have been captured in
the use case model.
The architectural baseline is a small, skinny system that will serve as a solid
foundation for ongoing development.
The business case has received a green light, and the project team has an
initial project plan that describes how the Construction phase will proceed.
Elaborationis the initial series of iterations during which, on a normal project:
Elaboration is the initial series of iterations during which the team does serious
investigation, implements (programs and tests) the core architecture, clarifies most
requirements, and tackles the high - risk issues. In the UP, "risk" includes business
value. Therefore, early work may include implementing scenarios that are deemed
important, but are not especially technically risky.
Elaboration is not a design phase or a phase when the models are fully developed in
preparation for implementation in the construction step - that would be an example
of superimposing waterfall ideas on iterative development and the UP.
During this phase, one is not creating throw - away prototypes; rather, the code and
design are production - quality portions of the final system. In some UP descriptions,
the potentially misunderstood term "architectural prototype"is used to describe the
partial system. This is not meant to be a prototype in the sense of a discardable
experiment; in the UP, it means a production subset of the final system. More
commonly it is called the executable architectureor architectural baseline.
The UP defines the Domain Model as one of the artifacts that may be created in the
Business Modeling discipline. More precisely, the UP Domain Model is a
specialization of the UP Business Object Model (BOM) "focusing on explaining
'things' and products important to a business domain" [RUP]. That is, a Domain
Model focuses on one domain, such as POS related things.
The more broad BOM, not covered in this introductory text and not something I
encourage creating (because it can lead to too much up - front modeling), is an
expanded, often very large and difficult to create, multi - domain model that covers
the entire business and all its sub - domains.
Applying UML notation, a domain model is illustrated with a set of class diagrams in
which no operations (method signatures) are defined. It provides a conceptual
perspective. lt may show:
Domain models
Domain models are the initial artifacts created in Object-Oriented-Analysis. An object
has:
identity,
state, and
behaviour.
An object can be
terms that developers or users need to clarify in order to understand the use
case,
recurring nouns (higher frequency),
real world entities that the system needs to track,
real world activities
data sources or sinks
Identifying Attributes
An attribute is a logical data (property) of an object (e.g., my eyes are hazel). Most
attributes can be represented by simple data types (which are?).
Some heuristics for identifying attributes:
an attribute is part of the state of an object (a car's speed is 100 km/h, weight
of a work item)
attributes are required by the use case (i.e., ignore irrelevant attributes).
*********************************************************
Conceptual Model
Once we’ve some use cases or user stories, the next thing we can do is create a
conceptual model of our system. It simply means you’re identifying the most
important objects.
You shouldn’t be worried about software object right now, but more generically what
are the things in the application that we need to be aware of.
Things like product, item, shopping cart, order, invoice, paycheck, spaceship,
asteroid, level, that’s what we’re identifying here. Some of them will become actual
classes and software object, but not all of them.
First time through it will be incomplete, and that’s absolutely normal to miss out
even important objects, things that you will discover later on during programming.
1. Identifying Objects
2. Refining Objects
3. Drawing Objects
3. Identifying Object Relationships
4. Identifying Object Behaviors
For example a business might organize its concepts and relationships into three
packages:
Classes
In the hr package we might find the Position and Person classes. Typical
attributes of persons and positions can be listed in the attribute compartments
of the respective class icons. Typical operations performed by persons and
positions can be listed in their operation compartments:
In this example, an object representing a position, vice president for example,
has a title attribute of type String and an execute operation that takes a task,
t, as an input, and outputs a result.
An object representing a person has four attributes: last name, first name, and
Social Security number, all of type String, and a salary of type Money and with
initial value $0.0. The person class has no operations specified at this point.
It is often the case that operations correspond to responsibilities and are not
assigned to classes until the design phase. For this reason operation
compartments are often suppressed in domain models. Attribute
compartments can also be suppressed if they are not needed.
Note that the "-" sign indicates that the scope of an attribute or association endpoint
is private, visible only inside of the class. Other possible scopes are:
+ = public = system-wide scope
~ = package scope
# = protected = subclass scope
Generally speaking, the default for an attribute or association endpoint is private,
while the default for an operation is public.
Associations
Objects
Specific persons and positions can be represented using objects. Specific instances of
the filledBy relationship can be represented by links connecting the participating
objects:
Properties
These are the properties of an association on a UML Class Diagram.
To see the properties of an association, right-click the association and then
click Properties. The properties will appear in the Properties window.Some of the
properties are also visible on the diagram, as shown in the following illustration.
Property Description
Name (1) Identifies the association. Also appears on the diagram near the mid-point of the
association.
Qualified Identifies the association uniquely. Prefixed with the qualified name of the package that
Name contains the association's first role.
Work Items The number of work items linked to this association. To link work items, see Link
model elements and work items.
Color The color of the connector. Unlike the other properties, this is a property of this view of
the association, not a property of the underlying relationship in the model.
First Role Each end of the association is called a role. Each role describes the properties of the
Second equivalent attribute on the class at the opposite end of the association.
Role In the example diagram, the association between Menu and Menu Item has roles called
Menu and Contents.
Contents is the name of an attribute on the Menu class.
A domain model generally uses the vocabulary of the domain, thus allowing a
representation of the model to be communicated to non-technical stakeholders. It
should not refer to any technical implementations such as databases or software
components that are being designed.
The more broad BOM, not covered in this introductory text and not something I
encourage creating (because it can lead to too much up - front modeling), is an
expanded, often very large and difficult to create, multi - domain model that covers
the entire business and all its sub - domains.
Applying UML notation, a domain model is illustrated with a set of class diagrams in
which no operations (method signatures) are defined. It provides a conceptual
perspective. lt may show:
The concept of class hierarchy in computer science is very similar to taxonomy, the
classifications of species.
The relationships are specified in the science of object-oriented design and object
interface standards defined by popular use, language designers
(Java, C++, Smalltalk, Visual Prolog) and standards committees for software design
like the Object Management Group.
Upcasting
The class hierarchy can be as deep as needed. The Instance variables and
methods are inherited down through the levels and can be redefined according
to the requirement in a subclass. In general, the further down in the hierarchy
a class appears, the more specialized its behavior.
When a message is sent to an object, it is passed up the inheritance tree
starting from the class of the receiving object until a definition is found for the
method. This process is called upcasting.
For example
consider the superclass Paymentand its subclasses (CashPayment, and so on).
Assume the definition of Payment is that it represents the transaction of transferring
money (not necessarily cash) for a purchase from one party to another, and that all
payments have an amount of money transferred.
For example
in terms of set membership, all instances of the set CreditPayment are also members
of the set Payment.Most of the inheritence relationships are realized by template
parameterization! Therefore some of the inheritance links are not documented in a
inheritance graph in the reference. This picture shows the overall concept.
Do You Want Video Lecture for this topic
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
Association
Association is a relationship between two objects. In other words, association defines
the multiplicity between objects. You may be aware of one-to-one, one-to-many,
many-to-one, many-to-many all these words define an association between objects.
Aggregation is a special form of association. Composition is a special form of
aggregation.
Aggregation
Aggregation is a special case of association. A directional association between
objects. When an object ‘has-a’ another object, then you have got an aggregation
between them. Direction between them specified which object contains the other
object. Aggregation is also called a “Has-a” relationship.
Composition
Composition is a special case of aggregation. In a more specific manner, a restricted
aggregation is called composition. When an object contains the other object, if the
contained object cannot exist without the existence of container object, then it is
called composition.
Example: A class contains students. A student cannot exist without a class. There
exists composition between class and students.
Comparison Chart
BASIS FOR AGGREGATION COMPOSITION
COMPARISON
Basic In aggregation there exhibit a In composition the cannot exist
relationship where a child can exist independently of the parent.
independently of the parent.
Type of "has a" "part of"
relationship
Association type Weak association Strong association
UML design Represented by a hollow diamond Represented by a solid diamond
symbol next to assembly class. next to assembly class.
Function The deletion of assembly doesn't If the owning class object is
affect its parts. deleted, it could significantly affect
the containing class object.
1. Aggregation indicates a relationship where a child and parent entities can exist
independently. As against, in composition, the child entity is dependent on the
parent.
2. In aggregation there exist a “has a” relationship whereas in composition there
is a “part of” relationship between the assembly and constituent class objects.
3. Aggregation is weak association while the composition is a strong association
because it has more constraints.
4. In UML design the aggregation is described by a hollow diamond. In contrast,
the composition is pictured by a solid diamond.
Sequence diagrams are used to model the flow of logic within a system by showing
the information (also known as stimuli, or message) that is passed between the
objects during the execution of a scenario. It is a type of interaction diagram as it
describes how and in what order a group of objects (interface components or software
components) interact with one another. Sequence diagrams are also known as event
diagrams.
However, it does not show how the objects are related to each other.
Notation:
Objects are represented as boxes from left to right. Messages sent are represented as
horizontal arrows with name on top. Particular instances of each object are shown
with a lifeline below to indicate when the object is created and destroyed.
Earlier events are depicted at the top of the lifeline, with the later events shown
further down. Arrival of a stimulus at an object is called an event.
Sequence diagrams only specify the ordering of events and not the exact timings of
events. An activation box represents the period during which an operation is
executed.
Strengths
Limitations
Creating sequence diagram for every use case can be a waste of time and effort.
Fairly technical.
Use case diagram depicts how actors (a person or a system) interacts with a solution
to accomplish one or more of the person’s or systems goals. It visually depicts the
scope of the solution, the actors involved, and the use cases.
Notations:
Extend: Allows for insertion of additional behavior into a use case. Here, base use
case gets extended by the extended use case. Extending use case is optional and its
execution ALWAYS depends on a condition. The point at which extension occurs is
called extension point.
The base use case (extended use case) is complete without the extending use case
where as the extending use case is incomplete without the base use case.
Include: Allows base use case to make use of the functionality present in another
use case. Included use case is ALWAYS executed. The base use case is incomplete
without the included use case.
Common function is represented by include relationship and is mandatory.
Additional function is represented by extend relationship and is non-mandatory.
Strengths
Limitations
Don't try to use all the notations available to you. Start with the simple stuff in
this chapter: classes, associations, attributes, generalization, and constraints.
Introduce other notations from Chapter 6 only when you need them.
Fit the perspective from which you are drawing the models to the stage of the
project.
o If you are in analysis, draw conceptual models.
o When working with software, concentrate on specification models.
o Draw implementation models only when you are illustrating a particular
implementation technique.
Don't draw models for everything; instead, concentrate on the key areas. It is
better to have a few diagrams that you use and keep up to date than to have
many forgotten, obsolete models.
Dynamic
Static.
Dynamic models
such as UML interaction diagrams (sequence diagrams or communication
diagrams), help design the logic, the behavior of the code or the method bodies.
They tend to be the more interesting, difficult, important diagrams to create.
Static models
such as UML class diagrams, help design the definition of packages, class names,
attributes, and method signatures .
Static and dynamic UML diagrams for object modeling
There's a relationship between static and dynamic modeling and the agile modeling
practice of create models in parallel: Spend a short period of time on interaction
diagrams (dynamics), then switch to a wall of related class diagrams (statics).
From the term Interaction, it is clear that the diagram is used to describe some
type of interactions among the different elements in the model. This interaction
is a part of dynamic behavior of the system.
This interactive behavior is represented in UML by two diagrams known
as Sequence diagram and Collaboration diagram. The basic purpose of both
the diagrams are similar.
Interaction diagrams come in two forms, both present in the UML. The first form is
the sequence diagram. In this form objects are shown as vertical lines with the
messages as horizontal lines between them.
This form was first popularized by Jacobson. The diagram below shows this form in
its UML notation. The sequence of messages is indicated by reading down the page.
Figure 1: A sequence diagram.
The second form of the interaction diagram is the collaboration diagram. Here the
example objects are shown as icons. Again arrows indicate the messages sent in the
use case.
A Sequence diagram is an interaction diagram that details about the operation that
is carried out. Sequence diagram captures the interaction between the objects in the
context of collaboration. Sequence diagrams are time focused and they show the
order of the interaction visually by using the vertical axis of the diagram to represent
time.
Example:
Collaboration Diagram represents the interaction of the objects to perform the
behavior of a particular use case or a part of use case. The designers use the
Sequence diagram and Collaboration Diagrams to define and clarify the roles of the
objects that perform a particular flow of events of a use case.
Example:
Similarities Between Sequence and Collaboration Diagram
1. In Unified Modelling Language both the sequence diagram and collaboration
diagram are used as interaction diagrams.
2. Both the diagrams details about the behavioral aspects of the system.
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
Model message passing between objects or roles that deliver the functionalities
of use cases and operations
Model mechanisms within the architectural design of the system
Capture interactions that show the passed messages between objects and roles
within the collaboration scenario
Model alternative scenarios within use cases or operations that involve the
collaboration of different objects and interactions
Support the identification of objects (hence classes), and their attributes
(parameters of message) and operations (messages) that participate in use
cases
In the example of the notation for a communication diagram, objects (actors in use
cases) are represented by rectangles. In the example (generic communication
diagram):
The objects are Object1, Object2, Object..., ObjectN-1 ..., and ObjectN.
Messages passed between objects are represented by labeled arrows that start
with the sending object (actor) and end with the receiving object.
The sample messages passed between objects are labeled 1: message1, 2:
message2, 3: message3, etc., where the numerical prefix to the message name
indicates its order in the sequence.
Object1 first sends Object2 the message message1, Object2 in turn sends
ObjectN-1 the message message2, and so on.
Messages that objects send to themselves are indicated as loops (e.g., message
message5).
For example, in the communication diagram in the figure below, you can follow the
sequence numbers to determine the order of messages between objects:
Do You Want Video Lecture for this topic
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
State machine diagrams are also called as state chart diagrams. State machine
diagrams are used to capture the behavior of a software system. UML State machine
diagrams can be used to model the behavior of a class, a subsystem, a package, or
even an entire system. It is also called a Statechart or State Transition diagram.
Statechart diagrams are used to describe various states of an entity within the
application system.
There are a total of two types of state machine diagrams:
Statechart diagram is used to capture the dynamic aspect of a system. State machine
diagrams are used to represent the behavior of an application. An object goes
through various states during its lifespan. The lifespan of an object remains until the
program is terminated. The object goes from multiple states depending upon the
event that occurs within the object. Each state represents some unique information
about the object.
Following are the various notations that are used throughout the state chart
diagram. All these notations, when combined, make up a single diagram.
UML state diagram notations
Initial state
The initial state symbol is used to indicate the beginning of a state machine diagram.
Final state
Decision box
Transition
A transition is a change in one state into another state which is occurred because of
some event. A transition causes a change in the state of an object.
State box
Types of State
Simple state
o They do not have any substrate.
Composite state
o These types of states can have one or more than one substrate.
o A composite state with two or more substates is called an orthogonal
state.
Submachine state
o These states are semantically equal to the composite states.
o Unlike the composite state, we can reuse the submachine states.
From the above discussion, we can define the practical applications of a Statechart
diagram. Statechart diagrams are used to model the dynamic aspect of a system like
other four diagrams discussed in this tutorial. However, it has some distinguishing
characteristics for modeling the dynamic nature.
Statechart diagram defines the states of a component and these state changes are
dynamic in nature. Its specific purpose is to define the state changes triggered by
events. Events are internal or external factors influencing the system.
Statechart diagrams are used to model the states and also the events operating on
the system. When implementing a system, it is very important to clarify different
states of an object during its life time and Statechart diagrams are used for this
purpose. When these states and events are identified, they are used to model it and
these models are used during the implementation of the system.
Object Flow
Object flow refers to the creation and modification of objects by activities. An object
flow arrow from an action to an object means that the action creates or influences
the object. An object flow arrow from an object to an action indicates that the action
state uses the object.
Guards
In UML, guards are a statement written next to a decision diamond that must be true
before moving next to the next activity. These are not essential, but are useful when
a specific answer, such as "Yes, three labels are printed," is needed before moving
forward.
Synchronization
A fork node is used to split a single incoming flow into multiple concurrent flows. It is
represented as a straight, slightly thicker line in an activity diagram.
A join node joins multiple concurrent flows back into a single outgoing flow.
A fork and join mode used together are often referred to as synchronization.
Time Event
This refers to an event that stops the flow for a time; an hourglass depicts it.
Merge Event
A merge event brings together multiple flows that are not concurrent.
Sent and Received Signals
Signals represent how activities can be modified from outside the system. They
usually appear in pairs of sent and received signals, because the state can't change
until a response is received, much like synchronous messages in a sequence
diagram. For example, an authorization of payment is needed before an order can be
completed.
Interrupting Edge
An event, such as a cancellation, that interrupts the flow denoted with a lightning
bolt.
Swimlanes
Swimlanes group related activities into one column.
Final State or End Point
An arrow pointing to a filled circle nested inside another circle represents the final action state.
We use Activity Diagrams to illustrate the flow of control in a system and refer to
the steps involved in the execution of a use case. We model sequential and
concurrent activities using activity diagrams. So, we basically depict workflows
visually using an activity diagram. An activity diagram focuses on condition of flow
and the sequence in which it happens. We describe or depict what causes a
particular event using an activity diagram.
Activity diagram is suitable for modeling the activity flow of the system. An
application can have multiple systems. Activity diagram also captures these systems
and describes the flow from one system to another. This specific usage is not
available in other diagrams. These systems can be database, external queues, or any
other system.
Activity diagram can be used for −
some major elements of the package diagram are shown on the drawing below. Web
Shopping, Mobile Shopping, Phone Shopping, and Mail Shopping
packages merge Shopping Cart package. The same 4 packages use Payment package.
Both Payment and Shopping Cart packages import other packages.
Purpose of Package Diagrams
Package diagrams are used to structure high level system elements. Packages are
used for organizing large system which contains diagrams, documents and other key
deliverables.
Package Diagram can be used to simplify complex class diagrams, it can group
classes into packages.
A package is a collection of logically related UML elements.
Packages are depicted as file folders and can be used on any of the UML
diagrams.
[embedyt] https://www.youtube.com/watch?v=BgvwzJnUt4A[/embedyt]
Key Elements of Package Diagram
Visibility
Import
Access
When to Use Packages?
Visibility of Packages
In the first version of UML, components included in these diagrams were physical:
documents, database table, files, and executables, all physical elements with a
location.
In the world of UML 2, these components are less physical and more conceptual
stand-alone design elements such as a business process that provides or requires
interfaces to interact with other constructs in the system. The physical elements
described in UML 1, like files and documents, are now referred to as artifacts. A UML
2 component may contain multiple physical artifacts if they naturally belong
together.
Interface
An interface (small circle or semi-circle on a stick) describes a group of operations
used (required) or created (provided) by components. A full circle represents an
interface created or provided by the component. A semi-circle represents a required
interface, like a person's input.
Dependencies
Draw dependencies among components using dashed arrows.
Port
Ports are represented using a square along the edge of the system or a component. A
port is often used to help expose required and provided interfaces of a component.
A UML deployment diagram is a diagram that shows the configuration of run time
processing nodes and the components that live on them. Deployment diagrams is a
kind of structure diagram used in modeling the physical aspects of an object-oriented
system. They are often be used to model the static deployment view of a system
(topology of the hardware).
1. A node
2. A component
3. An artifact
4. An interface
Other Notations
Dependency
Association relationships.
May also contain notes and constraints.
Example of a Deployment diagram
Following deployment diagram represents the working of HTML5 video player in the
browser:
Controller
Information Expert
Creator
High Cohesion
Low Coupling
Polymorphism
Protected Classes
All these patterns answer some software problems, and these problems are common
to almost every software development project. These techniques have not been
invented to create new ways of working, but to better document and standardize old,
tried-and-tested programming principles in object-oriented design.
Design Patterns are incredibly important tools for software developers. Above solving
common problems, they give people a standard vernacular to communicate with, and
offer conceptual abstractions that are valuable in a wide set of circumstances.
The GRASP design patterns are a set of design patterns that came after the original
Gang of Four book that many of you might be familiar with. GRASP stands
for General Responsibility Assignment Software Patterns.
The Controller
The Controller is responsible for handling the requests of actors. The Controller
is the middle-man between your user clicking “Send” and your back-end making that
happen. The Controller knows how to interpret the actions of user-interfaces, and
how to connect those actions to behaviours in your system.
AngularJS,
Ruby on Rails,
Sails and more.
The controller pattern assigns the responsibility of dealing with system events to a
non-UI class that represents the overall system or a use case scenario. A controller
object is a non-user interface object responsible for receiving or handling a system
event.
A use case controller should be used to deal with all system events of a use case, and
may be used for more than one use case. For instance,
for the use cases
Create User
Delete User
one can have a single class called UserController, instead of two separate use case
controllers.
The controller is defined as the first object beyond the UI layer that receives
and coordinates ("controls") a system operation. The controller should delegate
the work that needs to be done to other objects; it coordinates or controls the
activity. It should not do much work itself.
The GRASP Controller can be thought of as being a part of the
application/service layer(assuming that the application has made an explicit
distinction between the application/service layer and the domain layer) in an
object-oriented system with common layers in an information system logical
architecture.
The Creator
The Creator takes the responsibility of creating certain other objects. This
pattern is probably the easiest to understand conceptually. There are a number of
reasons why a class may take the responsibility of creating another. The Creator
might have information on how to create said object, or it might be the class that
uses the object most closely. These decisions will be largely established in the initial
design of the system, and other documents such as UML diagrams will guide and
inform the Creator pattern.
EXAMPLE
The Creator Pattern allows for a lot of other best-practices to fall into place,
such as dependency injection and low-coupling. The Creator Pattern can be
used to enforce the logical design of a system.
The Creator Pattern is of course a parent to a whole family of patterns in the
Gang of Four book, including the very
useful Factory, Prototype and Singleton patterns.
Creation of objects is one of the most common activities in an object-oriented
system. Which class is responsible for creating objects is a fundamental
property of the relationship between objects of particular classes.
The Expert
As our systems grow, we might find that we are putting too much logic into our
controllers. This results in what we call “bloated controllers”. Bloated controllers
imply tight coupling in our system, which is bad.
The Expert Pattern solves this by encapsulating information about a task into a
distinct class. This may sound a bit abstract, but let’s work through a simple
example. User-authentication is a common problem. We can have a user that is
logging in to have their username and password validated within our system. With
just a controller, this might look this:
This transaction requires a lot of work on the part of the Controller. Authentication
may entail hashing, database look-ups and perhaps other application-specific tasks.
We therefore introduce an expert: Authentication Module. This module knows
precisely how to authenticate a user, and the Controller need only delegate the
authentication request to this module to know that authentication will be handled
correctly.
Information expert
also expert or the expert principle) is a principle used to determine where to
delegate responsibilities such as methods, computed fields, and so on.
Using the principle of information expert, a general approach to assigning
responsibilities is to look at a given responsibility, determine the information needed
to fulfill it, and then determine where that information is stored.
This will lead to placing the responsibility on the class with the most information
required to fulfill it.
High cohesion
High cohesion is an evaluative pattern that attempts to keep objects appropriately
focused, manageable and understandable. High cohesion is generally used in
support of low coupling.High cohesion means that the responsibilities of a given
element are strongly related and highly focused. Breaking programs into classes and
subsystems is an example of activities that increase the cohesive properties of a
system. Alternatively, low cohesion is a situation in which a given element has too
many unrelated responsibilities. Elements with low cohesion often suffer from being
hard to comprehend, reuse, maintain and change.
Low coupling
Coupling is a measure of how strongly one element is connected to, has knowledge
of, or relies on other elements. Low coupling is an evaluative pattern that dictates
how to assign responsibilities to support
Polymorphism
According to the polymorphism principle, responsibility for defining the variation of
behaviors based on type is assigned to the type for which this variation happens.
This is achieved using polymorphic operations. The user of the type should use
polymorphic operations instead of explicit branching based on type.
Protected variations
The protected variations pattern protects elements from the variations on other
elements (objects, systems, subsystems) by wrapping the focus of instability with
an interface and using polymorphism to create various implementations of this
interface.
Pure fabrication
A pure fabrication is a class that does not represent a concept in the problem
domain, specially made up to achieve low coupling, high cohesion, and the reuse
potential thereof derived (when a solution presented by the information expert pattern
does not). This kind of class is called a "service" in domain-driven design.
Do You Want Video Lecture for this topic
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
A design pattern provides a general reusable solution for the common problems
occurs in software design. The patterns typically show relationships and interactions
between classes or objects. The idea is to speed up the development process by
providing well tested, proven development/design paradigm.
By using the design patterns you can make your code more flexible, reusable and
maintainable. It is the most important part because java internally follows design
patterns.
Advantage of design pattern:
As per the design pattern reference book Design Patterns - Elements of Reusable
Object-Oriented Software , there are 23 design patterns. These patterns can be
classified in three categories: Creational, Structural and behavioral patterns. We'll
also discuss another category of design patterns: J2EE design patterns.
Core Java Design Patterns
In core java, there are mainly three types of design patterns, which are further
divided into their sub-parts:
1. Creational Design Pattern
1. Factory Pattern
2. Abstract Factory Pattern
3. Singleton Pattern
4. Prototype Pattern
5. Builder Pattern.
1. Adapter Pattern
2. Bridge Pattern
3. Composite Pattern
4. Decorator Pattern
5. Facade Pattern
6. Flyweight Pattern
7. Proxy Pattern
In 1994, four authors Erich Gamma, Richard Helm, Ralph Johnson und John
Vlissides published a book titled Design Patterns - Elements of Reusable Object-
Oriented Software which initiated the concept of Design Pattern in Software
development.
These authors are collectively known as Gang of Four (GOF). According to these
authors design patterns are primarily based on the following principles of object
orientated design.
Best Practices
Design patterns have been evolved over a long period of time and they provide best
solutions to certain problems faced during software development. Learning these
patterns helps un-experienced developers to learn software design in an easy and
faster way.
1. Adapter Pattern
2. Bridge Pattern
3. Composite Pattern
4. Decorator Pattern
5. Facade Pattern
6. Flyweight Pattern
7. Proxy Pattern
Factory Pattern
Factory pattern is one of the most used design patterns in Java. This type of
design pattern comes under creational pattern as this pattern provides one of
the best ways to create an object.
In Factory pattern, we create object without exposing the creation logic to the
client and refer to newly created object using a common interface.
Implementation
We're going to create a Shape interface and concrete classes implementing
the Shape interface. A factory class ShapeFactory is defined as a next step.
FactoryPatternDemo, our demo class will use ShapeFactory to get a Shape object. It
will pass information (CIRCLE / RECTANGLE / SQUARE) to ShapeFactory to get the
type of object it needs.
Step 1
Create an interface.
Shape.java
public interface Shape {
void draw();
}
Step 2
Create concrete classes implementing the same interface.
Rectangle.java
public class Rectangle implements Shape {
@Override
public void draw() {
System.out.println("Inside Rectangle::draw() method.");
}
}
Square.java
public class Square implements Shape {
@Override
public void draw() {
System.out.println("Inside Square::draw() method.");
}
}
Circle.java
public class Circle implements Shape {
@Override
public void draw() {
System.out.println("Inside Circle::draw() method.");
}
}
Step 3
Create a Factory to generate object of concrete class based on given information.
ShapeFactory.java
public class ShapeFactory {
Step 4
Use the Factory to get object of concrete class by passing an information such as
type.
FactoryPatternDemo.java
public class FactoryPatternDemo {
Step 5
Verify the output.
Inside Circle::draw() method.
Inside Rectangle::draw() method.
Inside Square::draw() method.
Adapter Pattern
Step 2
Create concrete classes implementing the AdvancedMediaPlayer interface.
VlcPlayer.java
public class VlcPlayer implements AdvancedMediaPlayer{
@Override
public void playVlc(String fileName) {
System.out.println("Playing vlc file. Name: "+ fileName);
}
@Override
public void playMp4(String fileName) {
//do nothing
}
}
Mp4Player.java
public class Mp4Player implements AdvancedMediaPlayer{
@Override
public void playVlc(String fileName) {
//do nothing
}
@Override
public void playMp4(String fileName) {
System.out.println("Playing mp4 file. Name: "+ fileName);
}
}
Step 3
Create adapter class implementing the MediaPlayer interface.
MediaAdapter.java
public class MediaAdapter implements MediaPlayer {
AdvancedMediaPlayer advancedMusicPlayer;
@Override
public void play(String audioType, String fileName) {
if(audioType.equalsIgnoreCase("vlc")){
advancedMusicPlayer.playVlc(fileName);
}else if(audioType.equalsIgnoreCase("mp4")){
advancedMusicPlayer.playMp4(fileName);
}
}
}
Step 4
Create concrete class implementing the MediaPlayer interface.
AudioPlayer.java
public class AudioPlayer implements MediaPlayer {
MediaAdapter mediaAdapter;
@Override
public void play(String audioType, String fileName) {
Step 5
Use the AudioPlayer to play different types of audio formats.
AdapterPatternDemo.java
public class AdapterPatternDemo {
public static void main(String[] args) {
AudioPlayer audioPlayer = new AudioPlayer();
Step 6
Verify the output.
Playing mp3 file. Name: beyond the horizon.mp3
Playing mp4 file. Name: alone.mp4
Playing vlc file. Name: far far away.vlc
Invalid media. avi format not supported
Bridge Pattern
Bridge is used where we need to decouple an abstraction from its implementation so
that the two can vary independently. This type of design pattern comes under
structural pattern as this pattern decouples implementation class and abstract class
by providing a bridge structure between them.
This pattern involves an interface which acts as a bridge which makes the
functionality of concrete classes independent from interface implementer classes.
Both types of classes can be altered structurally without affecting each other.
We are demonstrating use of Bridge pattern via following example in which a circle
can be drawn in different colors using same abstract class method but different
bridge implementer classes.
Implementation
We've an interface DrawAPI interface which is acting as a bridge implementer and
concrete classes RedCircle, GreenCircle implementing
the DrawAPI interface. Shape is an abstract class and will use object
of DrawAPI. BridgePatternDemo, our demo class will use Shape class to draw
different colored circle.
Step 1
Create bridge implementer interface.
DrawAPI.java
public interface DrawAPI {
public void drawCircle(int radius, int x, int y);
}
Step 2
Create concrete bridge implementer classes implementing the DrawAPI interface.
RedCircle.java
public class RedCircle implements DrawAPI {
@Override
public void drawCircle(int radius, int x, int y) {
System.out.println("Drawing Circle[ color: red, radius: "
+ radius +", x: " +x+", "+ y +"]");
}
}
GreenCircle.java
public class GreenCircle implements DrawAPI {
@Override
public void drawCircle(int radius, int x, int y) {
System.out.println("Drawing Circle[ color: green, radius: "
+ radius +", x: " +x+", "+ y +"]");
}
}
Step 3
Create an abstract class Shape using the DrawAPI interface.
Shape.java
public abstract class Shape {
protected DrawAPI drawAPI;
protected Shape(DrawAPI drawAPI){
this.drawAPI = drawAPI;
}
public abstract void draw();
}
Step 4
Create concrete class implementing the Shape interface.
Circle.java
public class Circle extends Shape {
private int x, y, radius;
Step 5
Use the Shape and DrawAPI classes to draw different colored circles.
BridgePatternDemo.java
public class BridgePatternDemo {
public static void main(String[] args) {
Shape redCircle = new Circle(100,100, 10, new RedCircle());
Shape greenCircle = new Circle(100,100, 10, new GreenCircle());
redCircle.draw();
greenCircle.draw();
}
}
Step 6
Verify the output.
Drawing Circle[ color: red, radius: 10, x: 100, 100]
Drawing Circle[ color: green, radius: 10, x: 100, 100]
Behavioral design patterns are concerned with the interaction and responsibility
of objects.
In these design patterns,the interaction between the objects should be in such a
way that they can easily talk to each other and still should be loosely coupled.
That means the implementation and the client should be loosely coupled in order to
avoid hard coding and dependencies.
There are 12 types of structural design patterns:
Strategy Pattern
In Strategy pattern, a class behavior or its algorithm can be changed at run time.
This type of design pattern comes under behavior pattern.
In Strategy pattern, we create objects which represent various strategies and a
context object whose behavior varies as per its strategy object. The strategy object
changes the executing algorithm of the context object.
Implementation
We are going to create a Strategy interface defining an action and concrete strategy
classes implementing the Strategy interface. Context is a class which uses a Strategy.
StrategyPatternDemo, our demo class, will use Context and strategy objects to
demonstrate change in Context behaviour based on strategy it deploys or uses.
Step 1
Create an interface.
Strategy.java
public interface Strategy {
public int doOperation(int num1, int num2);
}
Step 2
Create concrete classes implementing the same interface.
OperationAdd.java
public class OperationAdd implements Strategy{
@Override
public int doOperation(int num1, int num2) {
return num1 + num2;
}
}
OperationSubstract.java
public class OperationSubstract implements Strategy{
@Override
public int doOperation(int num1, int num2) {
return num1 - num2;
}
}
OperationMultiply.java
public class OperationMultiply implements Strategy{
@Override
public int doOperation(int num1, int num2) {
return num1 * num2;
}
}
Step 3
Create Context Class.
Context.java
public class Context {
private Strategy strategy;
Step 4
Use the Context to see change in behaviour when it changes its Strategy.
StrategyPatternDemo.java
public class StrategyPatternDemo {
public static void main(String[] args) {
Context context = new Context(new OperationAdd());
System.out.println("10 + 5 = " + context.executeStrategy(10, 5));
Step 5
Verify the output.
10 + 5 = 15
10 - 5 = 5
10 * 5 = 50
Observer Pattern
Observer pattern is used when there is one-to-many relationship between objects
such as if one object is modified, its depenedent objects are to be notified
automatically. Observer pattern falls under behavioral pattern category.
Implementation
Observer pattern uses three actor classes. Subject, Observer and Client. Subject is
an object having methods to attach and detach observers to a client object. We have
created an abstract class Observer and a concrete class Subject that is extending
class Observer.
Do You Want Video Lecture for this topic
Scan this QR Code from QR Code Scanner App Using Your Smart Phone
ObserverPatternDemo, our demo class, will use Subject and concrete class object to
show observer pattern in action.
Step 1
Create Subject class.
Subject.java
import java.util.ArrayList;
import java.util.List;
Step 2
Create Observer class.
Observer.java
public abstract class Observer {
protected Subject subject;
public abstract void update();
}
Step 3
Create concrete observer classes
BinaryObserver.java
public class BinaryObserver extends Observer{
@Override
public void update() {
System.out.println( "Binary String: " + Integer.toBinaryString( subject.getState() )
);
}
}
OctalObserver.java
public class OctalObserver extends Observer{
@Override
public void update() {
System.out.println( "Octal String: " + Integer.toOctalString( subject.getState() ) );
}
}
HexaObserver.java
public class HexaObserver extends Observer{
@Override
public void update() {
System.out.println( "Hex String: " + Integer.toHexString( subject.getState()
).toUpperCase() );
}
}
Step 4
new HexaObserver(subject);
new OctalObserver(subject);
new BinaryObserver(subject);
Step 5
It was one of the first object oriented methodologies and was introduced by
Rumbaugh in 1991.
OMT uses three different models that are combined in a way that is analogous
to the older structured methodologies.
a. Analysis
b. OMT Models
I. Object Model
It depicts the object classes and their relationships as a class diagram, which
represents the static structure of the system.
It observes all the objects as static and does not pay any attention to their
dynamic nature.
c. Design
It specifies all of the details needed to describe how the system will be
implemented.
In this phase, the details of the system analysis and system design are
implemented.
The objects identified in the system design phase are designed.
I. Initiating: It determines high level requirements, the scope of the system and the
resources that will be required.
II. Developing: It involves the detailed analysis, design and implementation of the
system.
III. Deploying: It introduces the system to the user and subsequent maintenance of
the system.
3. Rational Unified Process (RUP)
The software object's model complexity is reduced and the program structure is
very clear.
5. Reusability:
6. Increased Quality:
This feature increases in quality is largely a by-product of this program reuse.
7. Maintainable:
The OOP method makes code more maintainable.
The objects can be maintained separately, making locating and fixing problems
easier.
8. Scalable:
The object oriented applications are more scalable than structured approach.
It makes easy to replace the old and aging code with faster algorithms and
newer technology.
9. Modularity:
The OOD systems are easier to modify.
It can be altered in fundamental ways without ever breaking up since changes
are neatly encapsulated.
10. Modifiability:
It is easy to make minor changes in the data representation or the procedures
in an object oriented program.
11. Client/Server Architecture:
It involves the transmission of messages back and forth over a network.
SQA Activities
Process definition
Process training
Process implementation
Process audit
SQA Processes
Project Management
Project Estimation
Configuration Management
Requirements Management
Software Design
Software Development
Software Testing
Software Deployment
Software Maintenance
Once a program code is composed, it must be tried to test hence handle all blunders
in it. Various plans are utilized for testing purposes.
Another vital viewpoint is the wellness of motivation behind a program that finds out
whether the program fills the need which it goes for. The wellness characterizes the
product quality.
Unit Testing
In unit testing, the individual classes are tried. It is seen whether the class
characteristics are executed according to outline and whether the strategies and the
interfaces are sans blunder. Unit testing is the duty of the application design who
actualizes the structure.
Subsystem Testing
This includes testing a specific module or a subsystem and is the duty of the
subsystem lead. It includes testing the relationship internal the subsystem and also
the Interaction of the subsystem with the external. Subsystem tests can be utilized
as relapse tests for each recently discharged form of the subsystem.
System Testing
System testing includes testing the system overall and is the obligation of the quality-
confirmation group. The group regularly utilizes system tests as relapse tests when
collecting new discharges.
Object Oriented Testing Techniques
The diverse sorts of experiments that can be intended for testing object-situated
projects are called dark box test cases. A portion of the essential kinds of dark box
testing are −
State model based testing − This encompasses state coverage, state transition
coverage, and state transition path coverage.
Use case based testing − Each scenario in each use case is tested.
Class diagram based testing − Each class, derived class, associations, and
aggregations are tested.
Sequence diagram based testing − The methods in the messages in the
sequence diagrams are tested.
Alpha testing − This is completed by the testing group internal the Interaction
that creates programming.
Beta testing − This is completed by select gathering of co-working clients.
Acceptance testing − This is completed by the client before tolerating the
expectations.
Software Quality Assurance
Software Quality
Quality Assurance
Auditing
Development of standards and guidelines
Production of reports
Review of quality system
Quality Factors
Object-Oriented Metrics
Product Metrics
Item measurements measure the attributes of the product item that has been
created. The item measurements appropriate for object arranged systems are −
Methods per Class − It decides the many-sided quality of a class. In the event
that every one of the techniques for a class are thought to be similarly
unpredictable, at that point a class with more strategies is more perplexing
and along these lines more vulnerable to blunders.
Inheritance Structure− Systems with a few little legacy grids are more well–
organized than systems with a solitary expansive legacy cross section. As a
thumb lead, a legacy tree ought not have more than 7 (± 2) number of levels
and the tree ought to be adjusted.
Coupling and Cohesion− Modules having low coupling and high union are
thought to be better outlined, as they allow more prominent reusability and
viability.
Response for a Class− It gauges the productivity of the strategies that are
called by the occurrences of the class.
Process Metrics
reusability,
reliability,
interoperability,
extendibility.
OO Paradigm
With the adoption of OO paradigm, almost all the phases of software development
have changed in their approach, environments, and tools. Though OO paradigm
helps make the designing and development of software easier, it may pose new kind
of problems. Thus, testing of software developed using OO paradigm has to deal with
the new problems also. Note that object-oriented testing can be used to test the
object-oriented software as well as conventional software.
OO Program Levels
OO program should be tested at different levels to uncover all the errors. At the
algorithmic level, each module (or method) of every class in the program should be
tested in isolation. For this, white-box testing can be applied easily. As classes form
the main unit of object-oriented program, testing of classes is the main concern while
testing an OO program. At the class level, every class should be tested as an
individual entity. At this level, programmers who are involved in the development of
class conduct the testing. Test cases can be drawn from requirements specifications,
models, and the language used.
1. It should be explicitly specified with each test case which class it should test.
2. Purpose of each test case should be mentioned.
3. External conditions that should exist while conducting a test should be clearly
stated with each test case.
4. All the states of object that is to be tested should be specified.
5. Instructions to understand and conduct the test cases should be provided with
each test case.
To perform state-based testing, a number of steps are followed, which are listed
below.
1. Derive a new class from an existing class with some additional features, which
are used to examine and set the state of the object.
2. Next, the test driver is written. This test driver contains a main program to
create an object, send messages to set the state of the object, send messages to
invoke methods of the class that is being tested and send messages to check
the final state of the object.
3. Finally, stubs are written. These stubs call the untested methods.
Fault-based Testing
Fault-based testing is used to determine or uncover a set of plausible faults. In other
words, the focus of tester in this testing is to detect the presence of possible faults.
Fault-based testing starts by examining the analysis and design models of OO
software as these models may provide an idea of problems in the implementation of
software. With the knowledge of system under test and experience in the application
domain, tester designs test cases where each test case targets to uncover some
particular faults.
Scenario-based Testing
Scenario-based testing is used to detect errors that are caused due to incorrect
specifications and improper interactions among various segments of the software.
Incorrect interactions often lead to incorrect outputs that can cause malfunctioning
of some segments of the software.
Generally, the structure of a scenario includes the following points.
A TEST CASE is a set of conditions or variables under which a tester will determine
whether a system under test satisfies requirements or works correctly.The process of
developing test cases can also help find problems in the requirements or design of an
application.
Test Suite ID The ID of the test suite to which this test case belongs.
Test Case ID The ID of the test case.
Test Case
The summary / objective of the test case.
Summary
Related
The ID of the requirement this test case relates/traces to.
Requirement
Any prerequisites or preconditions that must be fulfilled prior to
Prerequisites
executing the test.
Test Procedure Step-by-step procedure to execute the test.
The test data, or links to the test data, that are to be used while
Test Data
conducting the test.
Expected Result The expected result of the test.
Actual Result The actual result of the test; to be filled after executing the test.
Pass or Fail. Other statuses can be ‘Not Executed’ if testing is not
Status
performed and ‘Blocked’ if testing is blocked.
Remarks Any comments on the test case or test execution.
Created By The name of the author of the test case.
Date of Creation The date of creation of the test case.
Executed By The name of the person who executed the test.
Date of
The date of execution of the test.
Execution
Test The environment (Hardware/Software/Network) in which the test
Environment was executed.
As far as possible, write test cases in such a way that you test only one thing
at a time. Do not overlap or complicate test cases. Attempt to make your test
cases ‘atomic’.
Ensure that all positive scenarios AND negative scenarios are covered.
Language:
o Write in simple and easy-to-understand language.
o Use active voice instead of passive voice: Do this, do that.
o Use exact and consistent names (of forms, fields, etc).
Characteristics of a good test case:
o Accurate: Exacts the purpose.
o Economical: No unnecessary steps or words.
o Traceable: Capable of being traced to requirements.
o Repeatable: Can be used to perform the test over and over.
o Reusable: Can be reused if necessary.
Test Plan helps us determine the effort needed to validate the quality of the
application under test
Help people outside the test team such as developers, business managers,
customers understand the details of testing.
Test Plan guides our thinking. It is like a rule book, which needs to be
followed.
Important aspects like test estimation, test scope, Test
Strategy are documented in Test Plan, so it can be reviewed by Management
Team and re-used for other projects.
A static view of the class definitions is usefully shown with a design class
diagram. This illustrates the attributes and methods of the classes.
Inception is the initial short step to establish a common vision and basic
scope for the Project. It will include analysis of perhaps 10% of the use
cases, analysis of the critical non-Functional requirement, creation of a
business case, and preparation of the development Environment so that
programming can start in the elaboration phase. Inception in one
Sentence: Envision the product scope, vision, and business case.
Some sample artifacts are Vision and Business Case, Use-Case Model,
Supplementary Specification, Glossary, Risk List & Risk Management Plan,
Prototypes and proof-of- concepts etc.
Requirements are capabilities and conditions to which the system and more
broadly, the project must conform.
1. Functional
2. Reliability
3. Performance
4. Supportability
• Promotion of reusability.
22. What is Object Oriented System development methodology?
Method Message
UNIT-II
Elaboration
PART- A
1.What is Elaboration?
Elaboration is the initial series of iterations during which the team does
serious investigation, implements (programs and tests) the core architecture,
clarifies most requirements, and tackles the high-risk issues. In the UP, "risk"
includes business value. Therefore, early work may include implementing
scenarios that are deemed important, but are not especially technically risky.
3. What are the key ideas and best practices that will manifest in
elaboration?
5.What are the key ideas for Planning the Next Iteration?
1. Reuse or modify existing models. This is the first, best, and usually
easiest approach, and where I will start if I can. There are published,
well-crafted domain models and data models (which can be modified
into domain models) for many common domains, such as inventory,
finance, health, and so forth. Example books that I'll turn to include
Analysis Patterns by Martin Fowler, Data Model Patterns by David
Hay, and the Data Model Resource Book (volumes 1 and 2) by Len
Silverton.
2. Use a category list.
3. Identify noun phrases.
13. Mention some Conceptual Class Category.
The lifetime of the part is bound within the lifetime of the composite
there is a create-delete dependency of the part on the whole.
There is an obvious whole-part physical or logical assembly.
Some properties of the composite propagate to the parts, such as the
location.
Operations applied to the composite propagate to the parts,
such as destruction, movement, and recording.
UNIT-III
System Sequence Diagrams
PART- A
It also improves clarity to start the name of a system event with a verb Thus
"enter item" is better than "scan" (that is, laser scan) because it captures the
intent of the operation while remaining abstract and noncommittal with
respect to design choices about what interface is used to capture the system
event.
CRC cards are index cards, one for each class, upon which the
responsibilities of the class are briefly written, and a list of collaborator
objects to fulfill those responsibilities. They are usually developed in a small
group session. The GRASP patterns may be applied when considering the
design while using CRC cards.
Generalization(class to class)
Association (object to object) Aggregation(objecttoobject)
Composition (object to object)
Unit-IV
GRASP
PART- A
1. How to Choosing the Initial Domain Object?
The UI layer should not have any domain logic responsibilities. It should only
be responsible for user interface tasks, such as updating widgets. The UI layer
should forward requests for all domain-oriented tasks on to the domain layer,
which is responsible for handling them.
5. Define patterns.
A pattern is a named problem/solution pair that can be applied in new
context, with advice on how to apply it in novel situations and discussion of
its trade-offs.
8. Who is creator?
Solution Assign class B the responsibility to create an instance of class
A if one or more of the following is true:
. B aggregates an object.
. B contains an object.
. B records instances of objects.
. B closely uses objects.
. B has the initializing data that will be passed to A when it is created (thus B
is an Expert with respect to creating A).
B is a creator of an object.
If more than one option applies, prefer a class B which aggregates or contains
class A.
-Very low
cohesion -low
cohesion -High
cohesion -
Moderate cohesion
Consider the creation of the Credit Card, Drivers License, and Check software
objects. Our first impulse might be to record the data they hold simply in their
related payment classes, and eliminate such fine-grained classes. However, it
is usually a more profitable strategy to use them; they often end up providing
useful behavior and being reusable. For example, the Credit Card is a natural
Expert on telling you its credit company type (Visa, MasterCard, and so on).
This behavior will turn out to be necessary for our application.
2. Define Attributes.
An attribute is a logical data value of an object.
3. When Are Contracts Useful?
The use cases are the main repository of requirements for the project. They
may provide most or all of the detail necessary to know what to do in the
design, in which case, contracts are not helpful. However, there are situations
where the details and complexity of required state changes are awkward to
capture in use cases.
To make contracts:
1. Identify system operations from the SSDs.
2. For system operations that are complex and perhaps subtle in their
results, or which are not clear in the use case, construct a contract.
3. To describe the post conditions, use the following categories:
- Instance creation and deletion
- attribute modification
- Associations formed and broken
At the very least, DCDs depict the class or interface name, super classes,
method signatures, and simple attributes of a class. This is sufficient to create
a basic class definition in an object- oriented programming language. Later
discussion will explore the addition of interface and namespace (or package)
information, among other details.
A UML state chart diagram, illustrates the interesting events and states of an
object, and the behavior of an object in reaction to an event. Transitions are
shown as arrows, labeled with their event. States are shown in rounded
rectangles. It is common to include an initial pseudo-state, which
automatically transitions to another state when the instance is created.
There is not one model in the UP called the "state model." Rather, any
element in any model (Design Model, Domain Model, and so forth) may have
a state chart to better understand or communicate its dynamic behavior in
response to events. For example, a state chart associated with the Sale
design class of the Design Model is itself part of the Design Model.
-External
event -
Internal event
- Temporal
event
- When a Sale receives a make Line item message, an internal event has occurred.
-Suppose that after an end Sale operation occurs, a make Payment operation
must occur within five minutes, otherwise the current sale is automatically
purged.
UNIT 1-UML
DIAGRAMS
Introduction to OOAD – Unified Process - UML diagrams – Use Case – Class
Diagrams– Interaction Diagrams – State Diagrams – Activity Diagrams – Package,
component and Deployment Diagrams
PART – A (2 Marks)
Q.NO QUESTIONS COMPETENCE LEVEL
1 What is Object Oriented analysis & Design? Remembering BTL1
2 List the 4 phases in UP. Remembering BTL1
3 Compose your views on iterative Development and
write it benefits. Creating BTL6
4 Define UML and list out its perspectives. Remembering BTL1
5 Define design Class Diagram. When to use Class
Diagrams? Remembering BTL1
6 Define Use Case. Point out the test that can help to
find useful use cases. Analysing BTL4
7 Illustrate the relationship used in Use case. Applying BTL3
8 Discover the major Difference between Component and
Deployment Diagram. Applying BTL3
9 Classify the 3 kinds of actors in use case.
Examine the purpose of using usecases to
describe requirements. Analysing BTL4
10 Define State Chart Diagram. When to use State Remembering BTL1
Diagram?
11 Compare Activity and state chart diagram. Evaluating BTL5
Mention the Elements of an Activity Diagram.
12 Define Aggregation and Composition. Remembering BTL1
13 Distinguish between method and message in
Understanding BTL2
object.
14 Formulate the purpose of Interaction Diagram. Creating BTL6
15 What is package diagram? Classify the three layers of
Analysing BTL4
package Diagram.
16 Discuss the Strength and Weakness of the Use case Understanding BTL2
Diagram.
17 Interpret the meaning of event, state and Understanding BTL2
Transition.
18 Define an Object. Illustrate the probable
attributes that will be modeled in a library Applying BTL3
database for the object BOOK.
19 Compare and Contrast Sequence and Collaboration
Evaluating BTL5
diagram.
20 Describe the Primary goals in the Design of Understanding BTL2
UML.
PART – B (13 Marks)
Q.NO QUESTIONS COMPETENCE LEVEL
1 i) Explain in detail about the Unified process in object
oriented Analysis and Design? Explain the phases
with neat diagrams. (6)
ii) What is UML activity Diagram? Using an example Analysing BTL4
explain the features of basic UML activity diagram
notation. (7)
2 Distinguish between the Concepts of component and
Deployment Diagram with an example of Book bank Understanding BTL2
system. (13)
3 Apply Interactive modeling for a Payroll system in
UML. (13) Applying BTL3
cohesion. (7)
4 Compare abstract use case and concrete Use Case. Analysing BTL4
5 Express the meaning of Elaboration and What are the Understanding BTL2
tasks performed in elaboration?
6 Differentiate Include and Extend use case Analysing BTL4
relationships.
7 What is the relationship of a conceptual super Remembering BTL1
class to a subclass?
8 Demonstrate how to create a Domain model. Applying BTL3
9 Express why we call domain model
Understanding BTL2
a “VisualDictionary".
10 When to create a subclass of a superclass? Remembering BTL1
11 Compare Aggregation and Composition. Evaluating BTL5
12 Illustrate the usage of Description class. Applying BTL3
13 Generalize the purpose of association relationship. Creating BTL6
14 Show the important deals in Inception of the POS Applying BTL3
system? Mention the requirements of Inception
phase of the POS system.
15 Define attribute? List out the types of attributes. Remembering BTL1
16 Interpret the meaning of Generalization and
Understanding BTL2
Specialization.
17 Differentiate Conceptual class and abstract conceptual Understanding BTL2
class.
18 How to create an inception? Creating BTL6
19 Compare qualified association and reflexive
association. Evaluating
BTL5
(5)
(iii)Associations (5)
3 (i) Summarize the Elaboration phase. Discuss the
differences between elaboration and inception with
suitable diagram for university domain. (8)
Understanding BTL2
(ii) Describe a suitable example showing the various
relationships used in Use Case and also give a short
note on each relationship. (5)
4 (i) Describe the strategies used to identify the
example. (8)
Applying BTL3
(ii) Show when to model with Description classes with
example. (5)
(8)
(ii) What is use cases and explain in detail about the Analysing BTL4
sample Unified process Artifacts Relationships.
(5)
PART-C(15 Marks)
Q.NO QUESTIONS COMPETENCE LEVEL
1 With a suitable example explain how to design a class.
Give all possible representation in a class(such
Creating BTL6
as:name,attribute,visibility,methods,and
responsibilities). (15)
2 For the NextGen POS system design the
following conceptual class hierarchies:
(i) Conceptual super class (4)
Creating BTL6
(ii) Conceptual subclass (4)
(iii)Authorization Transaction classes. (4)
(iv)Abstract Conceptual classes. (3)
3 Explain the concepts of Finding Description classes BTL5
with the example of Airline and mobile phone Evaluating
company. (15)
4 Explain the benefits and concepts of use case and use
case model and analyze the use cases for the Library Analysing BTL4
management system. (15)
UNIT IV-APPLYING DESIGN PATTERNS
System sequence diagrams - Relationship between sequence diagrams and use
cases Logical architecture and UML package diagram – Logical architecture
refinement - UML class diagrams- UMLinteraction diagrams - Applying GoF
design patterns.
PART – A(2 Marks)
Q.NO QUESTIONS COMPETENCE LEVEL
1 Express the use of Sequence Diagram. Understanding BTL2
2 Distinguish sequence diagram and communication
diagram.What are their strengths and weaknesses? Understanding BTL2
(5)
10 (i) Compare sequence diagram and communication
diagram with suitable example.
(8) Evaluating BTL5
(5)
example. (8)
Applying BTL3
(ii) Illustrate the Unit testing concepts by using
Currency Conversion program. (5)
PART-C(15 Marks)
Q.NO QUESTIONS COMPETENCE LEVEL
1 Prepare the implementation model (Mapping
design to code) and give the NextGen POS program Creating BTL6
(15)
2 Develop the foundation code for Monopoly game Creating BTL6
System. (15)
3 Explain in detail about the implication of
Composition and Encapsulation with the example of Evaluating BTL5
Winder shield wiper system. (15)
4 Analyze the Unit, Integration, and system testing for Analysing BTL4
currency converter application. (15)
Question Bank
UNIT-1
UNIT-2
1. Explain Class diagrams with one example diagram.
2. Write common modeling techniques of class diagrams.
3. Explain Object diagrams with one example diagram.
4. Write common modeling techniques of object diagrams.
5. Draw the class diagram for library management system.
6. Draw the object diagram for ATM Applications.
7. Explain interactions and terms and concepts of interactions.
8. Differences between collaborations diagram and sequence diagrams.
9. Explain the sequence diagram with example.
10. Explain the collaboration diagram with example.
11. Write common modeling techniques of collaboration diagrams.
12. Write common modeling techniques of sequence diagrams.
13. Draw the sequence diagram for Quiz Applications.
14. Draw the collaboration diagram for Hospital Management System.
UNIT-3
1. Explain use case and terms and concepts of use case.
2. Explain the use case diagram with example.
3. Explain the Activity diagram with example.
4. Explain use case and terms and concepts of Activity diagram.
5. Write common modeling techniques of use case diagrams.
Assignment Questions
Unit 1
1. Explain the important of modeling & principles of modeling.
2. Explain the s/w development life cycle.
3. Describe the structural things of UML modeling.
4. Draw and explain the Architecture of UML.
5. Describe the various types of UML diagrams.
6. What is Class? Enumerate the steps involved in modeling techniques.
7. Write the various Relations with examples.
Unit 2
1. What is Package? Write the steps involved in common modeling
techniques.
2. What are the Common mechanisms in the UML model?
3. Explain the Advanced relationships in UML model.
4. What is Class diagram? Draw the class diagram for Library management
system.
5. What are the common modeling techniques of class diagram?
6. What is Object diagram? Draw the object diagram for ATM Applications.
Unit 3
Unit 4
1. Explain the Activity diagram with example.
2. Explain use case and terms and concepts of Activity diagram.
3. Write common modeling techniques of use case diagrams.
4. Explain Events and signals in the UML.
5. What is state machine and terms and concepts of state machine.
6. 16. Explain process and threads in UML.
7. Explain state chart diagrams and terms and concepts.
Unit 5
1. What is component and terms and concepts of component.
UNIT 1
2. Which one of the following view express the requirements of the system?
1. Usecase
2. Design
3. Process
4. Implementation.
2. Coding
3. Testing
4. Analysis
4. visualityl
17.In an algorithmic approach the main building block of all software is the _ _
_ _ _ _ _ . [02S01]
1. class.
2. abstract class.
3. object.
4. module.
3.A _ _ _ diagram shows the configuration of runtime processing nodes and the
components that live on them. [04M03]
1. usecase.
2. activity.
3. deployment.
4. component.
2. generalization.
3. realization.
4. message.
9.Which one of the following diagram address the dynamic view of a system?
[04S06]
1. class.
2. object.
3. component.
4. state chart.
10.Which one the following diagram address the static view of a system? [04S07]
1. interaction.
2. activity.
3. statechart.
4. component.
2. stereotype.
3. Constraint
4. Adornmrnts.
14._ _ _ _ _ _ _ _ _ is the fourth phase of the process when the software is turned
into the hands of the user community.
1. Inception.
2. Elaboration.
3. Construction.
4. Transition.
18.The users get a chance to test the system in the _ _ _ _ _ _ _ _ phase. [05M03]
1. inception.
2. elaboration.
3. construction.
4. transition.
19.The _ _ _ _ _ view of a system encompasses the use cases that describe the
behavior of the system as seen by its end users, analysis and testers. [05S01]
1. design
2. use case
3. process
4. deployment.
1. design
2. usecase
3. process
4. deployment
2.The _ _ _ _ _ view of a system encompasses the nodes that form the system's
hardware topology on which system executes. [05S04]
1. design
2. use case
3. process
4. deployment
4. has-a.
11.You can explicitly specify that there are more attributes or properties than
shown by ending each list with an _ _ _ _ _ _ _ _ _ _ _ _. [06M03]
1. circles.
2. sequeres.
3. ellipsis.
4. stereotypes.
1. item.
2. Attribute.
3. Operation.
4. Entity.
16.A _ _ _ _ _ _ _ is just the face the class at the neor end of the association
presents to the other end of the association. [06S05]
1. name.
2. role.
3. multiplicity.
4. aggregation.
3. Component
4. Deployment
4. The UML specifies one standard stereotype that applies to notes is . [07M01]
1. Requirement.
2. meta class.
3. Exception.
4. power type.
5. From the following diagrams you can convert from one to the other without
loss of information. [07M02]
1. Sequence & collaboration.
2. Sequences & class .
3. Collaboration & use case.
4. Deployment and use case.
Ans: String
3. tagged value.
4. constraint.
11.which one of the following standard stereotype specifies that the classifier is
a Stereo types, that may be applied to other elements? [07S05]
1. Stereo type
2. Documentation
3. Exception
4. Metaclass
4. Usecase
4. become.
33.Which one of the following stereotype specifies that the source is at a finer
degree of abstraction than the target? [09S02]
1. bind
2. friend
3. derive,
4. refine.
34.A semantic variation of generation in which a child may have more than one
parent is called. [09S03]
1. single inheritance.
2. multiple inheritance.
3. inheritance.
4. double inheritance.
UNIT 5
5._ _ _ _ _ _ _ _ _ stereotype specifies that the source operation invokes the target
operation.
Ans: call
8.Which one of the following stereotype specifies that the source package has
access to the contents of the target? [10M01]
1. import
2. export
3. frame work
4. stub
4. active class.
23.You can explicitly specify that there are more attributes or properties than
shown by ending each list with an _ _ _ _ _ _ _ _. [11S05]
1. circles.
2. squares.
3. ellipsis.
4. stereotypes.
1. usability.
2. responsibility.
3. package.
4. state.
UNIT-5