WebDynpro 應用開發需遵循統一命名規範,確保程式碼可讀性、可維護性與團隊協作效率。本文整理核心物件命名慣例,並保留原始圖示參考。
XML, HTTP),但在 PascalCase 中僅首字母大寫 (如 XmlParser, HttpClient)。_ 分隔單字 (保留給常數 UPPER_SNAKE_CASE)。| 物件類型 | 命名模式 | 範例 |
|---|---|---|
| Component (元件) | [BusinessArea]Component | EmployeeComponent |
| Controller (控制器) | [ViewName]Controller | ListController, DetailController |
| View (視圖) | [Entity][Action]View | EmployeeListView, EmployeeDetailView |
| Window (視窗) | [BusinessArea]Window | EmployeeWindow |
| Context Node (上下文節點) | 單數實體名 | Employee, Department |
| Context Attribute (屬性) | camelCase 屬性名 | firstName, hireDate |
| Action/Event Handler | on[Event][Action] | onButtonClick, onRowSelect |
| Method (方法) | 動詞開頭 camelCase | getEmployeeList, saveChanges |
| Constant (常數) | UPPER_SNAKE_CASE | MAX_ROW_COUNT, DEFAULT_PAGE_SIZE |
| Interface (介面) | I + PascalCase | IEmployeeService |
| Service/Manager Class | [Entity]Service / [Entity]Manager | EmployeeService |
com.company.project
├── component
│ ├── EmployeeComponent
│ └── ...
├── controller
│ ├── ListController
│ └── DetailController
├── view
│ ├── EmployeeListView
│ └── EmployeeDetailView
├── model
│ ├── Employee
│ └── Department
├── service
│ └── EmployeeService
└── util
└── DateUtils
以下為原文附帶之命名規範示意圖: