All Projects → mvpete → Aspekt

mvpete / Aspekt

Licence: mit
A lightweight (Aspect Oriented Programming) AOP foundation

Programming Languages

csharp
926 projects

Labels

Projects that are alternatives of or similar to Aspekt

Meiam.system
.NET 5 / .NET Core 3.1 WebAPI + Vue 2.0 + RBAC 企业级前后端分离权限框架
Stars: ✭ 340 (+1788.89%)
Mutual labels:  aop
Proxymanager
🎩✨🌈 OOP Proxy wrappers/utilities - generates and manages proxies of your objects
Stars: ✭ 4,556 (+25211.11%)
Mutual labels:  aop
Xaop
🔥A lightweight AOP(Android) application framework. Includes the most practical AOP applications.(一个轻量级的AOP(Android)应用框架。囊括了最实用的AOP应用)
Stars: ✭ 579 (+3116.67%)
Mutual labels:  aop
Jodd
Jodd! Lightweight. Java. Zero dependencies. Use what you like.
Stars: ✭ 3,616 (+19988.89%)
Mutual labels:  aop
Codeguide
📚 本代码库是作者小傅哥多年从事一线互联网 Java 开发的学习历程技术汇总,旨在为大家提供一个清晰详细的学习教程,侧重点更倾向编写Java核心内容。如果本仓库能为您提供帮助,请给予支持(关注、点赞、分享)!
Stars: ✭ 6,750 (+37400%)
Mutual labels:  aop
Laziertracker
本项目通过Android字节码插桩插件实现Android端无埋点(或自动埋点),并且支持根据配置文件实现业务数据的自动采集。
Stars: ✭ 485 (+2594.44%)
Mutual labels:  aop
Spring Boot Demo
spring boot demo 是一个Spring Boot、Spring Cloud的项目示例,根据市场主流的后端技术,共集成了30+个demo,未来将持续更新。该项目包含helloworld(快速入门)、web(ssh项目快速搭建)、aop(切面编程)、data-redis(redis缓存)、quartz(集群任务实现)、shiro(权限管理)、oauth2(四种认证模式)、shign(接口参数防篡改重放)、encoder(用户密码设计)、actuator(服务监控)、cloud-config(配置中心)、cloud-gateway(服务网关)等模块
Stars: ✭ 323 (+1694.44%)
Mutual labels:  aop
Hasor
Hasor是一套基于 Java 语言的开发框架,区别于其它框架的是 Hasor 有着自己一套完整的体系,同时还可以和先有技术体系做到完美融合。它包含:IoC/Aop容器框架、Web框架、Jdbc框架、RSF分布式RPC框架、DataQL引擎,等几块。
Stars: ✭ 713 (+3861.11%)
Mutual labels:  aop
Jcabi Aspects
Collection of AOP/AspectJ Java Aspects
Stars: ✭ 455 (+2427.78%)
Mutual labels:  aop
Automon
Automon combines the power of AOP (AspectJ) with monitoring or logging tools you already use to declaratively monitor your Java code, the JDK, and 3rd party libraries.
Stars: ✭ 548 (+2944.44%)
Mutual labels:  aop
Hyperf
🚀 A coroutine framework that focuses on hyperspeed and flexibility. Building microservice or middleware with ease.
Stars: ✭ 4,206 (+23266.67%)
Mutual labels:  aop
Aspect Injector
AOP framework for .NET (c#, vb, etc)
Stars: ✭ 398 (+2111.11%)
Mutual labels:  aop
Let
Annotation based simple API flavored with AOP to handle new Android runtime permission model
Stars: ✭ 532 (+2855.56%)
Mutual labels:  aop
Spring Learning
Spring 学习笔记,通过例子展示和剖析实现机制
Stars: ✭ 346 (+1822.22%)
Mutual labels:  aop
Swoft
🚀 PHP Microservice Full Coroutine Framework
Stars: ✭ 5,420 (+30011.11%)
Mutual labels:  aop
Summer
这是一个支持分布式和集群的java游戏服务器框架,可用于开发棋牌、回合制等游戏。基于netty实现高性能通讯,支持tcp、http、websocket等协议。支持消息加解密、攻击拦截、黑白名单机制。封装了redis缓存、mysql数据库的连接与使用。轻量级,便于上手。
Stars: ✭ 336 (+1766.67%)
Mutual labels:  aop
S Mall Ssm
小小商城系统,JavaWEB项目,基于SSM,仿天猫页面,功能齐全,实现了自动处理关联查询的通用Mapper、抽象 BaseService 类、注解鉴权、参数注解校验等
Stars: ✭ 456 (+2433.33%)
Mutual labels:  aop
Blockhook
Hook Objective-C blocks. A powerful AOP tool.
Stars: ✭ 742 (+4022.22%)
Mutual labels:  aop
Hibeaver
HiBeaver is a gradle plugin for java byte code manipulation and AOP design by modifying project byte code during build of the package, or modifying byte code within Jar independently.
Stars: ✭ 617 (+3327.78%)
Mutual labels:  aop
Light Service
Series of Actions with an emphasis on simplicity.
Stars: ✭ 545 (+2927.78%)
Mutual labels:  aop

[ASPeKT]

Build status

A lightweight (Aspect Oriented Programming) AOP foundation

Overview

Aspekt is a small AOP foundation library written in C#. Aspect Oriented Programming (AOP) allows to ease the pain associated with cross-cutting concerns. A cross-cutting concern is a pattern that gets across a program that cannot easily be factored into its own module. This raises the so called signal-to-noise ratio. One common cross cutting concern is logging, when logging entry/exit/exception of a function, the code becomes cluttered with log code and the intent can become lost. Aspekt addresses these concerns, by using attributes as annotation of functions. Like PostSharp aspect utilizes post processing of the .NET binaries, inserting the aspects post build. For ASPeKT this is done using Mono.Cecil.

Usage

The foundation of Aspekt is the base Aspect. In order to utilize Aspects, just derive from Aspekt.Aspect and implement the OnEntry, OnExit, OnException methods. Aspekt will only place the calls implemented on the class i.e. OnEntry, OnExit, OnException

class SampleAspect : Aspekt.Aspect
{
   public SampleAspect(String val)
   {
   }

   public void override OnEntry(MethodArgs ma)
   {
      // called before any existing code is ran
   }

   public void override OnExit(MethodArgs ma)
   {
     // called before ANY return statement
   }

   public void override OnException(MethodArgs ma, Exception e)
   {
     // called if existing codes excepts
   }
}

When you use the Aspect in your client code, such as

class Foo
{
    [SampleAspect("Some Value")]
    public void Bar(String s, int i)
    {
        // Do something here.
    }
}

Aspekt will re-write the code, to something along the lines of the following.

class Foo
{
    [SampleAspect("Some Value")]
    public void Bar(String s, int i)
    {
       MethodArgs ma = new MethodArgs("Bar", "Assembly.Foo.Bar(String s, int i)", new Arguments(new object[] { s, i }), this);
       SampleAspect sa = new SampleAspect("Some Value");
       sa.OnEntry(ma);
       try
       {
           // Do Something Here
           sa.OnExit(ma);
       }
       catch(Exception e)
       {
          sa.OnException(ma,e);
          throw;
       }
    }
}

As mentioned earlier, Aspekt will only write functions where they've been overridden. This means, only the methods that you want, are added. As well, Aspekt tries not alter or modify existing code, so if the IL contains multiple returns, Aspekt calls OnExit before each return.

If you're using NuGet to get ASPeKT, your project will have the appropriate post build steps. You can ignore anything below.

Since Aspekt works post compile, in order to use it you must run the Bootstrap application against your assembly.

> Aspekt.Bootstrap.Host [PathToAssembly] 

This will process the assembly and add in the aspects to their respective members.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].