File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes Uses of AOP in running web application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Uses of AOP in running web application" Watch "Uses of AOP in running web application" New topic
Author

Uses of AOP in running web application

subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
Currently i am working on banking application to be used by the bank stuff now my PM asked me to looked in to the AOP (also Spring, hibrenate, but i have started with AOP)... and tell us where it can add value to our project.

We are using struts at the front-end and oracle at the back we are following the fundamentals of O/R and IoC but not using any framework for the same as leaning curve we take it's time.

Coming back to AOP i know we can use it in logging, connection pool(i dont thik here is the scope as connection has been implemented and quite stable), Exception handling but dont think these are good enough points to approach him i have left pre-checks for setter-getter (which is also not a possibility).

Can you please guide me to some uses which i have missed.
[ March 17, 2008: Message edited by: subodh gupta ]

http://subodh-gupta.blogspot.com
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Hi,

my PM asked me to looked in to the AOP

Wow, it's raining frogs. And did you dare ask him why ?

Can you please something else which i have missed.

Please Use a meaningful subject line


[My Blog]
All roads lead to JavaRanch
subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
no i can't ask my manager!!! why? because that was his question and i am supposed to answer this.

Thanks for you kind attention to the post.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I've used AOP in Spring (or I should say Spring used AOP for me) for managing transactions. For example, all service classes' methods name starting with "update", "insert", "delete" would run in a transactional context automatically. Everything would rollback automatically if an exception occured. Thanks to AOP, this is not visible in the service class. If you want to read on how it is managed in Spring, check the Reference Documentation.

But I think that your manager's approach is not cool It looks like he wants to put some AOP just for "prestige". Anyway, good luck.
subodh gupta
Ranch Hand

Joined: Jul 23, 2007
Posts: 203
actually we might migrate our apllication to spring eventually but first i think we are following approach that would take every body close to understanding the Spring's underlying concepts or may be we never do anything with this application. And me end up doing R&d in Spring technology's .
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2046
Some of the things AOP can help on Spring, are transaction and logging.

How do you currently implement these on your system?
mo sayed
Ranch Hand

Joined: Jan 25, 2006
Posts: 88
Some of the things AOP can help on Spring, are transaction and logging.

I'd add auditing. You mentioned that it's for a banking application.
Assuming you wanted to track all the user actions, you could do this
by exploiting AOP.
Mo


<a href="http://moongrails.blogspot.com/" rel="nofollow">grails</a>
Jason Ferguson
Ranch Hand

Joined: Aug 09, 2007
Posts: 58
I had an odd case where I use the OpenSessionInView pattern to keep the database session open until the view (the JSP) had completely rendered.

I had an entire ViewHelper layer which would handle mundane tasks such as populating DisplayTag tables and Struts HTML tag library <html ptionsCollection> tags.

One day, one of my JSPs would not render, claiming an issue with an expression language (EL) definition. I knew something was up, but did not have a full stacktrace to solve the problem. I spent an entire afternoon trying to figure it out.

The next morning I created an Advice class that implemented ThrowsAdvice on the ViewHelper class. All that was in the method was a simple e.printStackTrace().

Within 5 minutes, I found the problem was a ClassCastException, and within 10 the problem was solved.

There are definitely arguments against using Open Session In View (and this was probably one of them). However, rewriting the entire user interface was not an option.

Jason
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Uses of AOP in running web application
 
Similar Threads
Metaphors of AOP
AOP
AOP
What is AOP?
Is AOP J2EE?