Professional Documents
Culture Documents
DEPARTMENT OF
PREFACE
UML is a language used for visualizing, specifying, constructing, and documenting the artifacts of a software intensive system. This manual is designed and developed under the syllabus pattern introduced by Jawaharlal Nehru Technological University for the V semester B.Tech Computer Science and Engineering department for the Language Processor Lab . This manual is indented for an introductory course in OOPS through UML at the graduate level students. It provides to a way to represent the artifacts of a software intensive system in a standardized manner. The primary purpose of this manual is creating a comprehensive understanding of the OOPS concepts with their application in UML along with mapping it to various programming languages. We are liable to convey our sincere thanks to our H.O.D. and all the staff members of CSE for their helping hands to produce this successful manual.
STAFF INCHARGE
HOD/CSE
PRINCIPAL
1.
Introduction
List of programs: 11 27 37 39 43 54 55 56 31 58 67 68
Airlines Reservation System ATM Model Auction Application Course Registration Online Book Shop Personal Computer Model Plant Model Point Of Sale Simulated Company Student Model Telephone Dialing
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.
Airlines Reservation System ATM Model Auction Application Course Registration Online Book Shop Personal Computer Model Plant Model Point Of Sale Simulated Company Student Model Telephone Dialing
INTRODUCTION TO UML UML is a language used for visualizing, specifying, constructing and documenting the artifacts of a software intensive system.
Building Blocks of UML : Things Relationships Diagrams Things in UML : Structural things i. Classes ii. Interfaces iii. Collaborations iv. Use Cases v. Active Classes vi. Components vii. Nodes Classes Behavioral things i. Interactions ii. State machines Grouping things i. Packages Annotational things i. Notes Relationships in UML : Dependency Association Generalization Diagrams in UML : Class Diagram Object Diagram Usecase Diagram Sequence Diagram Collaboration Diagram Statechart Diagram Activity Diagram Component Diagram Deployement Diagram
Class :
Interface :
Collaboration :
Use Case :
Place Order
Active Classes :
Active Classes :
OrderForm.j ava
Node :
File Server
Interaction :
State Machine :
Packages :
Grouping things are the organizational parts of UML models. These are the boxes into which a model can be decomposed. In all, there is one primary kind of grouping thing, namely, Packages.
java.swing.*
Notes :
Annotational things are the explanatory parts of UML Models. These are the comments you may apply to describe and illuminate about any element in a model.
Dependency :
Association :
Generalization :
Realization :
LAB EXERCISES
requestfieldvalues()
enter_field_values()
validate()
invalid()
Display_error_messages()
valid_add_record()
administrator
deleteform
deletecontroller
errormessages
passengerDB
request_key_field()
enter_key_field()
validate()
invalid()
display_error_messages()
valid_delete_record()
administrator
domainform
domaincontroller
request_operator()
specify_operation()
sequence diagram
Mo
administrator updateform updatecontroller errormessages flight DB
request_key_field()
enter_key_field()
validate()
lookup()
query_result()
no_such_record()
recordexist_displayrecord()
edit_details()
validate()
invalid()
valid_update_record()
reserver
reservation form
reservation controller
banking details
banking DB
error messages
printer
request_mode_of_payment()
select_mode_of_payment()
select_mode()
if_credit_cord()
request_banking_details()
enter_bank_details()
lookup()
query_result()
invalid()
if_valid()
diveconfirmation()
if_cash()
deliver_ticket()
3: validate() addcontroller
5: displat_error_messages()
errormessages
Delete collaboration diagram :2: enter_key_field() 8: edit_details() administrator 1: request_key_field() updateform 7: recordexist_displayrecord() 4: lookup() 11: valid_update_record() 5: query_result() errormessages 6: no_such_record() 10: invalid() flight DB 3: validate() 9: validate() updatecontroller
Update collaboration diagram:2: enter_key_field() 8: edit_details() administrator 1: request_key_field() updateform 7: recordexit_displayrecord() 4: lookup() 11: valid_update_record() 5: query_result() 6: no_such_record() errormessages 10: invalid() passengers DB 3: valid() 9: validate() updatecontroller
administrator
addform
addcontroller
errormessage
flight DB
request_field_values()
enter_field_values()
validate()
invalid()
display_error_messages()
valid_add_record()
Update(flight) collaboration diagram:2: enter_key_field() 8: edit_details() administrator 1: request_key_field() updateform 7: recordexist_displayrecord() 4: lookup() 11: valid_update_record() 5: query_result() errormessages 6: no_such_record() 10: invalid() flight DB 3: validate() 9: validate() updatecontroller
3: enter_details() 9: select_flight() 13: enter_passenger_details() reserver 1: welcome_reservor() welcomeform reservationform 2: request_details() 12: request_passenger_details() 15: mode_of_payment() 16: store_passenger_details() 8: display_flight_details() 4: passplaces() 10: selected_flight() 14: process_passenger_details() reservationcontroller 5: lookup() 11: look_selected_flight_record() 17: update_flight DB 18: unlock_the_record() passenger DB
administration
loginform
logincontroller
welcomeform
errormessages
request_details()
enter_details()
password_details()
valid()
invalid()
display_error_messages()
administrator
domainform
domaincontroller
enter_the_operation()
add()
sequence diagram
administrator
domainform
domaincontroller
enter_the_operation()
add()
sequence diagram
administrator
updateform
updatecontroller
errormessage
passenger DB
request_key_field()
enter_key_field()
validate()
lookup()
query_result()
no_such_record()
recordexist_displayrecord()
edit_details()
validate()
invalid()
valid_update_record()
administration
loginform
logincontroller
welcomeform
errormessages
request_details()
enter_details()
password_details()
valid()
invalid()
display_error_messages()
reserver
welcomeform
reservationform
reservation controller
errormessages
passenger DB
flight DB
welcome_reservor()
request_details()
enter_details()
passplaces()
lookup()
query_result()
no_match_found()
display_flight_details()
sellect_flight()
sellected_flight()
lock_sellected_flight_reserve()
request_paddenger_details()
enter_passenger_details()
process_passenger_details()
mode_of_payment()
sequence diagram
store_passenger_details()
update_flight DB
unlock_the_reader()
Login collaboration diagram :2: enter_details() administrator loginform 1: request_details() 3: passdetails() logincontroller
5: invalid()
4: valid()
6: diaplay_error_messages errormessages
welcomeform
Maintain passenger database collaboration diagram :2: enter_details() administrator 1: request_details() loginform 3: passdetails() logincontroller
4: valid() welcomeform
Maintain flight database collaboration diagram :2: specify_operation() administrator 1: request_operation() domainform
domaincontroller
3: validate() deletecontroller
6: valid_delete_record() flight DB
reservor
reservationcontroller
1: request_payment_details() reservationform
9: invalid_data()
5: request_bank_details() printer
errormessages
2. ATM MODEL :
Login sequence diagram:user login form login controller welcome message display error message database
1: user login()
manager
user
main form
application form
controller
1: enquiring details
manager
administrator
verification
assigning codes
database
2: verification
3: valid
4: updation of database
5: invalid
2: select options
Sequence diagram
5: selecting cash()
sequence diagram
2: provides acknowledgement
4: updating database
user
controller
ATM
2: enter amount
Sequence diagram
2: updating database
login form
login controller
databas e
Creating cards collaboration diagram:manager 1: enquiring details 2: providing details user main form
8: display error message 4: providing application form controlle r 7: invalid application form
applicatio n form
2: verification
4: updating database
databas e
5: selecting cash
6: selecting cheque
ATM
Deposit collaboration diagram:2: select options user 1: display options for deposit & withdraw main form
controlle r
Withdraw collaboration:2: enter the amount user 3: user is provided with various modes of payment 1: user is asked for amount 4: select mode of payment controlle r
5: selecting cash
6: selecting cheque
ATM
user
3. Auction Application :
Purchasers sequence diagram:purchaser auction mail goodsroom negotiation room chatting database
login
verify user
display goods
select goods
enter chatting
bidding
record contents
end of negotiation
broadcasting result
Collaboration diagram:-
6: enter chatting
negotiation room
4. Course Registration :
Login sequence diagram:User MainWindow 1: Logging In LoginWindow LoginControl Welcome Window ErrorMessage
4: Valid user
5: Invalid User
6: Error Message
7: Relogin / Cancel
Student
Registration Form
Form Control
Error Message
Database
1: Registration Form
2: Request Details
6: Store Details
7: Confirm Message
8: Invalid Elective
9: Display Reason
10: Invalidate
11: Re-register
Student
CourseForm
CourseForm Control
ErrorMessage
Database
1: Select Course
2: Validate Course
5: Invalid Course
Login collaboration diagram:1: Logging User 2: Ask For ID 7: reLogin / Cancel Main Window 6: Error Message 3: Verification Login Control 5: Invalid Error Message Login Window
4: Valid
Welcome Window
1: Registration Form 3: Enter Details 11: re-registration Student 5: Verify Elective Details 2: Request Details Registration Form
Course details collaboration diagram:5: Display Course Information Student 1: SelectCourse CourseForm Control 2: Validation
Course Form 7: Display Error Message 3: Get Course Infomation 4: Get Course Information
Databas e
5. Online Bookshop :
Login sequence diagram:user mainform loginform welcomeform logincontroller errorcontroller database
1:login()
2:enter username/password
3:authenticatio
5:valid
6:invalid
7:error message
8:relogin
administrator
mainform
controller
errormessages
database
1:request id
2:enter id
3:verification
4:invalid
5:errormesage
6:re_enterid
7:verified
8:generate reports
cuatomer
mainform administrator
controller
errormessages
database
2:verify
4:error message
5:verified
6:retrieve data
manager
option form
2:add books
sequence diagram 3:update books sequence diagram 4:delete books sequence diagrams
manager
book controller
error message
database
3:verification
5:error message
6:filled property
7:generate id
manager
selector form
modification form
modification controller
errormessage
database
2:selecting book
3:intimate database
4:retrive data
5:modify
6:verification
7:improper
8:error message
manager
selector form
deletion form
database
1:select book
2:retriving data
3:deleting
4:update()
1: login() 8: relogin
mainform
3: authentication
logincontroller 6: invalid
errormessage
database
View reports collaboration diagram:2: enter id 6: re_enter id administrator 1: requestid 8: generate reports database mainform 3: verification controller
7: verified
5: error message
4: invalid id
errormessage
2: verify controller
6: retrieved data
database
4: error message
error message
2: add new books manager new book add form 1: request for new book 7: generate id database
6: filled properly
errormessage
Modify collaboration diagram:2: selecting book manager 1: request to select book selector form modification controller
5: modifying
6: verification
7: improper modification
4: retrive database
error message
8: error messages
database
6. PC Model
7. Plant Model
8. Point Of Sale :
Sequence diagram:cashier system tax collector credit authorization service accounts
2: enter item()
3: description()
4: end sales()
7: make payment()
8: change receipt()
Collaboration diagram:-
cashier
2: enter items 8: change receipt 4: end sales 6: total with taxes 7: make payments 3: description system 10: post receivable
9. Simulated Company
Sequence Diagram for usecase 1:
:user disp : Display requestLoan() getDetails :Loan amount : Cash Account details : Compan yDetails
updateDisplay()
balance()
amount
:user
disp : Display
MachineClass
factory : Factory
getStaticDetails()
debitCost
updateDisplay()
addMachine(Machine)
balance()
amount
:User
disp:Display nextTurn
factory:Factory
MachineClass
market:Market
production:Prod uction
sales:Sales
capacity mcoutput
output number
projectedPrice()
nextTurn(num bertaken,price,salesprice)
getProductionDetails()
recordNum ber()
recordSalesPrice()
getNum berInStock()
stock
getProjectedPrice()
projectedPrice()
getProjectedSales()
projectedSales()
adjustProjectedPrice()
setEndStock(number)
calculate
grossProfit()
/ProductionFactor y : Factory
: User 1: RequestLoan 2: 3 : Loan ( amount,duration) disp : Display : Loan 3: 5 : addLoan(Loan) details : Company Details
1...*
Loan
1...*
/CompanyAccount : CashAccount
/companyDetails : CompanyDetails
disp : Display
2: Balance()
10: addMachine(Machine)
/CompanyAccount : CashAccount
/ProductionFactor y : Factory
details : Company Details 2: o_h = machineOverhead() 6: amount := grossProfit() 7: adjustBank() 8: credit(new Profit())
factory : Factory
:Loan
sales : Sales
:Machine Class
:Loan
/ProductionFactor y : Factory
/CompanyDetails : CompanyDetails
/CompanyAccount : CashAccount
:Machine Class
/SalesDetails : Sales
/UserDisplay : Display
/CompanyDetails : CompanyDetails
/MarketDetails : Market
/CompanyAccount : CashAccount
/ProductionFactor y : Factory
/SalesDetails : Sales
/CompanyProduction : Production
1: lift receiver
2: dialtone
3: dial digit
6: ringing tone
7: answer phone
8: stop ringing
9: stop tone
Collaboration diagram:-
3: dial digit
4: route exchange
9: stop tone
6: ringing tone
talker