Sie sind auf Seite 1von 45

www.pencilji.

com

Program 1: GRID LINES

Specification: Grid lines with two sets of horizontal vertical lines


(Rumbhaugh approach)

Write o program to create a window and draw horizontal and vertical


lines to form a grid.

High level design:


Define a subclass of JFrame class and draw horizontal parallel lines
and vertical parallel lines to form the grid. Create an object of this
class and display it.

Use Case Diagram

Draw Grid Lines


User

Activity Diagram:

Page 1 of 45
www.pencilji.com

Execute
program

Draw Window

Draw Grid lines

Display window

Class Diagram:

WindowAdapter
JFrame (from event)
(from swing)
rootPaneCheckingEnabled : boolean WindowAdapter()
rootPane : JRootPane windowActivated()
accessibleContext : AccessibleContext windowClosed()
windowClosing()
windowDeactivated()
windowDeiconified()
windowIconified()
windowOpened()

Ruled
WindowHandler
+theWindowHandler
main()
windowClosing()
paint()
WindowHandler()
Ruled()

Code:

import javax.swing.JFrame;
import java.awt.event.*;

Page 2 of 45
www.pencilji.com

import java.awt.*;
public class Ruled extends JFrame
{
public WindowHandler theWindowHandler;
/**
@roseuid 41B93583001F
*/
public Ruled()
{
WindowHandler wh = new WindowHandler();
addWindowListener(wh);
}
/**
@roseuid 41B931CC03D8
*/
public void paint(Graphics g)
{
super.paint(g);
for(int i=0;i<400;i+=10)
{
g.drawLine(0,i,400,i);
g.drawLine(i,0,i,400);
}
}

/**
@param args[]
@roseuid 41B931E4033C
*/
public static void main(String args[])
{
Ruled r = new Ruled();
r.setSize(400,400);
r.show();
}
}
class WindowHandler extends WindowAdapter
{
/**
@roseuid 41B9358300CB
*/
public WindowHandler()
{
}

Page 3 of 45
www.pencilji.com

/**
@roseuid 41B932380222
*/
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}

Output:

Program 2: GRID WITH TWO SETS OF DIAGONAL


LINES

A) Identify the various use cases and actors involved and represent
the user view of the system.
B) Identify the various classes and attributes and bring out a class
diagram, and a sequence diagram.
Write a program to create a window and draw two sets of diagonal
parallel lines crossing each other. Device the following and then
implement.
a)High level design
b) Detail level design
c) User interface specification

Use case Diagram:

Draw diagonal grid lines


User

Activity Diagram:

Page 4 of 45
www.pencilji.com

Execute the
program

Draw window

Draw diagonal
grid lines

Display window

Class Diagram:

WindowAdapter
(from event)

JFrame WindowAdapter()
(from swing) windowActivated()
rootPaneCheckingEnabled : boolean windowClosed()
rootPane : JRootPane windowClosing()
accessibleContext : AccessibleContext windowDeactivated()
windowDeiconified()
windowIconified()
windowOpened()

Diagonal
WindowHandler
+theWindowHandler
main()
windowClosing()
paint()
WindowHandler()
Diagonal()

Sequence Diagram:

Page 5 of 45
www.pencilji.com

objDiagonal : objWinHandler :
: User
Diagonal WindowHandler

Invoke main()

Create Window

Create WindowListener

Draw diagonal grid lines

Show Window

close window
fire close event
window terminated

Code:

