SlideShare a Scribd company logo
 
The Designing of a Software System from 
scratch with the help of OOAD & UML ­ A 
Restaurant System 
 
 
 
by 
 
 
 
Somenath Mukhopadhyay 
som­itsolutions 
som@som­itsolutions.com​ / som.mukhopadhyay@gmail.com 
 
 
   
From the last few days i have been thinking to share my idea about how to design software system 
from scratch with the help of object oriented principles. The way the OOPS is taught to the students 
may enable them to write small programming assignments, but when it comes to design a whole 
system, many of them may falter. I would like to address that part with the  basic principle of OOAD 
and tell you how to traverse from the problem domain to the solution domain with the help of OOAD. 
 
So, lets start. I have thought of an example to design a Restaurant system from scratch. I have used 
Java as the language, but one can use any OO language to achieve it. 
 
To start designing of a software system using OOAD, one has to first identify the main entities 
participating in that system. So, in a Restaurant system who are the main participants? You guessed 
it right. A restaurant itself. Then the next entity is of course a customer. I think these are the main 
two entities. Now what does a restaurant consist of. It consists of some tables, a menu card, and 
food items. Another thing i have forgotten to mention. A restaurant should have a FIFO queue for its 
customers… right? 
 
Now what kind of operation a Restaurant has to do? It should have some functionality to know if all 
tables are occupied, and if not which one is vacant; it should be able to book a vacant table when a 
new customer arrives. And when the customer leaves, it should be able to release that table and if 
anybody is waiting in its FIFO queue, it should be able to allocate that vacant table to that customer. 
It should also keep a track about who is the current customer it is serving and which customer has 
been allocated which table. Then it should also be able to generate a bill.  
 
Now what does a Menu consist of? It has a list of some food items… right? So from Menu’s angle, it 
needs an entity called Item. Now what are the attributes of a food item vis­a­vis a restaurant? Each 
item should have an ID, a Name and its Price… right?  
 
Now think that a restaurant will have a list of tables scattered systematically. So what kind of 
attributes a Table in a Restaurant may have? It should have an ID and it should know whether it is 
occupied or not. What kind of operation does a Table need? When a customer leaves the table, it 
should be able to tell the outside that it is occupied… right? On the other hand when a customer 
leaves the table it should let the outside world know that it is vacant and ready to accept new 
customer.  
 
With these things in mind lets design the Restaurant, Table, Menu and Item classes. 
 
 
 
 
 
 
 
 
Now lets talk about the other main entity called the Customer. What are the attributes of a customer 
should have when he enters a restaurant. he must have an ID. i am not talking about his passport or 
SSN or Aadhar card ID. This ID is with respect to the restaurant by which the customer can be 
identified within the Restaurant premise. We will also add Name as another attribute to a customer. 
Although there is no absolute need for this from the OOAD designer’s perspective, this is needed 
only for decoration as you will see later. And what kind of operation a customer usually does. He 
looks at the menu, decides what he wants to have and how many plates… right? So the customer 
entity should have an operation called giveOrder. Now think about this. In order to give order 
customer needs an entity which will hold the customer’s choice, i.e., which item and how many 
plates for that item. Lets call this entity as ItemOrder, each ItemOrder object representing a specific 
Item and its number of plates ordered by the customer. So in the actual order by a customer, there 
will be a collection for all these ItemOrders objects created by the customer. Lets create a class as 
Order which will hold a list of such ItemOrder objects. This Order class can be used by the 
Resaturant entity for calculating the total amount to be billed to the customer… right? So in essence, 
we have got three major classes to design the customer and his flow of orders, namely Customer, 
ItemOrder, Order. Lets see how these classes will look like. 
 
 
 
 
 
 
Remember, all setters and getters functions have been removed from these diagrams (except 
ItemOrder) to make it simple. 
 
Okay, another helper class we need. That is the bill class. It should have the functionality to calculate 
the total amount to be billed for a particular customer. 
 
 
 
With all these classes ready, lets design the complete class diagram of the Restaurant System. 
 
