學術產出-NSC Projects

Article View/Open

Publication Export

Google ScholarTM

政大圖書館

Citation Infomation

  • No doi shows Citation Infomation
題名 以型態導向方法發展多型剖面的織入技術與應用 (I)
其他題名 A Type-Directed Approach to Developing Static Weaving Techniques for Polymorphic Aspects and Its Applications
作者 陳恭
貢獻者 政治大學資訊科學系
行政院國家科學委員會
關鍵詞 剖面導向程式設計;多型剖面;織入;多型型態系統;型態推理
Aspect-Oriented Programming; Polymorphic Aspects; Weaving; Type Inference
日期 2006
上傳時間 12-Nov-2012 11:01:56 (UTC+8)
摘要 剖面導向程式設計(Aspect-Oriented Programming, AOP)是近年來繼物件導向程式設計(OOP)後,所興起的一種新的程式設計方法。從AOP的觀點來看,應用程式除了功能邏輯以外,還有許多像安全需求等的橫跨性關注(crosscutting concerns);實現這些橫跨性關注的程式碼應該要從功能模組中分離出來,自成一模組並稱之為剖面。剖面與功能模組之間的界接點由所謂橫跨點(pointcut)來定義,並透過稱之為織入(weaving)的機制將剖面程式碼整合入功能模組中,從而合成完整程式,滿足系統整體需求。這樣實現橫跨性關注的程式碼就可以集中封裝於適當的模組中,避免掉程式碼糾結與重複的問題。近幾年來關於剖面程式設計的各項研究蓬勃發展,從剖面程式語言、開發工具、剖面設計與分析,到剖面的理論基礎,都可見到了許多的研究成果陸續發表出來。這些研究成果大多集中在探討像AspectJ這類以物件導向為基礎的剖面語言的各個面向,因這類語言都不具備參數式多型(parametric polymorphism)的功能,所以關於多型剖面(Polymorphic/generic aspects)的研究尚屬起步階段。不過去年推出的Java 5已提供多型(或稱泛型Generics)的機制,所以我們認為實有必要針對多型剖面所帶來的技術與理論的挑戰加以探討,好替下一代的剖面語言奠定基礎。目前多型剖面的研究主要是以具備多型機制的函數式語言為基礎,雖然已經有了一些重要的結果,但仍然有許多可以改善加強的地方。舉例而言,如何適當整合高階函數與多型剖面就還是一個重要的研究課題。本計劃擬以兩年的時間,以型態導向的方法發展一套多型剖面的織入技術,並將其應用到AspectJ與泛型程式設計上。目前關於多型剖面的織入處理研究,雖然也會採用型態資訊,但是還是以語法結構為基礎,以致於不能處理像高階函數的間接呼叫,也無法解決多個形態有重疊的剖面的織入問題。我們提出所謂的諮詢型態(advised types)的概念,將剖面織入的需求內入型態之中,透過型態推理(type inference)的過程,選擇出型態相容的剖面在適當的環境(context)下織入功能程式模組。這樣以型態推演程序完成織入的作法,不僅可以避免單就語法結構來決定織入剖面的缺點,並有機會可以替多型剖面奠定一個良好的理論基礎,並進而在泛型程式的設計上,導入剖面機制,改善泛型程式的模組結構。
Aspect-oriented programming (AOP) aims at modularizing concerns such as profiling and security that crosscut the components of a software system. In AOP, a program consists of many functional modules and some aspects that encapsulate the crosscutting concerns. An aspect provides two specifications: A pointcut, comprising a set of functions, designate when and where to crosscut other modules; and an advice, which is a piece of code, that will be executed when a pointcut is reached. The complete program behaviour is derived by some novel ways of composing functional modules and aspects according to the specifications given within the aspects. This is called weaving in AOP. Weaving results in the behaviour of those functional modules impacted by aspects being modified accordingly. Introducing aspect orientation to a polymorphically typed functional language strengthens the importance of type-scoped advices, i.e., advices with their effects harnessed by type constraints. As types are typically treated as compile time entities, it is highly desirable to be able to perform static weaving to determine at compile time the chaining of type-scoped advices at their associated join points. In this paper, we describe a compilation model, as well as its implementation, that supports static type inference and static weaving of programs in an aspect-oriented polymorphically typed lazy functional language, AspectFun. We also introduce many advanced aspect features to AspectFun, and show how these features are handled by our compilation model. We present a type-directed weaving scheme that coherently weaves type-scoped advices into the base program at compile time. We provide the detailed proof of the correctness of the static weaving with respect to the operational semantics of AspectFun. We also demonstrate how control-flow based pointcuts (such as CFLOWBELOW) are compiled away, and highlight several type-directed optimization strategies that can improve the efficiency of woven code.
關聯 基礎研究
學術補助
研究期間:9508~ 9607
研究經費:685仟元
資料類型 report
dc.contributor 政治大學資訊科學系en_US
dc.contributor 行政院國家科學委員會en_US
dc.creator (作者) 陳恭zh_TW
dc.date (日期) 2006en_US
dc.date.accessioned 12-Nov-2012 11:01:56 (UTC+8)-
dc.date.available 12-Nov-2012 11:01:56 (UTC+8)-
dc.date.issued (上傳時間) 12-Nov-2012 11:01:56 (UTC+8)-
dc.identifier.uri (URI) http://nccur.lib.nccu.edu.tw/handle/140.119/55387-
dc.description.abstract (摘要) 剖面導向程式設計(Aspect-Oriented Programming, AOP)是近年來繼物件導向程式設計(OOP)後,所興起的一種新的程式設計方法。從AOP的觀點來看,應用程式除了功能邏輯以外,還有許多像安全需求等的橫跨性關注(crosscutting concerns);實現這些橫跨性關注的程式碼應該要從功能模組中分離出來,自成一模組並稱之為剖面。剖面與功能模組之間的界接點由所謂橫跨點(pointcut)來定義,並透過稱之為織入(weaving)的機制將剖面程式碼整合入功能模組中,從而合成完整程式,滿足系統整體需求。這樣實現橫跨性關注的程式碼就可以集中封裝於適當的模組中,避免掉程式碼糾結與重複的問題。近幾年來關於剖面程式設計的各項研究蓬勃發展,從剖面程式語言、開發工具、剖面設計與分析,到剖面的理論基礎,都可見到了許多的研究成果陸續發表出來。這些研究成果大多集中在探討像AspectJ這類以物件導向為基礎的剖面語言的各個面向,因這類語言都不具備參數式多型(parametric polymorphism)的功能,所以關於多型剖面(Polymorphic/generic aspects)的研究尚屬起步階段。不過去年推出的Java 5已提供多型(或稱泛型Generics)的機制,所以我們認為實有必要針對多型剖面所帶來的技術與理論的挑戰加以探討,好替下一代的剖面語言奠定基礎。目前多型剖面的研究主要是以具備多型機制的函數式語言為基礎,雖然已經有了一些重要的結果,但仍然有許多可以改善加強的地方。舉例而言,如何適當整合高階函數與多型剖面就還是一個重要的研究課題。本計劃擬以兩年的時間,以型態導向的方法發展一套多型剖面的織入技術,並將其應用到AspectJ與泛型程式設計上。目前關於多型剖面的織入處理研究,雖然也會採用型態資訊,但是還是以語法結構為基礎,以致於不能處理像高階函數的間接呼叫,也無法解決多個形態有重疊的剖面的織入問題。我們提出所謂的諮詢型態(advised types)的概念,將剖面織入的需求內入型態之中,透過型態推理(type inference)的過程,選擇出型態相容的剖面在適當的環境(context)下織入功能程式模組。這樣以型態推演程序完成織入的作法,不僅可以避免單就語法結構來決定織入剖面的缺點,並有機會可以替多型剖面奠定一個良好的理論基礎,並進而在泛型程式的設計上,導入剖面機制,改善泛型程式的模組結構。en_US
dc.description.abstract (摘要) Aspect-oriented programming (AOP) aims at modularizing concerns such as profiling and security that crosscut the components of a software system. In AOP, a program consists of many functional modules and some aspects that encapsulate the crosscutting concerns. An aspect provides two specifications: A pointcut, comprising a set of functions, designate when and where to crosscut other modules; and an advice, which is a piece of code, that will be executed when a pointcut is reached. The complete program behaviour is derived by some novel ways of composing functional modules and aspects according to the specifications given within the aspects. This is called weaving in AOP. Weaving results in the behaviour of those functional modules impacted by aspects being modified accordingly. Introducing aspect orientation to a polymorphically typed functional language strengthens the importance of type-scoped advices, i.e., advices with their effects harnessed by type constraints. As types are typically treated as compile time entities, it is highly desirable to be able to perform static weaving to determine at compile time the chaining of type-scoped advices at their associated join points. In this paper, we describe a compilation model, as well as its implementation, that supports static type inference and static weaving of programs in an aspect-oriented polymorphically typed lazy functional language, AspectFun. We also introduce many advanced aspect features to AspectFun, and show how these features are handled by our compilation model. We present a type-directed weaving scheme that coherently weaves type-scoped advices into the base program at compile time. We provide the detailed proof of the correctness of the static weaving with respect to the operational semantics of AspectFun. We also demonstrate how control-flow based pointcuts (such as CFLOWBELOW) are compiled away, and highlight several type-directed optimization strategies that can improve the efficiency of woven code.-
dc.language.iso en_US-
dc.relation (關聯) 基礎研究en_US
dc.relation (關聯) 學術補助en_US
dc.relation (關聯) 研究期間:9508~ 9607en_US
dc.relation (關聯) 研究經費:685仟元en_US
dc.subject (關鍵詞) 剖面導向程式設計;多型剖面;織入;多型型態系統;型態推理en_US
dc.subject (關鍵詞) Aspect-Oriented Programming; Polymorphic Aspects; Weaving; Type Inference-
dc.title (題名) 以型態導向方法發展多型剖面的織入技術與應用 (I)zh_TW
dc.title.alternative (其他題名) A Type-Directed Approach to Developing Static Weaving Techniques for Polymorphic Aspects and Its Applicationsen_US
dc.type (資料類型) reporten