Aspect Oriented SQL Server

Are there any open source libraries, etc. that can be installed in an instance of SQL Server (2008 or later) that can enforce AOP standards? I would really like to avoid applying cross-cutting pattern issues to our development staff. AOP seems to be the best option if available.

If it does not exist yet, I will try to collapse it.

EDIT:

Some examples can be subclassed in a table to create specific types of tables, for example mixin characteristics. I am in a data warehouse environment with a lot of audit requirements, so we create multi-threaded tables. It would be great to have

CREATE BITEMPORAL TABLE 

which will add the transaction and the actual time and modify the CRUD statements for these tables. (Yes, I know that looks and triggers can do this somewhat). A more difficult task is to save procedures with specific logging or transaction parameters, such as

 CREATE PROC FOO /* VERBOSE, ATOMIC, SERIALIZABLE */ 

and the body will be automatically wrapped using the appropriate T-SQL to perform these actions. Yes, it is possible to add stored procedures to accept these arguments and generate SQL and compile these artifacts. But the disadvantage is that there is no coercion - the developer can bypass this procedure and use CREATE PROC directly, and the content in syscomments is the generated code, and not the annotated version of AOP, which violates the abstraction.

+4
source share
2 answers

You might be interested in taking a look at AO4SQL, a programming language that brings AO concepts to SQL. Conceptually, the tool works with any SQL server.

You can download my article “AO4SQL: Towards an Aspect-Oriented Extension for SQL”, which was published in RAM-SE 2011: http://www-users.cs.york.ac.uk/~manuel/Events/RAM -SE11 / RAMSE11papers.zip

Keep in mind that AO4SQL is a prototype, but if you want to join an open source project ... get in touch with me.

+6
source

Interesting. I did not even think about applying AOP methods to SQL Server.

With SQL Server 2008, I believe you have the ability to call .NET code, so you can work in a standard AOP tool like PostSharp or Castle DynamicProxy in this way.

0
source

Source: https://habr.com/ru/post/1432374/


All Articles