【正文】
n go if exists (select 1 from sysindexes where id = object_id(39。) and type = 39。 and indid 0 基于 UML 的圖書館管理系統(tǒng)建模設(shè)計 16 and indid 255) drop index _FK go if exists (select 1 from sysobjects where id = object_id(39。) and name = 39。) alter table reversation drop constraint FK_REVERSAT_REVERSATI_READER go if exists (select 1 from sysindexes where id = object_id(39。) and = 39。) where = object_id(39。) alter table reversation drop constraint FK_REVERSAT_REVERSATI_BOOKS go if exists (select 1 from r join o on ( = and = 39。) and = 39。) where = object_id(39。) alter table login drop constraint FK_LOGIN_LOGIN2_READER go if exists (select 1 from r join o on ( = and = 39。) and = 39。) where = object_id(39。) alter table login drop constraint FK_LOGIN_LOGIN_ADMIN go if exists (select 1 from r join o on ( = and = 39。) and = 39。) where = object_id(39。) alter table borrow_information drop constraint FK_BORROW_I_BORROW_IN_READER go if exists (select 1 from r join o on ( = and = 39。) and = 39。) where = object_id(39。) alter table borrow_information drop constraint FK_BORROW_I_BORROW_IN_BOOKS go if exists (select 1 from r join o on ( = and = 39。) and = 39。) where = object_id(39。) alter table books drop constraint FK_BOOKS_管理書籍_ADMIN go if exists (select 1 from r join o on ( = and = 39。) and = 39。) where = object_id(39。 15 附:由 PDM 對象自動生成的數(shù)據(jù)庫腳本文件代碼如下 :if exists (select 1 from r join o on ( = and = 39。 TimeDate amp。 TimeIntegerDate amp。 TimeIntegerIntegerMIdentifier_1 pireaderreader_idreader_namesexageclassaddressmemomaxborrowedreader_passwordrightpi IntegerCharacters (20)Characters (2)Byte (100)Characters (15)TextTextIntegerCharacters (16)IntegerMIdentifier_1 piborrow_informationborrow_timeend_timeamountreturn_time...Date amp。 圖書管理系統(tǒng)個實(shí)體之間的 ER 圖 圖 12:圖書館管理系統(tǒng)各實(shí)體之間的 ER 圖 基于 powerdesigner 的 CDM 數(shù)據(jù)庫模型 ( 1)數(shù)據(jù)庫 概念數(shù)據(jù)模型 CDM 對 象 如下圖 ,該圖顯示了各實(shí)體的屬性及各實(shí)體之間的關(guān)系。 ( 3)書籍表 books:書籍編號( book_id) ,書名( title),作者( author), 出版社( book concert) ,價格( price),出版時間( time),在庫總量( amount),剩余量( remain)。 、數(shù)據(jù)庫概念設(shè)計 數(shù)據(jù)庫表設(shè)計 (1) 管理員表 admin:管理員編號( admin_id) ,管理員姓名( admin_name) ,密碼( admin_password) ,登錄次數(shù)( logins),最后一次登錄時間( lastlogin)和權(quán)限( right)。 基于 UML 的圖書館管理系統(tǒng)建模設(shè)計 12 圖 11:圖書館管理系統(tǒng)的類圖 及關(guān)系 五、 圖書館管理系統(tǒng) 數(shù)據(jù) 庫建模 考慮到系統(tǒng)的推廣性,本系統(tǒng)采用 SQL SERVER2020 作為數(shù)據(jù)庫。 ( 6) Reservation 類是預(yù)訂信息類,每個預(yù)訂信息包括預(yù)訂日期( date)、所預(yù)訂書籍的ISBN、預(yù)訂書籍的用戶 ID( UserID)等屬性。操作包括預(yù)訂( reserve)、按書目查找( find_on_title)等。 ( 3) Title 類是記錄書目信息的類,包括書籍的名字( name)、作者( author)、 book_id等屬性。其 中主要操作有借書( addborrowed)和還書 (deleteborrowed)和預(yù)訂(reservation)等 。 基于 UML 的圖書館管理系統(tǒng)建模設(shè)計 10 圖 9:圖書館管理系統(tǒng)的還書活動 圖 預(yù)訂圖書活動圖 【預(yù)訂書籍活動圖說明】 讀者先進(jìn)入系統(tǒng)查詢自己所需要的書籍,顯示書籍信息,檢驗(yàn)書籍是否屬于可預(yù)訂書籍,若符合條件則檢查書籍是否已經(jīng)被預(yù)訂或已經(jīng)被外借,若都未成立,則讀者登錄系統(tǒng),并對該書籍進(jìn)行預(yù)訂。在這些條件都符合時則更新書籍 信息和讀者的借閱信息,記錄好借書的時間。 【借書活動圖說明】 管理員首先要掃描讀者的 借書證,檢驗(yàn)證件是否符合圖書館借書條件,若該讀者的借書數(shù)量還未達(dá)到最大規(guī)定數(shù)量,并且其所借書籍均未屬于過期范圍,則符合借書條件。 基于 UML 的圖書館管理系統(tǒng)建模設(shè)計 8 圖 7:圖書館的書籍狀態(tài)圖 、系統(tǒng)的活動圖 活動圖描述的是某流程中的任務(wù)的執(zhí)行,活動圖描述活動是如何協(xié)同工作的,當(dāng)一個操作必須完成一系列事情,而又無法確定以什么樣的順序來完成這些事情時,活動圖可以更清晰地描述這些事情。借閱者在規(guī)定的預(yù)訂時間內(nèi)也可以考慮取消預(yù)訂,取消預(yù)訂后書籍的狀