As you have probably guessed that a Restaurant ​HAS​ Tables and Restaurant ​HAS​ Menu. Menu 
HAS​ Item (rather items, a list of item). Restaurant has an ​ASSOCIATION​ with the Customer. The 
Bill stores a reference to a Customer for future use. Hence Bill has an ​AGGREGATION​ relationship 
with Customer. Each Customer creates an Order. Hence Customer ​HAS​ Order. And an Order holds 
a list of ItemOrders each representing and amount ordered for a particular Item. Hence Order ​HAS 
ItemOrder. Each ItemOrder keeps a reference of Item. Hence ItemOrder has an ​AGGREGATION 
relationship with Item. The Restaurant ​USEs​ Bill to calculate the total bill. 
 
And with this explanation, the complete class diagram will look as the following. 
 
 
 
Please note that the complete signatures of the operations are not given in the UML diagrams to 
make it simple. You can refer the respective class from the source code attached to have an idea of 
each operation. 
 
Let me  explain the UML in more detail. As you can see that Restaurant has a one­to­one HAS 
relationship with Menu and an one­to­many HAS relationship with the TABLE. This is quite 
obvious… right? Because a single Restaurant will have only one Menu list and it may have one to 
many number of TABLEs. The relationship of the Restaurant with the Customer is Association. 
Because a customer is an Independent entity. The Restaurant simply adds the new customer to its 
FIFO queue. As i have already mentioned, that a Customer HAS a Order (one­to­one relationship). 
Because whenever a customer plans to order, he needs to create an Order which he will populate 
with different ItemOrders(remember ItemOrder keeps a reference to an Item and how many plates 
the customer needs). As the ItemOrder keeps a reference to the Items, it obviously has an 
Aggregation relationship with the Item. A bill also has to keep a reference of the customer because it 
needs to identify for which customer the Bill has been generated. Hence the Bill also has an 
Aggregation relationship with Customer. The Restaurant has a USE relationship with the Bill 
because it creates the Bill object as a local variable in the generateBill function. Now probably you 
have acquired some sorts of idea about how this whole system has been designed using UML and 
OOAD. 
  
The code for this whole Restaurant System has been given below. It is, of course in accordance to 
this class diagram given earlier. 
 
The Restaurant Class: 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.ArrayDeque;
importjava.util.ArrayList;
importjava.util.Deque;
importjava.util.Iterator;
importjava.util.List;
importjava.util.Observer;
publicclassRestaurant{
publicstaticfinalintMAX_NUMBER_OF_TABLES=2;
privateList<Table>mTables;
//wheneveranewcustomercomesweaddhimtothefrontofthisqueue
privateDeque<Customer>mCustomerQueue;
privateList<Customer>customerServed;
privateMenumMenu;
privateList<Bill>billStore;
privatestaticRestaurantmResturantObject=null;
//privateCustomercurrentCustomer;
privateList<Customer>customerArray;
Employeecashier;
Employeereceptionist;
Employeewaiter;
privateRestaurant(){
receptionist=newReceptionist(1,"Rita");
waiter=newWaiter(10,"Shyam");
cashier=newCashier(100,"Ram");
mTables=newArrayList<Table>();
mMenu=newMenu();
billStore=newArrayList<Bill>();
mCustomerQueue=newArrayDeque<Customer>(5);
customerArray=newArrayList<Customer>();
customerServed=newArrayList<Customer>();
//currentCustomer=null;
for(inti=0;i<MAX_NUMBER_OF_TABLES;i++){
Tablet=newTable();
t.addObserver((Observer)receptionist);
mTables.add(t);
}
}
publicList<Table>getTables(){
returnmTables;
}
publicDeque<Customer>getCustomerQueue(){
returnmCustomerQueue;
}
publicvoidsetCustomerQueue(Deque<Customer>customerQueue){
this.mCustomerQueue=customerQueue;
}
publicMenugetMenu(){
returnmMenu;
}
publicvoidsetMenu(MenumMenu){
this.mMenu=mMenu;
}
//SingletonPattern
publicstaticRestaurantgetRestaurant(){
if(mResturantObject==null)
mResturantObject=newRestaurant();
returnmResturantObject;
}
publicCustomergetCustomer(intcustomerId){
Iteratorit=(Iterator)customerArray.iterator();
while(it.hasNext()){
Customerc=(Customer)it.next();
if(customerId==c.getCustomerId()){
returnc;
}
}
returnnull;
}
publicList<Bill>getBillStore(){
returnbillStore;
}
publicCashiergetCashier(){
return(Cashier)cashier;
}
publicList<Customer>getCustomerArray(){
returncustomerArray;
}
publicReceptionistgetReceptionist(){
return(Receptionist)receptionist;
}
publicWaitergetWaiter(){
return(Waiter)waiter;
}
publicvoidaddCustomerToTheServingArray(Customercustomer){
customerArray.add(customer);
}
publicvoidbookTable(inttableNumber){
mTables.get(tableNumber).bookTable();
}
publicvoidreleaseTable(inttableNumber){
mTables.get(tableNumber).releaseTable();
}
publicvoidaddNewBill(Billbill){
billStore.add(bill);
}
publicList<Customer>getCustomerServed(){
returncustomerServed;
}
publicvoidsetCustomerServed(List<Customer>customerServed){
this.customerServed=customerServed;
}
publicvoidsayGoodBye(Customercustomer){
customerArray.remove(customer);
}
}
 
