object - cccnqu/se107a GitHub Wiki

物件導向

Function-Oriented => Data-Oriented

Object-Oriented

  1. 封裝: Data Encapsulation
  2. 繼承: Inheritance
  3. 多型: Polymorphism

Object-Oriented Analysis

  1. 寫下《使用案例》描述 (Use Case)
  2. 尋找其中的
    • 名詞 nouns => 物件 classes
    • 形容詞 adjectives => 屬性 attributes
    • 動詞 verbs => 函數 operations

範例: User can add more than one item on sale at a time to a shopping cart * classes : user, item, shopping cart *

範例: 課程管理系統 Course management system 描述:https://www.udacity.com/wiki/ud175/class-diagram

  1. The Registration Manager set up the curriculum (課程) for a semaster using a schdeuling algorithm
  2. One course may have multiple course offerings
  3. Each course offering has a number, location and time
  4. Students select 4 primary courses and 2 alternative courses by submitting a registration form
  5. Students may use the system to add/drop courses for a period of time after registration
  6. Professors use the system to receive their course offering rosters (執勤表)
  7. User of the registration system are assigend passwords which are used at logon validation