HOLY JESUS & MARY P.G.
COLLEGE OF COMPUTER SCIENCES
CERTIFICATE
Regd.No :
This is certify that this is a bonafide record of practical work done in OOSD lab by Mr./Mrs/Ms. __________________________ of MCA III year I semester during the year 2012.
Lecturer Incharge
Head of the Department
External Examiner
INDEX
S.no 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Name of the program Introduction to UML Hotel Room Reservation Scenario Bill preparation for major distributor Statistics of Cricket player System to record Assignment of Equipment to chemist System to track items in a super market System to computerize SAMs Courier System to track Business school admission System to manage orders in OTOS pharmacy Leave management OU central library Health care Organization PG program in LAH University Online Examination system System for maintaining Book Club Online Railway Reservation system 3-9 11-13 14-16 17 18-19 20-21 22-24 25-28 29-31 32-34 35-37 38 39-40 41-42 43 44-45 Page.No
AN OVERVIEW OF THE UML
The UML is language for Visualizing Specifying Constructing Documenting The UML is a Language : A language provides a vocabulary and the rules for combining words in that vocabulary for the purpose of communication. The modeling language is a language whose vocabulary and rules focus on the conceptual and physical; representation of a system .A modeling language such as the UML is thus a standard language for software blueprints. The UML is a language for Visualizing: The UML is more than just a bunch of graphic symbols, and each symbol in UML notation is well-defined semantics. The UML is a language for Specifying: Specifying means building models that are precise, unambiguous and complete in particular the UML addresses the specification of all important analysis, design and implementation decisions that must be made in developing and deploying a software intensive system. The UML is a language for Constructing: The UML is not a visual programming language, but its models can be directly connected to a variety of programming languages. This means that it is possible to map from a model in UML to a programming language such as java or c++. The UML is a language for Documenting: A healthy software organization produces all sorts of artifacts in addition to raw executable code. This artifacts includes Requirements Architecture
3
Design Prototypes Project plans Releases
A CONCEPTUAL MODEL OF THE UML
To understand the UML you need to form a conceptual model of the language and this requires learning three major elements is the UMLs basic building blocks. Building Blocks of the UML: The vocabulary of the UML encompasses three kinds of building blocks: 1. Things 2. Relationships. 3. Diagrams.
THINGS IN UML:
Structural things Behavioral things Grouping things An notational things
STRUCTURAL THINGS:
These are the nouns of the model. There are seven kinds of structural things. Class: Is a description of set of objects that share the same attributes, operations, relationships, and semantics. A class implements one or more interfaces.
Interface: Is a collection of operations that specify a service of a class or a component. An interface might represent the complete behavior of a class or a component or a part of that behavior.
Collaboration: Defines an interaction and is a society of roles and other elements that work together to provide some cooperative behavior that is bigger than the sum of all elements.
UseCase: Is a description of set of sequence of actions that a system performs that yields an observable result of value to a particular actor.
Active Class: Is a class whose objects own one or more processes or threads and therefore can initiate control activity.
Component: Is a physical and replaceable part of a system that confirms to and provides the realization of set of interfaces.
Node: Is a physical element that exists at run time and represents a computational resource.
BEHAVIORAL THINGS: Are the dynamic parts of the UML models. There are two types Interaction: Is a behavior that comprises a set of messages exchanged among a set within a particular context to accomplish a specific purpose. of objects
State machine: Is a behavior that specifies the sequence of states an object or an interaction goes through during its lifetime in response to events, together with its responses to those events.
GROUPING THINGS: Are the organizational part of a UML model. Package: Is a general purpose mechanism for organizing elements into groups. Structural things, behavioral things , and even other grouping things may be placed in a package
ANNOTATIONAL THINGS: Are the explanatory parts of UML models. Note: These are comments you may apply to describe , illuminate , and remark about any elements in the model.
RELATIONSHIPS IN THE UML: There are four kinds of relationships in the UML. Dependency: Is semantic relationship between two things in which change to one thing may effect the semantics of other things. Association: Is a structural relationship that describes a set of links, a link being a connection among objects.
Generalization: Is a specialization/generalization relationship in which objects of specialized elements are substitutable for objects of the generalized parent.
Realization: Is a semantic relationship between classifiers, wherein one classifier specifies a contract that another classifier guarantees to carry out.
DIAGRAMS IN THE UML: Diagram is a graphical presentation of a set of elements. There are nine types of diagrams. 1. 2. 3. 4. 5. 6. 7. 8. 9. class diagram Object diagram Use-case diagram Sequence diagram Collaboration diagram Statechart diagram Activity diagram Component diagram Deployment diagram
Class diagram: Shows a set of classes, interfaces and collaborations and their relationships. These diagrams are the most common diagrams found in modeling object oriented systems. Object diagram: Shows a set of objects and their relationships. They represent static snapshots of instances of things found in class diagrams. Usecase diagram: Shows a set of usecases and actors and their relationships. It represents static view of the system. Sequence & Collaboration diagrams: Are kind of interaction diagrams shows an interaction, consisting of a set of objects and their relationships, including the messages that may be dispatched among them. They are dynamic view of a system. Statechart diagram: Shows a state machine, consisting of states, transitions, events, activities. It represents dynamic view of a system. Activity diagram: Is a special kind of a statechart diagram that shows the flow from activity to activity within a system. It represents dynamic view of a system. Component diagram: Shows the organizations and dependencies among a set of components. These represent static view of a system. Deployment diagram: Shows the configuration of runtime processing nodes and components that live on them.
9
Question Bank
10
1.) Draw Use Case Diagram & Activity Diagram with swimlane for the front office system in a 5star hotel described below. Front office of any hotel is responsible for all rooms reservations, room allocations and final settlement of bills. Any company or person can reserve rooms for their future stay. They have to indicate from what date to what date they need the rooms. They also have to indicate how many rooms are required . Sometimes the reservations could be cancelled or dates or number of rooms changed. For reservation , cancellation or modification of rooms, customer receives an acknowledgement from the hotel.
Use case diagram:-
Reservation
Room Allocation
Settlement of bill
No., of rooms for reservation <<Include>> No of rooms Modifications <<include>> Dates Front Office
User
Cancellation
11
Activity diagram:-
Enquiry
Check Availabil
Rooms
Dates
Available Modify
Reserve
Cancel
Acknowledgment 12
2. Front office of any hotel is responsible for all rooms reservations, room allocations and final settlement of bills. Any company or person can reserve rooms for their future stay. They have to indicate from what date to what date they need the rooms. They also have to indicate how many rooms are required . Sometimes the reservations could be cancelled or dates or number of rooms changed. For reservation , cancellation or modification of rooms, customer receives an acknowledgement from the hotel. Draw sequence diagram for reserve room scenario, also draw the class diagram
Sequence Diagram:Customer Front Office
No., of days No., of rooms
Check Availability
Modification of Reservation of rooms
Cancellation of
Acknowledgement
Class Diagram:-
13
A major distributor of office supplies has a set of criteria for preparing bills. When the customer places the order one of the sales staff prepares the order and writes the bill, if there is an insufficient quantity of items on hand, the back order is set up for missing items. The available items are shipped and bill is prepared. The cost is billed for the back order items when they are shipped. Wholesale customers are eligible for discount if they purchase minimum of 100 items. Retail customers are not eligible for any discounts irrespective of the number of items ordered. All retail customers pay sales tax, wholesale customers dont pay any tax provided they have state tax exemption. All bills are mailed to customers. Draw use case diagram and also draw sequence diagram for one of the scenario.
place order back order <<extends>>
customer
prepare order
sales person
mail bills wholesale custmor retailer <<include>> tax bill
discount
:Customer
: Salesperson
place order( ) check availability( ) ship order( )
mail bills( )
14
4. A major distributor of office supplies has a set of criteria for preparing bills. When the customer places the order one of the sales staff prepares the order and writes the bill, if there is an insufficient quantity of items on hand, the back order is set up for missing items. The available items are shipped and bill is prepared. The cost is billed for the back order items when they are shipped. Wholesale customers are eligible for discount if they purchase minimum of 100 items. Retail customers are not eligible for any discounts irrespective of the number of items ordered. All retail customers pay sales tax, wholesale customers dont pay any tax provided they have state tax exemption. All bills are mailed to customers. Draw activity diagram with swim lanes and draw class diagram.
Class Diagram & Activity Diagram:
Customer 1---------------------1 Name:String Custmertype:String Itemlist:String
Purchases 1 item-string quality() price() * 1
+Items() +bill paying() +offers() 1 * 1 1
Offers type: String Discount()
Billig item-string product details() gives the bill() +cards +cash Cashier Customer details: String Paid details
+prepares bill() +offers() +payment()
15
Customer
Stores
Distributor
Place order
Check availability
Items
Price
Availabl e
Back order
Prepare order
Price
Ship
Mail bills Close Pay bills
16
5. A century system is the statistics provider organization of all the first class cricket matches conducted across the world round the year. They compile all the statistics of the players in terms of matches played, venues, country, match type (test/one-day). For each match, statistics is compiled for each player i.e., runs scored in each innings, wickets and catchers taken, run outs, number of fours and sixes hit etc., The Company wants to develop a computer application to compile these statistics. Identify classes using CRC and draw the class diagram with the necessary relationships. Also specify the multiplicities, roles etc. Draw the use case diagram with statistician as an actor
Usecase Diagram:
player information
Statisstician
match information
17
6.
A laboratory has several chemists who work on one or more projects. Chemists (Empid, Name, Phone_no) also may use certain kinds of Equipments (Serial_no, cost) on each project (Projectid, start_date). The organization wishes to record assign- date i.e., the date when the given equipment item was assigned to a particular Chemist working on a specified project, as well as total number of hours the chemist has used the equipment for the project. The chemist must be assigned to at least one project and one equipment item. Draw the use case diagram and class diagram.
Usecase & Class Diagrams :
<<include>>
Chemists Project Lab
Equipment
18
19
7.
Mega super market has three checkout counters. In order to improve the checkout process a PC has been set up at each of these counters along with the printer. Each item in the super market is packed & each packet carries on it a price tag on which are printed its item code and price. Each customer picks out the desired packet from the shelves place them in the standard shopping basket supplied by the super market and carries the basket to one of the checkout counters. The counter operator takes out each of the packets from the basket, keys in the 12 digit item code. The amount is collected from the customer and a bill is printed and issued to the customer. Identify the classes and draw class diagram with suitable relationships, multiplicities and roles. Also draw the state diagram for one of the item object.
Class & State Chart Diagrams :
20
Packet
Placed on shelves
Picket
Billed
Carried
21
8.
SAMs Couriers Limited intends to computerize the recruitment process. The advertisements for a particular post appear on their website. The candidates are called for interview based on the eligibility criteria which varies from post to post. Information regarding the eligibility and vacancies is maintained in a database. The candidate is selected based on written test and interview. Once selected, the candidate is under probation for one year. In this period the candidate is not eligible for any special leaves and benefits. After completion of the probation period the manager evaluates the candidates performance and will be given an appointment letter with a unique employee id. Draw use case diagram for the given scenario. Also draw the sequence diagram for one of the scenarios.
Advertisments
<<Include>>
Organization interview
<<Include>>
Selection
written test
Appointing
22
Evaluation for selection
:Candiate
1 Advertise 2 Applt for post 3 evaluation
4 call for interview
5 Appear for interview 6 Appear for written test
23
9.
SAMs Couriers Limited intends to computerize the recruitment process. The advertisements for a particular post appear on their website. The candidates are called for interview based on the eligibility criteria which varies from post to post. Information regarding the eligibility and vacancies is maintained in a database. The candidate is selected based on written test and interview. Once selected, the candidate is under probation for one year. In this period the candidate is not eligible for any special leaves and benefits. After completion of the probation period the manager evaluates the candidates performance and will be given an appointment letter with a unique employee id. Draw activity diagram with class diagram. Draw the complete class diagram with necessary relationships, multiplicities, roles etc.
24
10.
In a Business school, once a student is admitted, he/she will be assigned a counsellor. The student has to report to the counsellor & fill his/her personal details in the counselling file. Students queries/problems are addressed by the counsellor, which is also recorded in the counselling files. The Principal of the school monitors the process of counselling i.e. the problems reported by the student and actions taken by the counsellor. As the strength of the school has increased, it is not possible for the principal to monitor the counselling process manually. Draw the use case diagram and activity diagram with swim lanes.
registered
select course principal
view counselling file
student queries &problems
counseller actions taken
admission
25
Student
Counsellor
Registered
Problems & Queries
Selected course
Actions taken
Principal
26
11.
In a Business school, once a student is admitted, he/she will be assigned a counsellor. The student has to report to the counsellor & fill his/her personal details in the counselling file. Students queries/problems are addressed by the counsellor, which is also recorded in the counselling files. The Principal of the school monitors the process of counselling i.e. the problems reported by the student and actions taken by the counsellor. As the strength of the school has increased, it is not possible for the principal to monitor the counselling process manually. Draw the sequence diagram for all the scenarios. Also specify how sequence diagrams are converted to collaboration diagrams
Student
1: Registered 2: Select Course
Counsellor
3.Problem& Queries 4.Action Taken
Principal
27
student
counsellor registered
principal
select course problems&queries
action taken
satisfied
admisssion completed
28
12.
OTOSs pharmacy is the distributor of various pharmaceuticals products. They have a huge network of customers. The registered customers can only book orders for the specified product. If the specified product is available the required quantity is checked against the quantity on hand (QOH). If the required quantity is less than QOH a deliver challan is prepared. After the delivery of the product an Invoice is prepared by accountant which contains the cost of ordered items, deductions if any (in case of damaged or lost goods) and previous outstanding balance. Then the invoice is sent to the customer. Draw the use case diagram with use case specifications. Draw the sequence diagram for prepare invoice scenario.
Available
Ordered
Transit
Deliver
Customer
Pharmacy
Accountant
placeOrder()
checkAvailability()
deliverChallen reciveGoods() invoice()
29
13.
OTOSs pharmacy is the distributor of various pharmaceuticals products. They have a huge network of customers. The registered customers can only book orders for the specified product. If the specified product is available the required quantity is checked against the quantity on hand (QOH). If the required quantity is less than QOH a deliver challan is prepared. After the delivery of the product an Invoice is prepared by accountant which contains the cost of ordered items, deductions if any (in case of damaged or lost goods) and previous outstanding balance. Then the invoice is sent to the customer. Draw the use case diagram with use case specifications. Draw activity diagram with swim lanes & draw state diagram of the product object.
Quit Quit <<extend>> Book order Book BookOrder order
DeliverChallen Deliver challen Prepare prepare Customer
<<include>> Invoice Invoice <<include>>
Deductions
Previous PreviousOutstanding outstanding Balance balance
30
Customer Placeorder
Pharmac Quate Prepare Delivery Ship goods
Accountan
Receive goods Cost
Prepare invoice Items
Receive invoice
Sent invoice
31
14.
Global group requires a system to be developed for maintenance of leaves in their organization. There are different types of leaves: Casual leaves, Medical leaves, Earned leaves and Special leaves. These leaves vary from employee to employee. If the employee is regular he can avail all types of leaves. An adhoc employee can only avail casual leaves. The medical and earned leaves can be credited in the employees account. The maximum limit of the credit is 240. Further if an employee has availed all the leaves his salary may be deducted. Draw activity diagram and model a sequence diagram for one of the scenario.
Employe
Organizatio
Employee
Available Leaves
Emp. Available of all types of leaves
Available leaves
Emp. Available leaves
No dedication in salary
Dedication in salary
32
Employee
Organisation
applyForLeave() availableLeave() availableLeaves()
checkAvailability()
deductSalary()
33
15.
Global group requires a system to be developed for maintenance of leaves in their organization. There are different types of leaves: Casual leaves, Medical leaves, Earned leaves and Special leaves. These leaves vary from employee to employee. If the employee is regular he can avail all types of leaves. An adhoc employee can only avail casual leaves. The medical and earned leaves can be credited in the employees account. The maximum limit of the credit is 240. Further if an employee has availed all the leaves his salary may be deducted. Draw use case diagram and also draw the class diagram for the given scenario.
tyes of leaves
Leaves
Employee
Salary
Regular emp. Adhoc emp.
34
16.
OUs Central library issues books to the staff & students. Students can avail 3 books & staff can avail max of 5 books. The books are issued for a period of one month. Thereafter a fine of Rs.1/- for each day is charged. The faculty members dont pay any fine. However they have to return the book at the end of semester. The Library receives the requisition from various departments to new books. Once it is approved the order is placed to the various vendors. University gives an order of the books to a particular vendor based on the competitive prices they offer. Model a Use case diagram & draw the Sequence diagram for all scenarios of a student actor.
searchBook
issuedBook
Librarian returnBook
User addBookRecord Vendor
requestBook
provideBook Database NewUseCase6
35
:User
:LMS
:Database
login() authenticateUser() successful() successfullLogin() searchBook() searchingBook() bookFound() logout() logoutSuccessful() availableBook()
:User
:LMS
:Librarian
:Database
issueBook() bookStatus() available()/ bookIssued() waiting()
logout() logoutSuccessfully()
36
:User login()
:LMS
:Librarian
:Database
authenticateUser() successfullyAuthentication()
successfullyLogin() returnBook() checkTime() calculateFine() successfullyReturned() logout() logoutSuccessfully()
:User
:LMS
:Librarian
:Database
:PurchaseDept
:Vendor
provideBook()
payToVendor() bookSend() updateBookRecord() recordUpdated()
payment()
getBook()
37
17.
You have been hired to design a system for small health care organization. The clinic consists of several examining rooms and few rooms for short term critical care patients. A core staff of seven physicians is supplemented by internists from a local teaching hospital. Patients medical data is stored in the central database. Patients first sign in at the front desk. Clerk checks the billing records, prints a summary status sheet and obtains file number from the system. The clerk then selects the examination room for the patient based on the case. After waiting for the physician, the clerk moves the data packet and the patient to the examination room. A nurse records basic medical data (weight, B.P etc). The physician makes additional notes to both the medical and billing data and generally writes the prescription order which is given to the patient and recorded on the charts. When the patient leaves, the clerk enters the new billing data into the system (if any). The new billing data is forwarded to appropriate insurance company. Identify the classes using CRC and draw the class diagrams with appropriate relationships, multiplicities etc.
38
18.
LAH University offers P.G program for working men. Candidates submit the application form to the registrar. The registrars office issues call letters to the candidates for writing the written test based on the following criteria: The first criterion for selection is that the candidate should be an engineering graduate or must have a PG degree (nonengineering). The second criterion is that the candidate should put a minimum of 2 years full time experience after the qualifying degree. The candidates qualified in written test are called for spot admissions and the seats are allotted based on the following distribution of seats: 30% of seats are reserved for ST, 10% for SC, 10% for BC & 20% for women and the remaining seats are under open competition. Draw a use case diagram and activity diagram with swim lanes.
Apply for admission
call letter
Registration office
selection
candidate
spot admission
<<include>>
allotment
39
University
Officers PG program
Candidat
Apply for PG program Issue call letter PG degree Min. of 2
Registration office
Submit application
Written test
Not qualify qualify
Not selected
Spot admission
Not OC candidate
Allotment of seats OC candidate
30%of of seats 30% seats
ST
SC,BC Woman
30% of seats
10% of seats
admission
40
19.
An Online examination system maintains a huge database of questions which are classified according to different parts of the syllabus and also according to difficulty level. In the beginning a student is considered to be an average student with a percentile of 50 and is given questions of medium difficulty randomly from the total syllabus. From here the type of questions presented varies according to the performance. The score starts with a value equal to the score obtained by a person with a percentile of 50. The score is calculated after every question and the change is score depends on difficulty level of the question. There is a restriction on the minimum number of questions of each type and a test taker may get more questions in any particular section if his performance in that section is below his overall performance. Draw sequence diagrams for all the scenarios identified.
:TakesExam
:Examination System specifiesSyllabus()
:Database
takesExam() sendsQuestions()/ displaysQuestions()
retrievesQuestions()
answeringQuestions() computeScores() [start.score=50]
41
20.
An Online examination system maintains a huge database of questions which are classified according to different parts of the syllabus & also according to difficulty level. In the beginning a student is considered to be an average student with a percentile of 50 & is given questions of medium difficulty randomly from the total syllabus. From here the type of questions presented varies according to the performance. The score starts with a value equal to the score obtained by a person with a percentile of 50. The score is calculated after every question & the change is score depends on difficulty level of the question. There is a restriction on the minimum number of questions of each type & a test taker may get more questions in any particular section if his performance in that section is below his overall performance. Model a Use case diagram & a Class diagram.
Questions
Student Computer score Database
42
21.
The book club has members. The book clubs sells books to its members. The member places orders for books, which the book club full fills. Each order contains one or more than one books. The books are written author(s). The publisher publishes the book. An author can write more than one books and a book can have more than one author. A book is published by a publisher, but a publisher publishes many books. A member can place more than one order. The member also can choose not to place an order. The book club sells many books. Draw a use case diagram with suitable relationships between use cases and model a class diagram.
Maintain & sell books
Place order for books BookClub Members Fullfill order
43
22.
An online railway reservation consists of the following activities. A Passenger can reserve a ticket, cancel a ticket and enquiry. Each train has limited number of reserved seats. Once a passenger cancels a ticket, required amount is deducted and the waiting list passenger is allotted the seat. Passenger may also book a ticket in tatkaal scheme by paying additional amount. Passenger who booked the ticket under tatkaal scheme cant get any refund if the ticket is cancelled. The chart is prepared two hours before the departure of the train. Model a Use case diagram for the given scenario with complete use case specifications.
check check the the availability availability...
fills reservation formform the reservation
enter the details on s/m enter details to the system
passanger
calcuate the cost calcuate the cost calicuate the cost calcuate the cost calculate the cost <<<<include>>>>
clerk
reservation conformed reservation is conformed reservation reservation reservation conformed conformed conformed
payment payment <<<<extends>> cash payment cash payment cerdit payment
print ticket
updation updation
44
23.
An online railway reservation consists of the following activities. A Passenger can reserve a ticket, cancel a ticket and enquiry. Each train has limited number of reserved seats. Once a passenger cancels a ticket, required amount is deducted and the waiting list passenger is allotted the seat. Passenger may also book a ticket in tatkaal scheme by paying additional amount. Passenger who booked the ticket under tatkaal scheme cant get any refund if the ticket is cancelled. The chart is prepared two hours before the departure of the train. Draw the state diagram for ticket object.
Passenger
Availability
Fill the form Resv
Co nfo rm atio n
Enter the Details
Calculate cost
Confirmatio n
Payment
Receive
Payment
Print
Updation
45