The Customer Class 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.Random;
publicclassCustomer{
privateintmCustomerId;
privateOrdermOrder;
privateStringmCustomerName;
privateintallocatedTableId;
publicCustomer(){
Randomr=newRandom();
mCustomerId=r.nextInt(10000);//Arandomnumberbetween0&10000
mOrder=newOrder(mCustomerId);
//addObserver(Restaurant.getRestaurant());
}
/*publicCustomer(intcustomerId){
//mCustomerId=customerId;
mOrder=newOrder(customerId);
}*/
publicintgetCustomerId(){
returnmCustomerId;
}
/*publicvoidsetCustomerId(intmCustomerId){
this.mCustomerId=mCustomerId;
}*/
publicvoidgiveOrder(Itemitem,intnumberOfPlates){
//OrdernewOrder=newOrder(mCustomerId);
ItemOrdernewItemOrder=newItemOrder(item, numberOfPlates);
mOrder.addOrder(newItemOrder);
}
publicvoidiAmDone(){
}
publicOrdergetOrder(){
returnmOrder;
}
publicvoidsetOrder(OrdermOrder){
this.mOrder=mOrder;
}
publicStringgetCustomerName(){
returnmCustomerName;
}
publicvoidsetCustomerName(StringmCustomerName){
this.mCustomerName=mCustomerName;
}
publicCustomerfindCustomer(intid){
if(id==mCustomerId){
returnthis;
}
returnnull;
}
publicintgetAllocatedTableId(){
returnallocatedTableId;
}
publicvoidsetAllocatedTableId(intallocatedTableId){
this.allocatedTableId=allocatedTableId;
}
}
The Menu Class 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.ArrayList;
importjava.util.Iterator;
importjava.util.List;
publicclassMenu{
privateList<Item>mMenu;
publicMenu(){
mMenu=newArrayList<Item>();
mMenu.add(newItem(11,"Tea",5));
mMenu.add(newItem(22,"Coffee",10));
mMenu.add(newItem(33,"Bread",15));
}
publicList<Item>getMenu(){
returnmMenu;
}
publicvoiddisplay(){
inti=0;
Iterator<Item>it=mMenu.iterator();
while(it.hasNext()){
ItemcurrentItem=it.next();
System.out.println(i+": "+currentItem.getItemId()+" "+
currentItem.getItemName()+" "+currentItem.getItemPrice());
i++;
}
}
}
The Item Class 
 