import javax.swing.JFrame;
import java.awt.event.*;
import java.awt.*;
public class Crossed extends JFrame
{
public WindowHandler theWindowHandler;
/**
@roseuid 41BFE0FA0290
*/
public Crossed()
{
WindowHandler wh = new WindowHandler();
addWindowListener(wh);
}
/**
@roseuid 41BFDFB5038A
*/
public void paint(Graphics g)
{

Page 6 of 45
www.pencilji.com

super.paint(g);
for(int i=0;i<400;i+=10)
{
g.drawLine(0,i,i,0);
g.drawLine(400,i,i,400);
}
for(int j=0;j<400;j+=10)
{
g.drawLine(j,0,400,400-j);
g.drawLine(0,j,400-j,400);
}
}
/**
@param args[]
@roseuid 41BFE04201C5
*/
public static void main(String args[])
{
Crossed cr = new Crossed();
cr.setSize(400,400);
cr.show();
}
}
class WindowHandler extends WindowAdapter
{
/**
@roseuid 41BFE0FA034B
*/
public WindowHandler()
{
}
/**
@roseuid 41BFE07401C5
*/
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}

Page 7 of 45
www.pencilji.com

Program 3: OOA AND OOD USING UML-I

In the employee referral process, the HR head of the region where a


vacancy exists informs employees of that region and other regional HR
heads. The other regional HR heads inform employees by putting up a
notice informing them about the vacancy. The employees send on their
recommendations to the regional HR head of a region where a vacancy
exists. The regional HR head then matches the skills of these
candidates with the skills required for the vacant position and short
lists them. An interview schedule is drawn up and the short listed
candidates are informed. Based on the interview proceedings,
interview details are updated and all the selected candidates
candidates are given offer letter. The candidate informs the HR either
by accepting or declining the offer letter. When a candidate referred by
the employee joins the organization, the employee who has referred
the candidate is paid the bonus.

a) Identify the various use cases and actors involved and represent
the user view of the system.

Page 8 of 45
www.pencilji.com

Identify the various classes and attributes and bring out a class diag.
and sequence diag.
Use case Diagram:

Through
E-Ma...

HR Head
(from Business Actors)
Communicates Communicates

Queries on vacancy status

Communicates HR Referral
HR_Head_OtherRe Interview process
gion (from Business UseCases)
(from Business Actors)

Interview status
Through
notice Board

Employee
Candidate
(from Business Actors)

Page 9 of 45
www.pencilji.com

Activity Diagram :

Page 10 of 45
www.pencilji.com

Initiate vacancy

Inform Inform other regional


employee HR heads

Recommend
candidates

Shortlist candidates
based on skill

Conduct
interview

Select
candidates

Send offer letters to


selected candidates

Update acceptance/rejection
response details

candidate rejects offer

candidate accepts offer

employee who referred the


candidate paid bonus

Page 11 of 45
www.pencilji.com

Class Diagram:

Vacancy RefPayment
vacancyid : int empid : int
vacancytype : String bonus : int
vpriority : String empname : String
Quantity : int canName[] : String
skillset : String bonusSanctioned : Boolean

getDetails() getEmpId()
updatevacancy() sendForSanction()
showvacancy() payBonus()

SelProcess
candid : int
candname : String
candskill : String

getCanDetails()
shortlist()
processFinalList()
sendFinalCanDetails()

Sequence Diagram:

Page 12 of 45
www.pencilji.com

objVacancy : Vacancy objSelProcess : objRefPayment :


: HR head : Other HR heads : Employee : Candidate
SelProcess RefPayment
initiate vacancy
inform vacancy
inform vacancy
refers candidate

Maintains vacancy

fetch referred candidate list

Sends candidate list

shortlist candidates
send interview call letters

Interview process
send offer letters
acceptance/rejection feedback

update vacancy
send employee list for sanction of bonus

sanctioned bonus
give bonus

Page 13 of 45
www.pencilji.com

4. OOA AND OOD USING UML-II


UML class representation: design and implement a student class with
the following attributes:
Reg. no
Name of student
Marks in subject-1
Marks in subject-2
Marks in subject-3
Total marks
The total of three subjects must be calculated only when the student
passes in all the 3 subjects.
The pass marks in each subject is 50. If a candidate fails in any one of
subject, his total marks must be declared as 0.Using these conditions
write a constructor for this class. Write a method display student () to
display the details of student object. In the main method create an
array of three student objects and display the object details.
a) Identify the various use cases and actors involved and represent
the user view of the system.
b) Identify the various classes and attributes and bring out a class
diagram, and a sequence diagram.

