开发者

Is AOP the correct approach?

I know people generally use AOP for logging and things of that nature. Currently I have a functionality that requires MOST pieces of that application page.

I had a couple questions.

1) Would using Spring AOP be the proper way to address this issue. Or is there something else. Javascript on the front end has to access the cookie.

开发者_如何学Go

2) Is the concept of an aspect similar to what an interceptor is. That's the impression I get but wanted to clarify

EDIT - I have an application which basically retrieves some information and sets a cookie based on location of IP. Many pages within this web application will need this information - zip code for example on the page. These cookies need to be used by javascript. Sorry for the lack of clarity.


What application page? I don't understand the first sentence. AOP is a server-side technology, so I don't see where JavaScript and cookies come in.

It's hard to decide whether simple HTTP filters or Spring AOP is the way to go without more details.

Interceptors and HTTP filters are similar in spirit to before-advice in AOP. AOP includes after and error advice as well, so I think it's a more inclusive idea.

I'd be worried about an app that had every part using the functionality of a given page without knowing more.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