packagecom.somitsolutions.training.java.restaurant;
publicclassItem{
privateintmItemId;
privateStringmName;
privatefloatmPrice;
publicItem(){
}
publicItem(intid,Stringname,floatprice){
mItemId=id;
mName=name;
mPrice=price;
}
publicintgetItemId(){
returnmItemId;
}
publicvoidsetItemId(intmItemId){
this.mItemId=mItemId;
}
publicStringgetItemName(){
returnmName;
}
publicvoidsetItemName(StringmName){
this.mName=mName;
}
publicfloatgetItemPrice(){
returnmPrice;
}
publicvoidsetItemPrice(floatmPrice){
this.mPrice=mPrice;
}
}
 
The ItemOrder Class 
packagecom.somitsolutions.training.java.restaurant;
publicclassItemOrder{
privateItemmItem;
privateintmNumberOfPlates;
publicItemOrder(){
mItem=null;
mNumberOfPlates=0;
}
publicItemOrder(Itemitem,intnumberOfPlates){
mItem=item;
mNumberOfPlates=numberOfPlates;
}
publicItemgetItem(){
returnmItem;
}
publicvoidsetItem(ItemmItem){
this.mItem=mItem;
}
publicintgetNumberOfPlates(){
returnmNumberOfPlates;
}
publicvoidsetNumberOfPlates(intmNumberOfPlates){
this.mNumberOfPlates=mNumberOfPlates;
}
}
The Order Class 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.ArrayList;
importjava.util.List;
publicclassOrder{
privateintmOrderId;//thisisthesameascustomerIdimagining
//thatonecustomerwillcreateonlyoneorder
privateList<ItemOrder>mItemOrder=newArrayList<ItemOrder>();
publicOrder(){
mOrderId=0;
//mItemOrder=null;
}
publicOrder(intorderId){
mOrderId=orderId;
}
publicList<ItemOrder>getItemOrder(){
returnmItemOrder;
}
publicvoidsetItemOrder(List<ItemOrder>mItemOrder){
this.mItemOrder=mItemOrder;
}
publicintgetOrderId(){
returnmOrderId;
}
publicvoidsetOrderId(intmOrderId){
this.mOrderId=mOrderId;
}
publicvoidaddOrder(ItemOrderitemOrder){
mItemOrder.add(itemOrder);
}
}
The Bill Class 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.Iterator;
publicclassBill{
//privateOrdermOrder;
privateintmBillId;//thisisthesameasorderId
privateCustomermCustomer;
publicBill(intId,Customercustomer){
mBillId=Id;
mCustomer=customer;
}
publicfloatcalculateTotal(){
floatretValue=0;
Iterator<ItemOrder>it=mCustomer.getOrder().getItemOrder().iterator();
while(it.hasNext()==true){
ItemOrderelement=it.next();
retValue+=(element.getItem().getItemPrice())*
(element.getNumberOfPlates());
}
returnretValue;
}
publicintgetBillId(){
returnmBillId;
}
publicvoidsetBillId(intmBillId){
this.mBillId=mBillId;
}
}
The Table Class 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.Observable;
publicclassTableextendsObservable{
privatebooleanmOccupied;
publicTable(){
mOccupied=false;
}
publicbooleanisOccupied(){
return
mOccupied==true;
}
publicvoidbookTable(){
mOccupied=true;
}
publicvoidreleaseTable(){
mOccupied=false;
setChanged();
notifyObservers();
}
}
 