Use case Diagram:

Student marks
User

Page 14 of 45
www.pencilji.com

Activity Diagram:

User executes
the program

Enter regno

Enter name

Enter marks in
subject 1, 2, 3

not pass in all three subjects


pass in all three subjects

Compute total
Assign total = 0

Display student
details

Page 15 of 45
www.pencilji.com

Class Diagram:

Student
Regno : String
Name : String
Marks1 : int
Marks2 : int BufferedReader
Marks3 : int (from i o)
Total : int

main()
display()
Student()

Sequence Diagram:

objStudent objBReader :
: User
BufferedReader

Invoke main()
create obj

entered details
set details
check if pass

compute total

show details

Page 16 of 45
www.pencilji.com

import java.io.*;
public class Student
{
private String regno;
private String name;
private int sub1;
private int sub2;
private int sub3;
private int total;

public Student() throws IOException


{
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));

total=0;
System.out.print("\n\t\t\tEnter Student Details");
System.out.print("\n\t\t\t---------------------");

System.out.print("\n\t\t\tReg No.: ");


regno=br.readLine();
System.out.print("\n\t\t\tName: ");
name=br.readLine();
System.out.print("\n\t\t\tSubject1 Marks: ");
sub1=Integer.parseInt(br.readLine());
System.out.print("\n\t\t\tSubject2 Marks: ");
sub2=Integer.parseInt(br.readLine());
System.out.print("\n\t\t\tSubject3 Marks: ");
sub3=Integer.parseInt(br.readLine());
if((sub1<50)||(sub2<50)||(sub3<50))
total=0;
else
total=sub1+sub2+sub3;
}

public void displayStud()


{
System.out.print("\n\tReg No.: " + regno + "\tName: " + name
+ "\tTotal: " + total);
}

Page 17 of 45
www.pencilji.com

public static void main(String args[]) throws IOException


{
Student stud[]= new Student[3];
for(int i=0;i<2;i++)
{
stud[i]=new Student();
}
for(int i=0;i<2;i++)
{
stud[i].displayStud();
}
}
}

Enter Student Details


---------------------
Reg No.: 11

Name: ray

Subject1 Marks: 99

Subject2 Marks: 98

Subject3 Marks: 97

Enter Student Details


---------------------
Reg No.: 21

Name: george

Subject1 Marks: 99

Subject2 Marks: 35

Subject3 Marks: 98

Reg No.: 1 Name: ray Total: 294


Reg No.: 2 Name: george Total:0

Page 18 of 45
www.pencilji.com

Program 5: OOA AND OOD USING UML-III


Consider a student defined in prob. 2. Assume that a student studies 6
subjects. Each subject has a title, passing min. Marks and max.
Marks.
a) Identify the various use cases and actors involved and represent
the user view of system.
b) Identify the various classes and attributes and bring out a class
diagram, and a sequence diagram.

Use case Diagram:

Student and Subject processing


user

Page 19 of 45
www.pencilji.com

Execute
Program

Enter Subject
Details

Enter Student
Details

Process
Student Marks

passes in all subjects does not pass in all subjects

Calculate total Set total = 0


marks

Display Student
Report

Activity Diagram
Class Diagram:

Page 20 of 45
www.pencilji.com

Students
regno : String Subject
Name : String subcode : String
Total : int +theSubject subtitle : String
marks[] : Int minmarks : int
maxmarks : int
display()
Students() Subject()
main()

+theBufferedReader
+theBufferedReader
BufferedReader
(from i o)

Sequence Diagram:

objStudents : objSubject :
: user
Students Subject

invoke main()

Enter subject details


Enter student details
access min, max marks
get min, max marks

process marks
display student report

import java.io.*;
public class Students

Page 21 of 45
www.pencilji.com

