旅店管理系統中clerk的詳細描述 (轉)
在“旅店管理中的類的概述”完成之後,我又仔細的審查了自己關於各個類的定義,我發現自己竟不知不覺地走入了(Enterprise Bean)的範疇,從我在前文中定義的概念可以看出其中房間資訊,預定資訊以及租用資訊屬於EJB中的實體Bean(確切地說應該是實體Bean中的Bean類我將它稱之為實體類),而管理人員和旅店服務人員應該是EJB中的會話Bean中的Bean類(我在這把它叫做會話類)。(另外查詢資訊,是一個沒有很好地解釋的類,正像前面說得那樣,這個類的存在與否是一個問題所在。)我不知道別人在實際的實際過程中會不會出現這樣的情況,是我感到疑問的是在沒有出現EJB之前,設計者在分析設計的過程中也會得到這樣的結果嗎?如果是這樣的話,EJB這種概念應該是在java出現之前就應該出現,是不是像我說得這樣呢?希望那位知道的讀者告訴我關於OO的設計過程中是不是很早就提出了這種對於的分類。
而如果情況真的如我分析的那樣的話,我們在實體類中就沒有過多的內容要詳細描述(可能會在的定義之後進行詳細地描述),因為實體Bean的作用主要是想JC或者其他一些後端的經常訪問的資料提供一個物件導向的介面,也就是說實體類其實是對資料庫的內容在程式中的一種體現。當然我們在具體實現的過程中可能會使用特殊的處理手段,比如將某欄位作為物件單獨處理等。我在下面只是簡單得給這些類(本以為這些內容會以介面的形式存在,從而便與支援,不想不知不覺走入了EJB的範疇,)一個名字以供下面的內容使用。
1、房間資訊:RoomInfo
2、預定資訊:ReserveInfo
3、租用資訊:RentInfo
接著我們來處理一下旅店服務員這個主要的會話物件的主要幾個功能,並把它們定義成旅店服務員的方法(關於管理員的查詢以後再作補充)。
我們先為旅店服務員著個類起名為HostelClerk,一下是HotelClerk類的主要部分(沒有提供對於會話Bean介面的實現)。
import java.util.*;
/*
* Created on -7-28
*/
/**
* This class is used in Hostel MIS. It is the class which implements
* room renting, reserving, check out and other main function.
*
* @author idilent
*/
public class HostelClerk {
/**
* This method is used to get the available rooms when the clerk
* reserves or rents room for the custommer.
*
* @param roomPrice the price of the room
* @param fromDate the date from which the room will be rented
* @param toDate the date to which the room will be rented
* @return the available rooms.
*
* there may be should a class call SearchCondition which encapsulates
* the search conditions
*
*/
public RoomInfo[] availableRooms(Currency roomPrice,Date fromDate,Date toDate){
return null;
}
/**
* This method is used to rent a room,since the availableRooms method had to be
* called before this function(else you will have no a of which room is availble
* to rent), so we can get a roomID fothe RoomInfo[] which is the result of
* availableRooms method.
*
* @param roomID the roomID is the primary key of the room information
* @param fromDate the date from which the room will be rented
* @param toDate the date to which the room will be rented
* @param customerName the customer's name, there should be other information of
* the customer. Maybe a class which supports the customer infor is needed.
*/
public void rentRoom(int roomID, Date fromDate, Date toDate, String customerName){
}
/**
* This method is used to reserve a room,since the availableRooms method had to be
* called before this function(else you will have no idea of which room is availble
* to rent), so we can get a roomID form the RoomInfo[] which is the result of
* availableRooms method.
*
* @param roomID the roomID is the primary key of the room information
* @param fromDate the date from which the room will be rented
* @param toDate the date to which the room will be rented
* @param customerName the customer's name, there should be other information of
* the customer. Maybe a class which supports the customer infor is needed.
*/
public void reserveRoom(int roomID,Date fromDate, Date toDate ,String customerName){
}
/**
*
* used to cancel reservation, if the customer remebered the reserveInID.
*
* @param reserveInfoID the primary key of reserveInfo.
*/
public void cancelReservation(int reserveInfoID){
}
/**
* used to cancel reservation when the customer forget the reserveInfoID
* Of course he should remeber his name though he could forget anything.
*
* @param customName supports the search the reserveInfo which should be canceled.
*/
public void cancelReservation(String customName){
}
/**
* used to check out.
*
* @param RoomID the roomInfo primary key
*
* Do you think there should be another version of the checkOut?
* maybe, but I think the roomID is always available. It may be the room's key name.
*/
public void checkOut(int RoomID){
}
}
好了,這個旅店系統的開發文件就在這裡告一段落。其中內容必然讓所有的人大失所望。但是這也不是我希望的結果。無論如何,謝謝大家。
版權所有:idilent 網站轉載請註明作者 其他轉載方式請與作者聯絡(to:idilent@.com.cn">idilent@yahoo.com.cn)。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10748419/viewspace-960971/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 請詳細描述AJAX的工作原理
- MongoDB分片群集的部署(用心描述,詳細易懂)!!MongoDB
- servlet的url-pattern匹配規則詳細描述Servlet
- 作業系統中的描述符和GDT作業系統
- sql如何最佳化的,詳細描述一下?SQL
- 詳述盒子模型(包含padding、border、margin的詳細用法和描述)模型padding
- 主機管理系統ZKEYS資源池授權詳細流程
- Linux系統中的/etc/shadow檔案超詳細內容解析Linux
- 【作業系統】 第二章 程式管理 程式的描述與控制作業系統
- SQL中的case when then else end用法 【詳細】轉載SQL
- [轉載] Python中協程的詳細用法和例子Python
- 分散式監控系統ganglia的詳細配置分散式
- 第四章 資訊系統管理 (2024年詳細解析版)
- WindowsPE重灌Windows系統詳細介紹Windows
- Ubuntu系統安裝 PostgreSQL詳細教程。UbuntuSQL
- Ubuntu系統安裝Docker詳細教程UbuntuDocker
- Linux系統安裝MySQL詳細教程LinuxMySql
- Linux系統安裝gcc詳細教程。LinuxGC
- Ubuntu系統硬碟掛載詳細教程。Ubuntu硬碟
- Linux系統管理命令二(轉)Linux
- Linux中目標與檔案的編輯管理(詳細)Linux
- 轉 Git使用詳細教程Git
- Linux系統Docker最佳化詳細教程。LinuxDocker
- Ctyun系統升級OpenSSH 9.3詳細教程
- Ubuntu 20.04系統安裝Carla詳細教程。Ubuntu
- ESXI 6.7 系統安裝詳細過程
- monterey系統怎麼降級?macOS Monterey系統降回Big Sur的詳細教程Mac
- 作業系統3——程式的描述與控制作業系統
- 詳談分散式系統快取的設計細節分散式快取
- 在Linux系統裡安裝VirtualBox的詳細步驟Linux
- mac裝win10雙系統的詳細過程MacWin10
- Mac系統隱藏dock欄的詳細操作步驟?Mac
- 【轉】Python之Numpy詳細教程Python
- Centos 7系統安裝python 3.9.10詳細教程。CentOSPython
- Ubuntu22系統安裝OpenJDK詳細教程。UbuntuJDK
- Linux系統PHP效能最佳化詳細教程。LinuxPHP
- Linux系統Memcached效能最佳化詳細教程。Linux
- Linux系統Redis效能最佳化詳細教程。LinuxRedis
- IDC主機系統詳細對比評測