The Receptionist Class 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.Iterator;
importjava.util.Observable;
importjava.util.Observer;
importjava.util.Scanner;
publicclassReceptionistextendsEmployeeimplementsObserver{
ScannermyScan=newScanner(System.in);
privateCustomercurrentCustomer;
privateCustomerlastCustomerServed;
publicReceptionist(){
currentCustomer=null;
}
publicReceptionist(intempId,Stringname){
super(empId,name);
currentCustomer=null;
}
publicbooleanisAnyTableOccupied(){
for(inti=0;i<Restaurant.getRestaurant().MAX_NUMBER_OF_TABLES;i++){
if(Restaurant.getRestaurant().getTables().get(i).isOccupied()==
true){
returntrue;
}
}
returnfalse;
}
publicintfindTheEmptyTable(){
for(inti=0;i<Restaurant.getRestaurant().MAX_NUMBER_OF_TABLES;i++){
if(Restaurant.getRestaurant().getTables().get(i).isOccupied()==
false){
returni;
}
}
return-1;
}
publicvoiddisplayOccupiedTable(){
for(inti=0;i<Restaurant.getRestaurant().MAX_NUMBER_OF_TABLES;i++){
if(Restaurant.getRestaurant().getTables().get(i).isOccupied()==true){
System.out.println("TableNo."+i+"isoccupied");
}
}
}
publicbooleanisAllTableOccupied(){
intval=findTheEmptyTable();
if(val==-1){
returntrue;
}
else{
returnfalse;
}
}
publicvoidbookATable(){
if(isAllTableOccupied()==false){
inttableNumber=findTheEmptyTable();
//getthecustomerfromthelistintheFIFOorder
//andremovehimfromthequeue
if(!Restaurant.getRestaurant().getCustomerQueue().isEmpty()){
currentCustomer=
Restaurant.getRestaurant().getCustomerQueue().pollLast();
currentCustomer.setAllocatedTableId(tableNumber);
Restaurant.getRestaurant().addCustomerToTheServingArray(currentC
ustomer);
Restaurant.getRestaurant().bookTable(tableNumber);
System.out.println(currentCustomer.getCustomerName()+"has
beengiventablenumber:"+tableNumber);
}
}
}
publicvoidaddNewCustomer(Customercustomer){
Restaurant.getRestaurant().getCustomerQueue().offerFirst(customer);
}
@Override
publicvoidupdate(Observableo,Objectarg){
//TODOAuto-generatedmethodstub
//System.out.println(Restaurant.getRestaurant().getCustomerQueue().pollLast().getCustomerNa
me());
if(!Restaurant.getRestaurant().getCustomerQueue().isEmpty()){
bookATable();
}
}
publicCustomergetCurrentCustomer(){
returncurrentCustomer;
}
publicvoidsetCurrentCustomer(CustomercurrentCustomer){
this.currentCustomer=currentCustomer;
}
publicCustomercreateNewCustomer(){
Customercustomer=newCustomer();
//System.out.println(customer.getCustomerId());
System.out.println("Pleaseentercustomername...");
StringcustomerName=myScan.nextLine();
customer.setCustomerName(customerName);
addNewCustomer(customer);
returncustomer;
}
publicvoidsayGoodBye(Customercustomer){
Restaurant.getRestaurant().getCustomerArray().remove(customer);
Restaurant.getRestaurant().getCustomerServed().add(customer);
}
publicCustomergetLastCustomerServed(){
returnlastCustomerServed;
}
publicvoidsetLastCustomerServed(CustomerlastCustomerServed){
this.lastCustomerServed=lastCustomerServed;
}
} 
 
The Waiter Class 
 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.Iterator;
publicclassWaiterextendsEmployee{
publicWaiter(){
}
publicWaiter(intempId,Stringname){
super(empId,name);
}
publicvoiddisplayMenu(){
Restaurant.getRestaurant().getMenu().display();
}
publicvoidreleaseTable(inttableId){
if(Restaurant.getRestaurant().getTables().get(tableId).isOccupied()==true){
Iteratorit=Restaurant.getRestaurant().getCustomerArray().iterator();
while(it.hasNext()){
Customerc=(Customer)it.next();
if(tableId==c.getAllocatedTableId()){
Restaurant.getRestaurant().getReceptionist().setLastCustomerServed(c);
}
}
Restaurant.getRestaurant().releaseTable(tableId);
}
if((Restaurant.getRestaurant().getCustomerQueue().isEmpty()==false)||
(Restaurant.getRestaurant().getReceptionist().isAnyTableOccupied()==true)){
System.out.println("Therearestillsomecustomers...");
/**/
}
if((Restaurant.getRestaurant().getCustomerQueue().isEmpty()==true)&&
(Restaurant.getRestaurant().getReceptionist().isAnyTableOccupied()==false)){
System.out.println("Allserved...");
Restaurant.getRestaurant().getCustomerArray().clear();
}
}
} 
 
 
The Casher Class 
 
packagecom.somitsolutions.training.java.restaurant;
publicclassCashierextendsEmployee{
publicCashier(){
}
publicCashier(intempId,Stringname){
super(empId,name);
}
publicvoidgenerateBill(Customercustomer){
//Customercustomer=Restaurant.getRestaurant().getCustomer(customer);
//System.out.println(customer.getCustomerName());
BillnewBill=newBill(customer.getCustomerId(),customer);
Restaurant.getRestaurant().addNewBill(newBill);
System.out.println("TotalAmountforCustomer:"+customer.getCustomerName()
+"is"+newBill.calculateTotal());
}
publicvoidsayGoodBye(Customercustomer){
//CustomercustomerToBeRemoved=
Restaurant.getRestaurant().getCustomer(customerId);
Restaurant.getRestaurant().getReceptionist().sayGoodBye(customer);
}
}
 
The Main RestaurantSystem Class 
packagecom.somitsolutions.training.java.restaurant;
importjava.util.Scanner;
publicclassRestaurantSystem{
publicstaticvoidmain(String[]args){
ScannermyScan=newScanner(System.in);
Strings="Y";
Restaurantrestaurant=Restaurant.getRestaurant();
do{
inttableId=0;
//intcustomerId=0;
Customercustomer=null;
System.out.println("Isthereanewcustomer?");
Stringans=myScan.nextLine();
if(ans.equalsIgnoreCase("Y")){
customer=
restaurant.getReceptionist().createNewCustomer();
System.out.println(customer.getCustomerId());
if(restaurant.getReceptionist().isAllTableOccupied()==
false){
restaurant.getReceptionist().bookATable();
restaurant.getWaiter().displayMenu();
System.out.println("ChooseMenufromtheabove
List");
System.out.println("Howmanyitemsdoyouwantto
order?");
intnumber_of_items=myScan.nextInt();
for(inti=0;i<number_of_items;i++){
System.out.println("Choosefromthenumbers
attheleftmostposition");
intitem_position=myScan.nextInt();
System.out.println("Howmanyplatesofmenu
item"+item_position+"youwanttoorder");
intnumber_of_plates=myScan.nextInt();
if(i==number_of_items-1){
myScan.nextLine();
}
Itemitem=
restaurant.getMenu().getMenu().get(item_position);
customer.giveOrder(item,number_of_plates);
}
}
else{
System.out.println("Sorryalltablesare
occupied...Pleasewait...");
System.out.println("Hasanybodyfinished?");
System.out.println("Occupiedtablesare:");
restaurant.getReceptionist().displayOccupiedTable();
System.out.println("EntertheTablenumber.Enter
-9ifnoonehasfinished...");
tableId=Integer.parseInt(myScan.nextLine());
if(tableId!=-9){
//System.out.println()
restaurant.getWaiter().releaseTable(tableId);
CustomercustomerJustServed=
Restaurant.getRestaurant().getReceptionist().getLastCustomerServed();
System.out.println(customerJustServed.getCustomerName());
System.out.println(customerJustServed.getCustomerId());
restaurant.getCashier().generateBill(customerJustServed);
restaurant.getCashier().sayGoodBye(customerJustServed);
restaurant.getWaiter().displayMenu();
System.out.println("ChooseMenufromthe
aboveList");
System.out.println("Howmanyitemsdoyou
wanttoorder?");
intnumber_of_items=myScan.nextInt();
for(inti=0;i<number_of_items;i++){
System.out.println("Choosefromthe
numbersattheleftmostposition");
intitem_position=myScan.nextInt();
System.out.println("Howmanyplates
ofmenuitem"+item_position+"youwanttoorder");
intnumber_of_plates=
myScan.nextInt();
if(i==number_of_items-1){
myScan.nextLine();
}
Itemitem=
restaurant.getMenu().getMenu().get(item_position);
Customercurrent=
restaurant.getReceptionist().getCurrentCustomer();
System.out.println(current.getCustomerName());
//System.out.println(current.getCustomerName());
current.giveOrder(item,
number_of_plates);
}
}
else{
continue;
}
}
}
else{
if(restaurant.getReceptionist().isAnyTableOccupied()==
true){
//System.out.println("Therearestillsomecustomers");
System.out.println("Hasanybodyfinished?");
System.out.println("Enterthetablenumber.Enter-9if
noonehasfinished...");
System.out.println("Occupiedtablesare:");
restaurant.getReceptionist().displayOccupiedTable();
intnumberTable=myScan.nextInt();
myScan.nextLine();
if(numberTable!=-9){
restaurant.getWaiter().releaseTable(numberTable);
CustomercustomerJustServed=
Restaurant.getRestaurant().getReceptionist().getLastCustomerServed();
restaurant.getCashier().generateBill(customerJustServed);
restaurant.getCashier().sayGoodBye(customerJustServed);
if(restaurant.getReceptionist().isAllTableOccupied()==false){
continue;
}
restaurant.getWaiter().displayMenu();
System.out.println("ChooseMenufromtheabove
List");
System.out.println("Howmanyitemsdoyouwantto
order?");
intnumber_of_items=myScan.nextInt();
for(inti=0;i<number_of_items;i++){
System.out.println("Choosefromthenumbers
attheleftmostposition");
intitem_position=myScan.nextInt();
System.out.println("Howmanyplatesofmenu
item"+item_position+"youwanttoorder");
intnumber_of_plates=myScan.nextInt();
if(i==number_of_items-1){
myScan.nextLine();
}
Itemitem=
restaurant.getMenu().getMenu().get(item_position);
Customercurrent=
restaurant.getReceptionist().getCurrentCustomer();
//System.out.println(current.getCustomerName());
current.giveOrder(item,number_of_plates);
}
////////////////
}
else{
continue;
}
}
}
System.out.println("Doyouwanttocontinue?");
s=myScan.nextLine();
if(s.equalsIgnoreCase("N")){
System.exit(0);
}
}while(s.equalsIgnoreCase("Y"));
}
}
The Sequence Diagram 
 
The Designing of a Software System from scratch with the help of OOAD & UML - A Restaurant System
 
 
 
 
 
 
 
 
 
 
 
 
 
 

More Related Content

PPTX
Evaluation5
PPTX
Evaluation question Six
DOCX
Atm proposal in oop
PDF
Working together
PDF
Introduction to UML
PDF
Final pre 5
PDF
Start learning code with an idea
PDF
It is difficult
Evaluation5
Evaluation question Six
Atm proposal in oop
Working together
Introduction to UML
Final pre 5
Start learning code with an idea
It is difficult

Similar to The Designing of a Software System from scratch with the help of OOAD & UML - A Restaurant System (20)

DOCX
Introduction to web design
PDF
502 Object Oriented Analysis and Design.pdf
PDF
On Selecting JavaScript Frameworks (Women Who Code 10/15)
DOCX
Java Design Pattern Interview Questions
PDF
Purpose Before Action: Why you need a Design Language System
PPTX
What have you learnt about technologies from the
PPT
Media a2 ict
PDF
Boost Your Base Bootcamp - [Online & Offline] In Bangla
PDF
Is Robotic Process Automation changing the Test Automation.pdf
DOCX
Top 10 Interview Questions for Coding Job.docx
DOCX
Top 10 Interview Questions for Coding Job.docx
PPT
Ood and solid principles
PPTX
Northwoods Roasterie & Coffee Shop App Design (1).pptx
ODP
Geecon10: Object Oriented for nonbelievers
PPTX
TemplateToaster A perfect Web Design software
PPTX
Question 6
PPTX
Atomic Design: Effective Way of Designing UI
PDF
OOP Java
PDF
Advanced java script essentials v1
PDF
Automation testing: how tools are important?
Introduction to web design
502 Object Oriented Analysis and Design.pdf
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Java Design Pattern Interview Questions
Purpose Before Action: Why you need a Design Language System
What have you learnt about technologies from the
Media a2 ict
Boost Your Base Bootcamp - [Online & Offline] In Bangla
Is Robotic Process Automation changing the Test Automation.pdf
Top 10 Interview Questions for Coding Job.docx
Top 10 Interview Questions for Coding Job.docx
Ood and solid principles
Northwoods Roasterie & Coffee Shop App Design (1).pptx
Geecon10: Object Oriented for nonbelievers
TemplateToaster A perfect Web Design software
Question 6
Atomic Design: Effective Way of Designing UI
OOP Java
Advanced java script essentials v1
Automation testing: how tools are important?
Ad

More from Somenath Mukhopadhyay (20)

PDF
Significance of private inheritance in C++...
PDF
Arranging the words of a text lexicographically trie
PDF
Generic asynchronous HTTP utility for android
PDF
Copy on write
PDF
Java concurrency model - The Future Task
PDF
Memory layout in C++ vis a-vis polymorphism and padding bits
PDF
Developing an Android REST client to determine POI using asynctask and integr...
PDF
Observer pattern
PDF
Uml training
PDF
How to create your own background for google docs
PDF
Structural Relationship between Content Resolver and Content Provider of Andr...
PDF
Flow of events during Media Player creation in Android
PDF
Implementation of a state machine for a longrunning background task in androi...
PDF
Tackling circular dependency in Java
PDF
Implementation of composite design pattern in android view and widgets
PDF
Exception Handling in the C++ Constructor
PDF
Active object of Symbian in the lights of client server architecture
PDF
Android services internals
PDF
Android Asynctask Internals vis-a-vis half-sync half-async design pattern
PDF
Composite Pattern
Significance of private inheritance in C++...
Arranging the words of a text lexicographically trie
Generic asynchronous HTTP utility for android
Copy on write
Java concurrency model - The Future Task
Memory layout in C++ vis a-vis polymorphism and padding bits
Developing an Android REST client to determine POI using asynctask and integr...
Observer pattern
Uml training
How to create your own background for google docs
Structural Relationship between Content Resolver and Content Provider of Andr...
Flow of events during Media Player creation in Android
Implementation of a state machine for a longrunning background task in androi...
Tackling circular dependency in Java
Implementation of composite design pattern in android view and widgets
Exception Handling in the C++ Constructor
Active object of Symbian in the lights of client server architecture
Android services internals
Android Asynctask Internals vis-a-vis half-sync half-async design pattern
Composite Pattern
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PPTX
ai tools demonstartion for schools and inter college
PDF
Digital Strategies for Manufacturing Companies
PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Understanding Forklifts - TECH EHS Solution
PDF
top salesforce developer skills in 2025.pdf
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
history of c programming in notes for students .pptx
PDF
medical staffing services at VALiNTRY
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
L1 - Introduction to python Backend.pptx
ai tools demonstartion for schools and inter college
Digital Strategies for Manufacturing Companies
Odoo POS Development Services by CandidRoot Solutions
CHAPTER 2 - PM Management and IT Context
PTS Company Brochure 2025 (1).pdf.......
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Nekopoi APK 2025 free lastest update
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Design an Analysis of Algorithms II-SECS-1021-03
Understanding Forklifts - TECH EHS Solution
top salesforce developer skills in 2025.pdf
Internet Downloader Manager (IDM) Crack 6.42 Build 41
2025 Textile ERP Trends: SAP, Odoo & Oracle
Design an Analysis of Algorithms I-SECS-1021-03
history of c programming in notes for students .pptx
medical staffing services at VALiNTRY
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx

The Designing of a Software System from scratch with the help of OOAD & UML - A Restaurant System