{
private String regno;
private String name;
private int marks[];
private int total;
public static Subject theSubject[];
/**
@roseuid 41B7FDED01D4
*/
public Students() throws IOException
{
marks=new int[6];
total=0;
boolean flag=false;
BufferedReader br=new BufferedReader(new
InputStreamReader(System.in));
System.out.print("\n\t\t\tStudent Details");
System.out.print("\n\t\t\tReg No.: ");
regno=br.readLine();
System.out.print("\n\t\t\tName: ");
name=br.readLine();
for(int i=0;i<6;i++)
{
System.out.print("\n\t\t\tSubject " + (i+1) + " Marks: ");
marks[i]=Integer.parseInt(br.readLine());
if(marks[i] < theSubject[i].min)
flag=true;
}
for(int j=0;j<6;j++)
{
if(flag)
{
total=0;
break;
}
else
total=total + marks[j];
}
}
/**
@roseuid 41B7FDF90399
*/

Page 22 of 45
www.pencilji.com

public void displayStud()


{
System.out.print("\n\tReg No.: " + regno + "\tName: " + name
+ "\tTotal: " + total);
}
/**
@param args[]
@roseuid 41B7FE180399
*/
public static void main(String args[]) throws IOException
{
Students.callSubDetails();
Students stud[] = new Students[2];
for(int i=0;i<2;i++)
{
stud[i]=new Students();
}
for(int i=0;i<2;i++)
{
stud[i].displayStud();
}
}
/**
@roseuid 41B7FEB7009C
*/
public static void callSubDetails() throws IOException
{
theSubject=new Subject[6];
for(int l=0;l<6;l++)
{
theSubject[l]=new Subject();
}
for(int k=0;k<6;k++)
{
theSubject[k].setSubDetails();
}
}
}
class Subject
{
private String subcode;
private String title;
public int min;
private int max;

Page 23 of 45
www.pencilji.com

/**
@roseuid 41B808DF01C5
*/
public Subject()
{
}
/**
@return java.lang.Void
@roseuid 41B7FFD102FD
*/
public Void setSubDetails() throws IOException
{
BufferedReader br=new BufferedReader(new
InputStreamReader(System.in));
System.out.print("\n\t\t\tEnter Subject Details");
System.out.print("\n\t\t\tSubject Code: ");
subcode=br.readLine();
System.out.print("\n\t\t\tTitle: ");
title=br.readLine();
System.out.print("\n\t\t\tMin Marks: ");
min=Integer.parseInt(br.readLine());
System.out.print("\n\t\t\tMax Marks: ");
max=Integer.parseInt(br.readLine());
return null;
}
}

Enter Subject Details


Subject Code: MCA51
Title: ooad
in Marks: 45
Max Marks: 100
Enter Subject Details
Subject Code: MCA52
Title: ssm
Min Marks: 45
Max Marks: 100
Enter Subject Details
Subject Code: MCA53
Title: cm
Min Marks: 45
Max Marks: 100
Enter Subject Details
Subject Code: MCA54

Page 24 of 45
www.pencilji.com

Title: DO
Min Marks: 45
Max Marks: 100
Enter Subject Details
Subject Code: MCA55
Title: DOS
Min Marks: 45
Max Marks: 100
Enter Subject Details
Subject Code: MCA56
Title: lab
Min Marks: 45
Max Marks: 100
Enter Subject Details
Subject Code: MCA56
Title: lab
Min Marks: 45
Max Marks: 100

Student Details
Reg No.: 1
Name: ray
Subject 1 Marks: 99
Subject 2 Marks: 98
Subject 3 Marks: 97
Subject 4 Marks: 99
Subject 5 Marks: 95
Subject 6 Marks: 99

Student Details
Reg No.: 2
Name: george
Subject 1 Marks: 99
Subject 2 Marks: 97
Subject 3 Marks: 25
Subject 4 Marks: 99
Subject 5 Marks: 88
Subject 6 Marks: 89

Reg No.: 1 Name: ray Total: 587


Reg No.: 2 Name:george Total: 0

