在普通的程式環境下,使用者若臨時想要存取物件或叫用函數,都必須耗費時間在重新編譯上。我們為Java語言提出一個程式探索器,稱為OAI。它讓使用者可以隨時讀寫物件欄位並呼叫物件方法。
Java語言所用到的全名(fully qualified name)常包含很多層的套件及欄位。我們為程式環境提出“目前工作範圍”(current working scope,CWS)的概念。這讓使用者可以用簡名(simple name)來表示所要操控的對象。目前工作範圍分為(1)物件實體範圍,(2)類別範圍,(3)套件範圍,各有不同的性質。OAI的運作平行於作業系統的Shell,我們也引入類似於微軟檔案總管的視窗介面,讓使用介面更友善,更有效率。
OAI的應用領域主要有: (1)加速各種程式庫(class library)的學習過程. (2) 加速軟體的開發與檢測. (3) 可當成萬用交談介面. OAI已實作完成,並實際應用在淡江大學的教學課程上。此外,本系所開發的“形式語言輔助軟體”也用OAI當作使用介面。
In an ordinary program environment, if a user want to access temporarily a field or a method of an object, he/she always must spent extra time in re-compiling. We propose OAI, an explorer for Java codes, in this paper. In OAI, users can dynamically reading/writing any field of an object as well as invoking any method of it.
The fully qualified name in Java usually contains a long list of identifiers of packages and fields. The concept of “current working scope (CWS)” is proposed so that users of a program environment can key-in a simple name in place of a fully qualified name. CWS’s are classified into three categories: (1) “instance scopes”, (2) “class scopes”, and (3) “package scopes”, each one display individual behavior. The operations in OAI are parallel to that in a shell, and a GUI-interface similar to the Microsoft’s file manager (or explorer) is implemented so that our user interface will be more friendly and more efficiency.
The primary application field of OAI are: (1) speeding up the learning of a class library, (2) speeding up the development and testing of software, and (3) serving as a general-purpose interactive user interface. The prototype of OAI has been implemented. It is successfully used in a course of Tamkang University. Furthermore, it is the user interface of a package “Formal Language Assistance System”.