OOAD Lab Report - Merged
OOAD Lab Report - Merged
AND TECHNOLOGY
Gongabu, Kathmandu, Nepal
PREPARED BY:
Hari Rijal
A Object Oriented Analysis and Design Lab Report Based on UML Diagram
Submitted to
Signature: Signature
i
ACKNOWLEDGEMENT
This lab report has been prepared for the partial fulfilment of the requirements for the
degree of Bachelor of Information Management, prescribed by faculty of Management,
Tribhuvan University. This is an individual report assigned to me during my academic
study in BIM Seventh semester, I should remain thankful to many people for the successful
completion of this summer project.
I would like to express sincere gratitude to my faculty member, Mr. Bikash Balami, for
providing necessary guidelines for completion of this report. I am thankful to him for his
continuous reinforcement and motivation for completing this lab report successfully. I
thank for his regular feedback and suggestion to improve the report further.
We are very thankful to respected Associate Lecturer, Mr. Surya Bam for helping and
encouraging us in every aspect of my academic study. Also, I would like to thank all the
respondents who filled the questionnaire and helped me with the continuation of the report.
Finally, I would like to thank my friends for uplifting my spirit to complete the report in
time.
ii
LIST OF FIGURES
Figure 1: Usecase diagram of Library Management System...............................................3
iii
LIST OF ABBREVIATION
BIM Bachelor of Information Management
ID Identity
iv
CHAPTER ONE: USE CASE DIAGRAM
1.1 Introduction of Use Case
• Is a representation of a user’s interaction with the system that shows the relationship
between the user and the different use cases in which the user is involved?
• Actors
• Use cases
• System Boundary
• Relationship
Actor
• Is someone or something outside the system that interacts with the systems
• Primary Actor
• Initiates an interaction
• Secondary Actor
Use Case
1
• Represented by oval
• What are the system tasks for each actor defined in the system?
System Boundary
• Rectangle diagram representing the boundary between the actors and the
system
• Include
• Extend
• Generalization
Include Relationship
– Dotted line with an open arrow is drawn from the base use case to the used
use case
Extend Relationship
– Used to indicate that use completely consists of the behaviour of another use
case at one or specific point
– Dotted line with an open arrow is drawn from the extension use case to the
base use case
Generalization
2
– Is a relationship between a general use case
1. Any library member should be able to search books by their title, author, subject
category as well by the publication date.
2. Each book will have a unique identification number and other details including a
rack number which will help to physically locate the book.
3. There could be more than one copy of a book, and library members should be able
to check-out and reserve any copy. We will call each copy of a book, a book item.
4. The system should be able to retrieve information like who took particular book or
what are the books checked-out by a specific library member.
5. The system should able to collect fines for book returned after the due date.
6. Members should be able to reserve books that are not currently available.
7. The system should be able to send notifications whenever the reserved books
become available, as well as when the book is not returned within the due date.
8. Each book and member card will have a unique barcode. the system will be able to
read barcodes from books and members' library cards.
9. Librarian has a key role in this system. Librarian adds the records in the library
database about each student or user every time issuing the book or returning the
book, or paying fine.
10. Librarian also deletes the record of a particular student if the students leave the
college or passed out from the college. If the book no longer exists in the library,
then the record of the particular book is also deleted.
• Librarian: Mainly responsible for adding and modifying books, book items, and
users. The Librarian can also issue, reserve, and return book items.
• Members: All members can search the catalog, as well as check-out, reserve,
renew, and return a book.
• System: Mainly responsible for sending notifications for overdue books, canceled
reservations, etc.
3
Here are the top use cases of the Library Management System:
4
Fig 1: Usecase diagram of Library Management System
5
CHAPTER TWO: ACTIVITY DIAGRAM
2.1 Introduction of Activity Diagram
• Activity diagram is basically a flow chart to represent the flow form one activity to
another activity
• The control flow is drawn from one operation to another and this flow can be
sequential, branched or concurrent
• Activity
• Transmission (Flow)
o When the activity of a state completes, flow of control passes to the next
action
• Starting Node
• Ending Node
• Join
– Join and Fork have the same notation (either a horizontal or vertical bar)
6
– A black bar with several flows entering in it and one leaving from it
• Fork
• Decision
• Merge
– The implication is that all incoming flows to reach this point until processing
continues
• Notes
o Activity is started by commuter actor who needs to buy a ticket. Ticket vending
machine will request trip information form Commuter. This information will
include number and type of ticket, e.g., whether it is a monthly pass, one way or
round ticket, route number, destination number.
o Based on this information, ticket vending machine will calculate payment due and
request payment option (Cash, Card).
o If card, Bank will participate in this activity.
7
Fig 2: Activity Diagram of Ticket Vending Machine
– Online customer can browse or search items, view specific item, add it to the
shopping cart, view and update the shopping cart, checkout.
– User can view shopping cart at any time.
– Checkout is assumed to include user registration and login.
8
Fig 3: Activity diagram of Online Shopping Process
9
CHAPTER THREE: CLASS DIAGRAM
3.1 Introduction of Class Diagram
• A class is a description of a set of objects that share the same attributes, operations,
relationships, and semantics
– Classes
– Attributes
– Methods
• Types
– Dependencies
– Generalization
– Associations
10
• Association Relationship: If two classes in a model need to communicate with
each other, there must be link between them. An association denotes that link.
11
Fig 4: Class Diagram of Movie Shop
12
3.4 Class Diagram Example of Flight
13
CHAPTER FOUR: SEQUENCE DIAGRAM
4.1 Introduction of Sequence Diagram
• Show time sequences that are not easily depicted in other diagrams
• Shows system events for a scenario of a use case, therefore it is generated from
inspection of a use case
• Lifeline
• Activation
– Thick box over object's life line; drawn when object's method is on the stack
14
• Message
– Optionally indicated using a dashed arrow with a label indicating the return
value
– Different arrowheads for normal/ concurrent (asynchronous) methods
Example: Design a sequence diagram for the function "Borrowing the Book" in Library
Management System.
Example: Design a sequence diagram for the function “make a phone call”.
16
CHAPTER FIVE: MAPPINGS DESIGN TO CODE
5.1 Introduction to Mapping Design to Code
Design Class Diagrams contain class or interface names, classes, method and
simple attributes. These are sufficient for basic class definitions. Elaborate from
associations to add reference attributes.
Example: Draw the class diagram with relation and convert to design to code
Assumptions:
//Lab.java
import java.util.Map;
class Book {
int id;
Date published_date;
String isbn;
17
Map getBookDetails() {}
class Student {
int roll;
int checkBorrowHistory() {}
Class Librarian {
int id;
class Book {}
18
5.3 Billing System
//Bill.java
/**
*
* @param number
* @param brand
*/
public void set(String number, String brand) {
// TODO - implement Mobile.set
this.number = number;
this.brand = brand;
}
}
public class Person {
19
public String name;
public String id;
/**
*
* @param id
* @param name
*/
public void setPerson(String id, String name) {
// TODO - implement Person.setPerson
this.id = id;
this.name = name;
}
}
public class BillDemo {
public static void main(String[] args) {
p1.display();
p2.display();
b1.display();
20