Program 6: OOA AND OOD USING UML- IV


A class called television has the following attributes:

Page 25 of 45
www.pencilji.com

a) Make
b) Screen size
c) Purchase data
d) Color/ b-w
Define a class television. Define a method for displaying the attribute
values of T.V. represent this problem specification using UML class
notations and write a java program for the same. The television class
should be defined with the required attributes. The main method
should be written to test methods of television class. For e.g. Display
TV () may be used to print the attributes of television class.
a) Identify the various use cases and actors involved and represent
the user view of system.
b) Identify the various classes and attributes and bring out a class
diagram, and a sequence diagram.

Use Case Diagram:

TV attributes
user

Activity Diagram:

Execute
Program

Accept TV
attributes

Dispaly TV
attributes

Exit Program

Class Diagram:

Page 26 of 45
www.pencilji.com

Television
make : String
screen : int
purdate : Date BufferedReader
+theBufferedReader
blkcolor : String (from io)

Television()
display()
main()

Sequence Diagram:

objTV: objBr:
: user
Television BufferedReader
initiate main()
create buffer

enter TV attributes

set TV attributes
display TV attributes
exit program

import java.io.*;

Page 27 of 45
www.pencilji.com

import java.util.*;
import java.lang.*;
public class Television
{
private String make;
private int size;
private Date purdt;
private boolean color;
public Television() throws IOException
{
BufferedReader br= new BufferedReader(new
InputStreamReader(System.in));
int opt;
System.out.print("\n\t\t\tTelevision Details");
System.out.print("\n\t\t\tMake: ");
make=br.readLine();
System.out.print("\n\t\t\tSize: ");
size=Integer.parseInt(br.readLine());
purdt=new Date();
System.out.print("\n\t\t\tSelect: ");
System.out.print("\n\t\t\t1. Colored");
System.out.print("\n\t\t\t2. Black & White");
System.out.print("\n\t\t\tYour Option: ");
opt=Integer.parseInt(br.readLine());
if(opt==1)
color=true;
else
color=false;
}
public Void display()
{
System.out.print("\n\t\t\tTelevision Details");
System.out.print("\n\t\t\tMake: " + make);
System.out.print("\n\t\t\tSize: " + size);
System.out.print("\n\tPurchase Date: " + purdt);
System.out.print("\n\t\t\tType: " );
if(color)
System.out.print("Colored");
else
System.out.print("Black & White");
return null;
}
public static void main(String args[]) throws IOException
{

Page 28 of 45
www.pencilji.com

Television tv = new Television();


tv.display();
}
}
Television Details
Make: LG
Size: 29
Select:
1. Colored
2. Black & White
Your Option: 1
Television Details
Make: LG
Size: 29
Purchase Date: Thu Dec 23 12:50:15 GMT+05:30 2004
Type: Colored

Program 7: OOA AND OOD USING UML V

Page 29 of 45
www.pencilji.com

Bank interest computation


Consider the following attributes:
P = principle ,R = rate of interest ,N = number of years, SI = simple
interest, A= amount
Design UML class called deposit with the above 5 attributes. In the
constructor calculate SI and amount. Implement the above
specification using java prog.language.

Use Case Diagram:

Compute simple interest


User

Activity Diagram:

Execute the
program

input principle

input rate

input time

compute simple
interest

compute amount

Class Diagram:

Page 30 of 45
www.pencilji.com

Si
p : double
r : double
t : int
+theBufferedReader
BufferedReader
si : double
amt : double

main()
compute()
Si()

