加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

我可以在Scala中进行面向方面的编程吗?

发布时间:2020-12-16 09:46:54 所属栏目:安全 来源:网络整理
导读:我不是在谈论模仿AOP功能在Scala(即使用特征而不是方面),我想知道是否有可能做真正的AOP在Scala(即意见,方面,联合点,编织等…) 解决方法 Mixin是在Scala中引入AOP的经典方法(如JonasBonér的“ AOP-style Mixin Composition Stacks in Scala”)。 但我只
我不是在谈论模仿AOP功能在Scala(即使用特征而不是方面),我想知道是否有可能做真正的AOP在Scala(即意见,方面,联合点,编织等…)

解决方法

Mixin是在Scala中引入AOP的经典方法(如JonasBonér的“ AOP-style Mixin Composition Stacks in Scala”)。

但我只知道“Method Proxy-Based AOP in Scala”(Daniel Spiewak – also here on SO – 和Tian Zhao)作为Scala(source code here)中的高级AOP实现。

Our technique uses Scala’s higher-order functions to intercept method calls with minimal syntactic overhead imposed on the base program. This framework allows developers to define pointcuts by specifying class types and method signatures. The framework also allows access to context variables,while aspects can insert advice code before or after the advised body.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读