CRM開發學習一

本文主要闡述UI組件,genIL和BOL。

先說下這張圖。從下往上看,後臺具體的表的操作,由CRM包裝爲一系列的API;這些API再進一步包裝爲genIL(generic interaction layer);genIL可以在一步由CRM包裝出BOL(business object layer),當然開發人員自己也可以建BOL;這些BOL綁定到UI組件MVC架構中的M上;UI組件實例化後就是最終展現到用戶瀏覽器上面的內容。

這兩段定義需要準確的理解;

• Business object layer (BOL): The business object layer saves the business
object data, for example of sales orders, at runtime of the SAP CRM session.
This layer guarantees the separation of the CRM WebClient UI and the
underlying business logic.
• Generic interaction layer (genIL): The generic interaction layer handles the
data transfer from the business object layer to the application programming
interfaces (APIs) of the underlying business engine. It is the connection
between the business object layer and the underlying business engine.

BOL的數據來自於genIL。genIL纔是真正與表進行交互的。

在瀏覽器上面,進入一個UI組件,鼠標點一個欄位,按【F2】就能獲取到這個Attribute,這個View,這個Context,這個Window,這個Configuration,這個Component的所有有用信息。絕對的神器。

知道了組件名,在GUI用事物代碼【BSP_WD_CMPWB】就能查看這個組件了。

實際上,這個UI組件就是一個MVC架構的BSP項目。所以你用SE80也是一樣能看的。

區別就是如圖這樣,展現的效果更好,可用的功能更多。

MVC架構理解這張圖就行了。

關鍵是理解上面這張圖。在UI裏面,【C】的表現形式是XXX.DO,實際的內容是一個以_IMPL結尾的class,事件,方法,頁面跳轉等等有邏輯代碼的都含在裏面;【M】要分兩種,都是class,一種是以_CTXT結尾的,這個是上下文的主class,它的下面掛若干個(也可能沒有)以_CNxx結尾的class,這個纔是真正某個上下文的業務模型,各種和字段有關的內容包括需要邏輯代碼的地方都在這裏面;【V】就是那些.HTM文件,需要UI展現的纔有這個文件,文件裏面的元素通過ID關聯到後臺字段。

關於BOL和genIL,請看下面這張圖。

BOL沒有直接改表數據。BOL將對數據的操作傳遞給genIL。CRM本來就有很多FUNC是處理相關數據到表的,genIL根據BOL傳過來的數據進行判斷分析和加工,調用相應的FUNC執行。所以很多時候你會發現,BOL的屬性結構和真實的表結構往往不一樣。

BOL有幾種類型:

Access Object: An access object is a special type of BO, whose ID can be used to
determine both the attributes of the access object itself and those of its dependent objects.

訪問對象:獲取數據的入口對象,一般從這裏使用BOL。
Dependent Object: A dependent object is a special type of BO, whose attributes
cannot be determined solely from the ID of this BO, but instead, only or together with the ID of the superior access object.
Root object: The root object is the only object within the hierarchical structure of a data model that is assigned as a superior object to all other objects. Each root object is also an access object.

根對象:相關的一組對象的集合。
Search-Object: A query object is a special type of BO whose attributes are the
parameters of a search request.

查詢對象:一般用於查詢條件。

Dynamic Search-Object: A dynamic query object is a type of BO whose attributes are the parameters of a search request. It is possible to create select options for these parameters.

動態查詢對象:查詢條件可變的UI對應的BOL。
Search Result Object: The result object of a search request has a dictionary structure assigned and displays data from different BOs as a result list. To link the search result object to the data model hierarchy the Search Result Object is associated with the root object of the same component.

查詢結果對象:查詢結果數據集合對應的BOL。

記住兩個事物代碼:

【GENIL_MODEL_BROWSER】查詢BOL;

【GENIL_BOL_BROWSER】根據BOL查詢數據。
————————————————
版權聲明:本文爲CSDN博主「範叉叉」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/fanchacha/java/article/details/51462018

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章