Cappuccino
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ## 第 2 章 資料庫設計   設計階段之資料庫,根據分析文件之實體關係圖(Entity-Relation Diagram),進行確認並依據其規劃資料庫之資料表,共計包含 3 個實體(Entity)、2 個關係(Relationship)、0 個複合性實體(Compound Entity),下圖(圖 1)為設計階段之 ER 圖,亦可使用資料庫綱要圖(Schema Diagram)進行取代: ![](https://i.imgur.com/iEKrNtx.jpg) *圖1設計階段實體關係圖* 根據上圖進行資料表之設計,以下將逐一說明資料庫每張資料表之欄位, 本範例由於僅實作後台管理者會員模組,因此資料表僅就會員與商品進行呈 現,實際上仍需將所有資料表呈現於此: :::info 會員或管理員資料表 :分析階段之會員或管理員資料表(members)的資料結構 ::: | Key | 名稱 | 類型 | 預設值 | 空值 | 自動增加 | 編碼 | | --------- | --------- | ------------ | ------ | ---- | -------- | ------------------ | | P.K./F.K. | id | Int | 無 | 否 | V | | | | name | Varchar(20) | 無 | 否 | | utf8mb4_0900_ai_ci | | | email | Varchar(100) | 無 | 否 | | utf8mb4_0900_ai_ci | | | password | Varchar(20) | 無 | 否 | | utf8mb4_0900_ai_ci | | | isManager | Boolean | 無 | 否 | | | * id:為自動增加作為會員編號,不可更動由資料庫系統自動產生。 * isManager : 為一布林值,標示是否為管理者 :::info 書籍資料表 :分析階段之書籍資料表(products)的資料結構 ::: | Key | 名稱 | 類型 | 預設值 | 空值 | 自動增加 | 編碼 | | | --------- | ----------- | ------------ | ------ | ---- | -------- | ------------------ | --- | | P.K./F.K. | id | Int | 無 | 否 | V | | | | | receiptID | Int | 無 | 否 | | | | | | name | Varchar(20) | 無 | 否 | | utf8mb4_0900_ai_ci | | | | rented | Boolean | 0 | 否 | | | | | | description | Varchar(100) | 無 | 否 | | utf8mb4_0900_ai_ci | | | | image | Varchar(100) | 無 | 否 | | utf8mb4_0900_ai_ci | | * id:為自動增加作為書本編號,不可更動由資料庫系統自動產生 * image:用於紀錄書本封面之路徑位置。 :::info 借據資料表 :分析階段之借據資料表(receipt)的資料結構 ::: | key | 名稱 | 類型 | 預設值 | 空值 | 自動增加 | 編碼 | | ---- | ----------- | -------- | ------ | ---- | -------- | ---- | | P.K. | id | Int | 無 | 否 | V | | | F.K. | memberID | Int | 無 | 否 | | | | | createdTime | Datetime | 無 | 否 | | | * id:為自動增加作為商品編號,不可更動由資料庫系統自動產生。 * createdTime:用於記錄借據產生時間。 --- ## 第 3 章 類別圖 下圖(圖 2、圖 3、圖 4)係依據圖書館線上系統的分析模型和建立的互動圖,以及實體關係圖(Entity-Relation Diagram)所繪製之設計階段之類別圖(Class Diagram),用於描述系統的類別集合,包含其中之屬性,與類別之間的關係。本階段之類別圖 屬於細部(detail)之設計圖 ,與上一份文件分析階段之類別圖需要有詳細之變數型態、所擁有之方法,依據這些設計原則,本類別圖之說明如下所列:類別圖除包含與資料庫相對應之物件外,亦包含相關之控制物件(controller)、DBMgr 與各功能相對應資料庫操作類別(例如:MemberHelper)和相對應之類別工具(JsonReader)。 ![](https://i.imgur.com/ragLSaR.png) *圖二:類別圖(1/2)* ![](https://i.imgur.com/yD0WTuW.png) *圖三:類別圖(2/2)* --- ## 第 4 章 系統循序圖 本章節主要依照第一份文件需求所產生之使用案例圖(use case)與第二份 文件分析之邏輯階段活動圖與強韌圖為基礎,進行設計階段之循序圖設計,將 每個使用案例進行闡述。於此階段,需要有明確之類別(class)名稱與呼叫之 方法(method)與傳入之變數名稱與型態等細部設計之內容。 ### 4.1 使用案例圖 依據第一份文件針對專案之需求進行確定,本圖書館線上系統預計共有 4 位動作者與 26 個使用案例,並依照不同之模組區分成不同子系統共計七個子系統,其中包含以下:1 會員子系統、2 書籍資訊子系統、3 預訂書籍子系統、4 借出書籍子系統、5 借據管理子系統、6 書籍管理子系統、7 管理者子系統、8 歸還書籍子系統,如下圖(圖 5)所示 ![](https://i.imgur.com/NXeq7Ko.png) *圖五:葡萄王俊益菌王 圖書館系統使用案例圖* ### 4.2 Use Case 實做之循序圖 #### 4.2.1.1 Sequence Diagram—Use Case 1.1 會員註冊(管理者) ![](https://i.imgur.com/EuAlMXV.jpg) *圖六:商業流程編號 1.1 會員註冊(管理者)循序圖* 1. 管理員完成「7.1 管理者登入」後,進入註冊頁面(register.html)。 2. 當管理者完成表單之填寫並通過前端之資料驗證後,透過 JavaScript 之submit()送出 POST 請求。 3. 後端以 MemberController 之 doPost()進行處理,以 JsonReader 取回 request之參數,使用 MemberHelper 物件之 checkDuplicate()方法檢查該會員是否重複,若無則以 create()新增該名會員資料至資料庫當中。 4. 若重複則直接回傳重複之錯誤訊息。 5. 回傳註冊之結果後,若註冊成功則透過 JavaScript 之 updateSQLTable()更新SQL 表格內之內容。 #### 4.2.1.4 Sequence Diagram—Use Case 6.3 刪除書籍(管理者) ![](https://i.imgur.com/SOdOjNg.png) *圖七:商業流程編號 6.3 刪除書籍(管理者)循序圖* 1. 管理員完成商業流程編號「7.1 管理者登入」後,點擊進入書籍頁面(book.html)。 2. 針對所欲刪除之會員點擊刪除之按鈕,JavaScript 之 deleteBook()發送DELETE 之請求。 3. 後端以 BookController 之 doDelete()進行處理,以 JsonReader 取得該參數後,透過 MemberHelper 物件的 deletByID()方法將資料庫之書籍進行刪除。 4. 若刪除成功則透過 JavaScript 之 getAllBook()再次執行商業流程編號「2.1瀏覽書籍」之循序圖過程。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully