Questions tagged [aspect-oriented]

Refers to Aspect-oriented Programming. According to Wikipedia, in computing, aspect-oriented programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns.

Filter by
Sorted by
Tagged with
1 vote
1 answer
57 views

How to represent CDI interceptors in class diagram?

I have the following classes: public class MyCaller{ @Inject private MyService service; private void callerMethod(int arg1, String arg2){ service.serviceMethod(arg1, arg2); } }...
user avatar
  • 309
0 votes
0 answers
63 views

What is the correct approach to test CDI classes in service layer?

My app has a service layer which is composed by CDI @ApplicationScoped beans. This is a class extracted from my project: @ApplicationScoped public class PostService { @Inject private ...
user avatar
  • 309
1 vote
1 answer
62 views

Wrapping methods without Decorator Pattern or AOP

I have a Dao interface which doesn't have any methods defined. Then I have multiple classes which implement this interface, like PetDao and HouseDao. For some of the implementation classes, and some ...
user avatar
  • 13
3 votes
1 answer
481 views

Cross-cutting concerns and dependency injection

I've got a web application with an architecture somewhat like a front-controller MVC design. I get HTTP requests, route them, run them through a filter layer, dispatch them to my domain classes which ...
user avatar
  • 175
2 votes
2 answers
826 views

Java: Is reflection bad for AOP situations?

Imagine the following situation: 1. Consume a 3rd party WSDL, out comes thousands of classes. 2. There's an opportunity to optimize performance by using a custom paralleled implementation. 3. Wsdl ...
user avatar
-2 votes
1 answer
338 views

Role-based declarative security for C#

According to Domain Driven Design and Development In Practice: Spring Security (a sub-project in Spring Portfolio) provides a fine-grained access control in both presentation (URL based) and ...
user avatar
2 votes
1 answer
84 views

Adding behaviors to models without interference

This is my situation: Models can contain properties which can be models themselves. Each property can have custom behavior, this behavior must be selected through its name (for example: Versionable, ...
user avatar
5 votes
3 answers
348 views

Patterns to allow for versatile data-flow hooks in Javascript

I have an application where I'd like to add ways for external modules/components to hook during the processes and data-flow and perform actions/modify data. For the first requirement—performing ...
user avatar
3 votes
0 answers
62 views

Cache updates after not related REST request completes

I am wondering about the following scenario - it's in the land of Spring/AOP and Ehcache. Happens in REST Web Application - REST/Service/DAO layers - I have objects in cache (@Repository + @Cacheable)....
user avatar
1 vote
1 answer
914 views

(Spring) AOP Design of Transactions

In our application we have several transactions, where each step is extensively logged. Pseudocode: @Component public class OurServiceImpl implements OurService { ... @Transactional public ...
user avatar
  • 9,247
4 votes
2 answers
2k views

Member and Function Injection in C++ Across Multiple Classes

I have a problem in which a variety of classes in C++ will want some functionality that is neither a "has a" nor an "is a" relationship. The problem is that there are some members with associated ...
user avatar
  • 611
1 vote
1 answer
60 views

Scoping behavioral variations to dynamic extents

While reading a paper in the context of Aspect Oriented Programming, I encountered following statement: Aspects enable scoping variations in space (with a rich variety of static pointcuts), in ...
user avatar
7 votes
4 answers
8k views

Programmatically extending Hibernate table/entity definitions in Spring, how?

I would like to know if there is a way —maybe with AOP— to extend table/entity definitions so that I can add functionality across the board that requires persistence. Let me explain what I want to do ...
user avatar
  • 13.8k
1 vote
1 answer
211 views

DDD: Alternative view of the Model?

I have a model class, let's say it's a Book. I need it to be displayed on the screen. I want to have an escaped version of it, so I do not need to escape fields manually. What should I do? I can add ...
user avatar
  • 796
0 votes
1 answer
5k views

Ensure that a method of a class is called after every method call of the same class, how? [duplicate]

I have twenty small methods (m1, m2, m3, etc..) in a class quite different between each other, and after every method i would like to do some common actions, like increasing some counters and in the ...
user avatar
  • 1
3 votes
3 answers
1k views

API - How to handle scope based functionality?

TLDR; Where and possibly how should I implement scope based logic in the example code? I have got a ASP.NET Web Api. The Api uses OData (on top off REST) for data endpoints and OAuth 2.0 ...
user avatar
  • 186
0 votes
1 answer
186 views

How should I handle measurement logging in my Discrete Event Simulation engine?

I'm attempting to build a Discrete Event Simulation library by following this tutorial and fleshing it out. How should I handle logging metrics in my Discrete Event Simulation engine? If you don't ...
user avatar
7 votes
2 answers
524 views

How to hide AOP implementation dependency without breaking encapsulation?

I have the concept of a SlowLoading thing: public interface SlowLoading { boolean hasLoaded(); } I also have a component MyComponent: public interface myComponent{ void doSomething(); } My ...
user avatar
  • 173
1 vote
1 answer
2k views

Can AspectJ or AOP in general be used to test exception handling?

I'm reading a book's chapter ("Controlled Exception Test" in "Testing Object-Oriented Testing") about testing exception handling in a running system (not at unit level). The conclusion is that it is ...
user avatar
  • 650
11 votes
3 answers
1k views

Byte code weaving vs Lisp macros

I have been reading about the libraries people have written for languages like Java and C# that make use of byte code weaving to do things like intercept function calls, insert logging code, etc. I ...
user avatar
  • 1,603
7 votes
1 answer
599 views

Loop fusion example using aspect-oriented framework

I had recently read a paper 'Aspect-Oriented Programming' by Gregor Kiczales and others, and found there the loop fusion example. Here is a definition of the loop fusion from the paper …the loop ...
user avatar
  • 979
2 votes
2 answers
659 views

Progressbar patterns (Eclipse)

I've struggled quite a bit with Eclipse and progress-monitors to try to have good progressbars which report useful progress information to the user. Inevitably the code gets cluttered with lots of ...
user avatar
  • 1,664
1 vote
0 answers
2k views

Spring AOP advice order

In Spring AOP, I can add an aspect at the following locations before a method executes (using MethodBeforeAdvice) after a method executes (using AfterReturningAdvice) around a method (both before and ...
user avatar
3 votes
1 answer
1k views

Is Ruby on Rails' Active Record an example of Aspect-Oriented Programming?

From Clean Code, about Cross-Cutting Concerns: Note that concerns like persistence tend to cut across the natural object boundaries of a domain. You want to persist all your objects using generally ...
user avatar
  • 3,025
3 votes
3 answers
1k views

if it's been designed correctly is AOP useful? [duplicate]

Possible Duplicate: Are certain problems solved more elegantly with AOP? I don't know much about aspect oriented programming (AOP) but I looked at a few examples and it seems to me more of a ...
user avatar
5 votes
1 answer
780 views

PHP Aspect Oriented Design

This is a continuation of this Code Review question. What was taken away from that post, and other aspect oriented design is it is hard to debug. To counter that, I implemented the ability to turn ...
user avatar
13 votes
1 answer
9k views

What are the differences between aspect-oriented, subject-oriented, and role-oriented programming?

I know there are many papers describing these three paradigms but I'm looking for a schematic explanation. There are a few very good descriptions of aspect-oriented programming on here so I'm asking ...
user avatar
5 votes
3 answers
1k views

Is AOP widely used in the enterprise sector

I'm curious to here the opinions of people working in large enterprise organisation whether AOP is widely (or even modestly) used when they are developing? Is AOP something which is inherent in the ...
user avatar
13 votes
4 answers
2k views

Is exception handling a cross-cutting concern?

I don't see much of a difference between the concerns of exception handling and logging in that both are cross cutting concerns. What do you think? Shouldn't it be handled separately on its own rather ...
user avatar
  • 630
23 votes
2 answers
6k views

AOP concepts explained for the dummy

Can someone explain AOP concepts for dummies: join point, point cut, weaving etc. For example: Aspect: a modularization of a concern that cuts across multiple classes. What does that mean?
user avatar
  • 239
8 votes
3 answers
836 views

Is aspect-oriented programming a misnomer?

From everything I have learned about "Aspect-Oriented Programming" or "Aspect-Oriented Software Development," labeling it as a programming paradigm or methodology appears to be inaccurate. From what ...
user avatar
  • 1,395
23 votes
6 answers
12k views

Aspect Oriented Programming: When to start using a framework?

I just watched this talk by Greg Young warning people to KISS: Keep It Simple Stupid. One of the things he suggested is that to do aspect-oriented programming, one does not need a framework. He ...
user avatar
  • 3,806
7 votes
1 answer
2k views

Enforcement of returning non-null

We are implementing some web services, and need to ensure that some of our methods always return non-null values. We've investigated two ways of doing this: Using code contracts, and returning the ...
user avatar
  • 3,806
4 votes
2 answers
837 views

are f# computational expressions a form of aspect oriented programming?

are monads, or more specifically f# computational expressions, a form of aspect oriented programming? Update: f# workflow builders have methods other than bind and unit. They have hooks for lots of ...
user avatar
2 votes
3 answers
620 views

How does one think about object oriented design and Aspect oriented Design for solution

I have worked on few projects in which both AOP and Object oriented paradigm were used. But, AOP usage was limited to logging only. I think AOP is a much more powerful technique. My question, to those ...
user avatar
  • 221
0 votes
2 answers
75 views

Marking services for secure handling; Annotation or inheritance?

We have a lot of services, some that demand some security, some that don't. We want an easy way of telling, in code, if a service will be secure or not. What would be the better way: Annotation or ...
user avatar
  • 397
3 votes
2 answers
418 views

The Underlying Value of Aspect-Oriented Programming [closed]

I recently got into PostSharp, an AOP tool for weaving in code. I've been finding a lot of resistance with other developers over giving up writing code to perform the tasks the weaving was meant to ...
user avatar
7 votes
2 answers
467 views

Aspect oriented programming and implicitness

Lets suppose that I have a class which represent an image and has a number of methods. class Image { circle(x,y,radius,color); square(x,y,w,h,color); floodfill(x,y,color) clear(); } ...
user avatar
22 votes
3 answers
4k views

Are certain problems solved more elegantly with AOP?

I've come across the idea of Aspect Oriented Programming, and I have some concerns with it. The basic idea seems to be that we want to take cross-cutting concerns which aren't well modularized using ...
user avatar
21 votes
5 answers
6k views

What alternatives are there for cross cutting concerns other than aspect oriented programming? [closed]

Aspect oriented programming promises to deal with cross cutting concerns, but I'm not completely sold on it yet. Have there been any other attempts to deal with this problem?
user avatar
  • 7,612