Code:
import java.io.*;
public class Si
{
private double p;
private double r;
private int t;
private double si;
private double amt;
public BufferedReader br;
/**
@roseuid 41C7E59202FD
*/
public Si() throws IOException
{
br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("\n\t\t\tPrinciple: ");
p=Double.valueOf(br.readLine()).doubleValue();
System.out.print("\n\t\t\tRate of Interest: ");
r=Double.valueOf(br.readLine()).doubleValue();
System.out.print("\n\t\t\tNo. of Years: ");
t=Integer.parseInt(br.readLine());
}
/**
@param args[]
@roseuid 41C7E392001E
*/
public static void main(String args[]) throws IOException
{
Si s = new Si();
s.compute();

Page 31 of 45
www.pencilji.com

/**
@roseuid 41C7E3980138
*/
public void compute()
{
si=(p*r*t)/(double)100;
amt=p+si;

System.out.print("\n\t\t\tSimple Interest: " + si);


System.out.print("\n\t\t\tAmount: " + amt);
}
}

Principle: 5000

Rate of Interest: 5

No. of Years: 5

Simple Interest: 1250.0

Amount: 6250.0

Page 32 of 45
www.pencilji.com

Program 8: OOA AND OOD USING RUMBAUGH AND


UML VI
In the bank, the customer opens an account and in that account
he/she deposits money so the entities are:

CUSTOMER
ACCOUNT
DEPOSIT

A customer can have several accounts and an account can be spent as


a joint account by several customers. In a customer class the address
of the customer is constructed as an object of the class called address.
Write the UML class diag. consisting Customer class and address class.
In the account class, there is an attribute called users. This is an
integer attribute. It tells no of users of account. If the account is joint
account by 5 persons, the value of the user =5. If it is single user
account, user=1.
Write UML class diagram for account.

Class Diagram:

Customer
Address
custid : int
street : String
fname : String
city : String
lname : String
+theAddressstate : String
dob : Date
country : String
address : Address
pincode : String
phoneno : String
Address()
Customer() +theCustomer
display()
display()

Account
Deposit users : int
principle : int accno : long
rate : double
+theDeposit cust[] : Customer
years : int deposit : Deposit

Deposit() main()
display() Account()
displayAccountdetails()

Page 33 of 45
www.pencilji.com

Program 9: OOA AND OOD USING BOOCH AND


UML-VII

Consider the object COLLEGE of mini project. For the entire given
specifications in the problem construct the following UML diagrams.
Specifications:
In a college of computer science there are comp lab and equipments.
Develop a system to create the college as an object and display the
contents.
1. class diagram
2. object diagram
3. interaction diagrams
sequence
collaboration
4. deployment diagram

Class Diagram:

Staff
College
name : String
principal : String
staffId : int
name : String
stafftype : String
address : String
dateofjoining : Date
totalintake : int
qualification : String
College()
Staff()
displayContents()
display()

Network
Laboratory type : String
noofcomputers : int platform : String
noofnetworks : int size : int
speed : int
Laboratory()
display() Network()
display()

Computer
compid : String
type : String Printer
processor : String printerid : String
opsys : String type : String
softwares : String make : String

Computer() Printer()
display() display()

Page 34 of 45
www.pencilji.com

Sequence Diagram:

objCollege objStaff : Staff objLab : objNet : objComp: : objPrint: :


Laboratory Network Computer Printer
assigns laboratory
takes charge of lab
establishes network(s)
establishes communication
uses

displays college information

display staff details

display lab details

display network details

display computer details

display printer information

Page 35 of 45
www.pencilji.com

Collaboration Diagram:

6: displays college information

1: assigns laboratory
7: display staff details
objColle objStaff :
ge 8: display lab details Staff

2: takes charge of lab


objLab :
Laboratory

3: establishes network(s)
9: display network details

objNet :
Network
11: display printer information

5: uses
4: establishes communication
objComp:
10:: display computer details objPrint: :
Computer Printer

Deployment Diagram:

College

Network

Comput
er

Page 36 of 45
www.pencilji.com

Program 10: OOA AND OOD USING UML-VIII


C library information system:
A library lends books and magazines to members, who are
registered in the system. Also it handles the purchase of new titles for
the library. Popular titles are bought in multiple copies. Old books and
magazines are removed when they are out of date or in poor
condition. A member can reserve a book or magazine that is not
currently available in the library, so that when it is returned or
purchased by the library, the person is notified. The library can easily
create, replace and delete informations about the titles, members
loans and reservations in the system.
For the above problem specification devise the following UML
diagrams:
use case diagram
class diagram
state transition diagram
sequence diagram
collaboration diagram
activity diagram
component diagram
deployment diagram

Use Case Diagram:

Book lending
member

Maintaining titles
Librarian Supplier

Page 37 of 45
www.pencilji.com

Activity Diagram(Borrow & Reserve):

User logs in to
the system

Specify details of return book Registered User Unregistered User


book being returned

borrow book

Update Book
Catalog view catalog Ask for
registeration

no reservation for book


no
Select the book
reservation exists for book
yes
Notify Member who
reserved the book
Register user
Get book
issued

Page 38 of 45
www.pencilji.com

Activity Diagram (Purchase & Remove)

Verify title entries in


catalog

remove old titles remove old titles


and magazines

purchase titles

new book reservation for new book


update the
popular title catalog

place order for place order for place order for a


new title multiple copies reserved title

receive order

update catalog

no reservations

reservation exists for book

notify member who


reserved the book

Page 39 of 45
www.pencilji.com

Sequence Diagram (Borrow & Reserve):

objCatalog : objBorrow : objReserve : objReturn :


: member : Librarian
Catalog Borrow Reserve Return
view catalog
enter details of book
get sanction
issue authorization

update catalog

enter details of book


store the details

specify details of book

notify librarian
update the catalog

Page 40 of 45
www.pencilji.com

Collaboration (Borrow & Reserve):

7: store the details

objReserve :
Reserve

: member

6: enter details of book 1: view catalog


objCatalog : 8: specify details of book
5: update catalog Catalog

objBorrow : 2: enter details of book 10: update the catalog


objReturn :
Borrow Return

3: get sanction

4: issue authorization 9: notify librarian

: Librarian

Page 41 of 45
www.pencilji.com

Sequence Diagram (Purchase & Removal):

objCat : objPur: : objRem: :


: Librarian : Supplier : member
Catalog Purchase Remove

verify catalog
place order for titles
send notification

brings titles

notify librarian
update catalog
notify member of arrival of reserved title

send titles to be removed


remove titles
notify librarian
update catalog

Collaboration Diagram (Purchase & Removal):

4: brings titles

: Supplier
3: send notification
objPur: :
Purchase
5: notify librarian
: Librarian

10: notify librarian 1: verify catalog 2: place order for titles


9: remove titles
6: update catalog

11: update catalog 7: notify member of arrival of reserved title


objRem: : objCat :
Remove Catalog
8: send titles to be removed
: member

Page 42 of 45
www.pencilji.com

Class Diagram:

Purchase
(from m ai ntenance)
purid : int
Borrow
orderdate : Date
refno : int purchasedate : Date
dateofborrow : Date Remove
refno : int (from m aintenance)
returndate : Date userid : int
userid : int refno : int
removetitle : String
Purchase()
Borrow() updateCatalog()
showdetails() Remove()
notifysupplier()
asksanction() updateCatalog()
notifyLibrarian()
updateCatalog() displayRemoveList()

Catalog
User title : String
userid : int isbn : String
usertype : String price : int
username : String publisher : String
useraddress : String author : String
refno : int
User() type : String
display()
Catalog()
showtitledetails()
updatedetails()
notify()

Return Reserve
refno : int refno : int
userid : int userid : int
dateofreturn : Date dateofreserve : Date
fine : int availability : Boolean

Return() Reserve()
computeFine() verifyCatalog()
updateCatalog() displayReserveList()
notifylibrarian()

Page 43 of 45
www.pencilji.com

Component Diagram:

UI Borrow
Return

Maintain Purchase
Catalog Remove

Deployment Diagram:

Librarian's
Desk Supplier

Recepti
on

Page 44 of 45
www.pencilji.com

Page 45 of 45

Das könnte Ihnen auch gefallen