I totally agree your point, AOP is a good idea but library(AspectJ, etc.) is a bad implementation. It would be much better if it's language built-in feature. I have a question about auto logging using AspectJ. I want to add logging statement in catch block, but only when exception variable is annotated with @AutoLog, just like the code below: try { ...} catch (@AutoLog Exception e) { //add some logging code here } Do you know how to define a pointcut like that? I suppose something like "handler(*) && @args(@AutoLog)" should work but couldn't find an exact working way. Thank you.
@DanyloSyrotynskyy
8 жыл бұрын
Пробовал аоп в студенческие годы. почему бы не сделать чтобы классы были сами себе аспектами? тогда бы целостность не разрушалась
@yegor256
8 жыл бұрын
Да, как-то так было бы лучше всего. Но Java не умеет так, нет в ней удобных инструментов для этого.
@DanyloSyrotynskyy
8 жыл бұрын
yegor256 но почему они его не хотят добавить уже столько лет? странно это, чем оно так не понравилось архитекторам языка
@yegor256
8 жыл бұрын
и мне странно
@shilohjuelz2478
3 жыл бұрын
i guess Im randomly asking but does any of you know a trick to log back into an instagram account..? I somehow forgot my password. I would love any assistance you can offer me.
Пікірлер: 8