English  |  正體中文  |  简体中文  |  Post-Print筆數 : 27 |  Items with full text/Total items : 113318/144297 (79%)
Visitors : 51036187      Online Users : 926
RC Version 6.0 © Powered By DSPACE, MIT. Enhanced by NTU Library IR team.
Scope Tips:
  • please add "double quotation mark" for query phrases to get precise results
  • please goto advance search for comprehansive author search
  • Adv. Search
    HomeLoginUploadHelpAboutAdminister Goto mobile version
    Please use this identifier to cite or link to this item: https://nccur.lib.nccu.edu.tw/handle/140.119/55463


    Title: 程式之模組性與擴充性---驗證方法與工具---子計畫五:剖面導向函數語言之模組化狀態處理與型態擴充研究 (III)
    Other Titles: Modular State Manipulation and Type Extension in Aspect-Oriented Functional Languages
    Authors: 陳恭;王柏堯;莊庭瑞
    Contributors: 國立政治大學資訊科學系
    行政院國家科學委員會
    Keywords: 剖面導向程式設計;多型剖面;織入;模組性;型態擴充
    Aspect-Oriented Programming;Polymorphic Aspects;Weaving
    Date: 2010
    Issue Date: 2012-11-12 11:04:56 (UTC+8)
    Abstract: 剖面導向程式設計(Aspect-Oriented Programming, AOP)是近年來繼物件導向程式設計(OOP)後,所興起的一種新的模組化程式設計方法。從AOP的觀點來看,應用程式除了功能邏輯以外,還有許多像安全需求等的橫跨性關注(crosscutting concerns);實現這些橫跨性關注的程式碼應該要從功能模組中分離出來,自成一模組並稱之為剖面。剖面與功能模組之間的界接點由所謂橫切點(pointcut)來定義,並透過稱之為織入(weaving)的機制將剖面程式碼整合入功能模組中,從而合成完整程式,滿足系統整體需求。這樣實現橫跨性關注的程式碼就可以集中封裝於適當的模組中,避免掉程式碼糾結與重複的問題。過去兩年間,我們的國科會研究計畫以型態導向的方法,發展了一套多型剖面的織入技術,並據以設計實作了一個實驗性的剖面導向函數語言AspectFun。我們提出所謂的諮詢型態(advised types)的概念,將剖面織入的需求嵌入型態之中,透過型態推理(type inference)的過程,選擇出型態相容的剖面在適當的環境下織入功能程式模組。這樣以型態推演程序完成織入的作法,不僅可以避免單就語法結構來決定織入剖面的缺點,並有機會可以替多型剖面奠定一個良好的理論基礎,進而在泛型程式的設計上,導入剖面機制,改善泛型程式的模組性。此外,我們也針對依賴流程決定的剖面,以個體(monad)轉換方式發展了有效的狀態判斷織入技術,並納入AspectFun語言的實作中。本計劃將在AspectFun語言既有的基礎上,進一步來探討剖面機制在函數式語言的程式模組化與擴充性方面的一些課題,所要進行的探討涵蓋實作、語言設計與理論模型與驗證各個面向,主題則大致上可分為三部份: (1) AspectFun語言核心機制的擴充與實作,以奠定後續研究的基礎。(2)探討如何以剖面與編譯技術來模組化純粹函數語言內最基本的橫跨性關注:狀態處理 (state manipulation via assignment) ,將設計與實作具備狀態處理功能的剖面 (side-effecting aspects)來處理的狀態改變,以提高純粹函數程式的模組化。(3)探討如何以剖面處理函數語言型態擴充(type extension)的需求,嘗試為在程式擴充性方面著名的Expression Problem 尋找一個剖面導向的解決方案。
    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 behavior 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 behavior of those functional modules impacted by aspects being modified accordingly. Recently we have developed an aspect-oriented functional language, AspectFun, for investigating various issues in introducing aspect orientation to a polymorphically typed functional language. Specifically, we have developed some novel techniques for static weaving of polymorphic aspects based on the notion advised types. Along with the type inference process, we employ a type-directed translation scheme which resolves all advice applications at static time and transforms AspectFun source programs into executable code in Haskell. We have also devised a monadic rewriting scheme to handle control-flow based pointcuts that requires knowledge of a program’s execution state. In this project, we shall carry on our work of AspectFun. Besides extending AspectFun’s core mechanism for future research, we shall investigate two issues of using aspects for enhancing program modularity and extensibility. First, in a purely functional language, a basic crosscutting concern is “side effect”, i.e., state manipulation via assignments. Indeed, even we can hide the hairy details of manipulating state by using the state-of-the-art technology of monadic assignments; we have to do a comprehensive rewriting of our functional programs. Unfortunately, typical aspects such as profiling and tracing are most naturally implemented using side effects. If we cannot handle side effects directly in an aspect, the modularity acquired through aspects will be greatly compromised. Therefore, we plan to extend AspectFun with side-effecting aspects which support state manipulation mechanisms such as user-defined variables and assignments directly. On the implementation side, we shall develop some compilation techniques which transform the pure-functional part into a monadic style, and weave in the aspects. The ultimate goal is to preserve the lazy semantics of AspectFun while being able to execute side-effecting aspects in a non-interfering way. Second, we shall investigate the feasibility of using aspects to address the type extension requirements as stated in the famous expression problem (which calls for language mechanisms that can support type-safe program extension in both the dimensions of data types and associated operations, yet neither code duplication nor code rewriting is required.) In general, it is easier to extend the set of operations than to extend the elements of a data type in a functional program. (By contrast, it is the opposite in an object-oriented program.) Here we plan to extend AspectFun with an inter-type declaration mechanism, following the spirit of that of AspectJ, to support type extension in a modular manner. Specifically, when a data type is extended with some new variants, we will employ aspects to define the required extension for the operations associated with the data type. Consequently, the entailed extensions of those operations can be modularly encapsulated in aspects.
    Relation: 基礎研究
    學術補助
    研究期間:9908~ 10007
    研究經費:579仟元
    Data Type: report
    Appears in Collections:[資訊科學系] 國科會研究計畫

    Files in This Item:

    File Description SizeFormat
    97-2221-E-004-001-MY3.pdf1896KbAdobe PDF2709View/Open


    All items in 政大典藏 are protected by copyright, with all rights reserved.


    社群 sharing

    著作權政策宣告 Copyright Announcement
    1.本網站之數位內容為國立政治大學所收錄之機構典藏,無償提供學術研究與公眾教育等公益性使用,惟仍請適度,合理使用本網站之內容,以尊重著作權人之權益。商業上之利用,則請先取得著作權人之授權。
    The digital content of this website is part of National Chengchi University Institutional Repository. It provides free access to academic research and public education for non-commercial use. Please utilize it in a proper and reasonable manner and respect the rights of copyright owners. For commercial use, please obtain authorization from the copyright owner in advance.

    2.本網站之製作,已盡力防止侵害著作權人之權益,如仍發現本網站之數位內容有侵害著作權人權益情事者,請權利人通知本網站維護人員(nccur@nccu.edu.tw),維護人員將立即採取移除該數位著作等補救措施。
    NCCU Institutional Repository is made to protect the interests of copyright owners. If you believe that any material on the website infringes copyright, please contact our staff(nccur@nccu.edu.tw). We will remove the work from the repository and investigate your claim.
    DSpace Software Copyright © 2002-2004  MIT &  Hewlett-Packard  /   Enhanced by   NTU Library IR team Copyright ©   - Feedback