Aspect Oriented Programming vs. Object-Oriented Programming

后端 未结 7 689
耶瑟儿~
耶瑟儿~ 2020-11-28 17:11

Like most developers here and in the entire world, I have been developing software systems using object-oriented programming (OOP) techniques for many years. So when I read

7条回答
  •  北荒
    北荒 (楼主)
    2020-11-28 17:48

    I am late to answer this question but its one of my favorite topics, so let me share my view.

    OOP is mainly used to organise your business logic while AOP helps to organise your non-functional things like Auditing, Logging, Transaction Management, Security etc.

    This way you can decouple your business logic from non-functional logic, which makes code cleaner.

    Other advantage is you can apply the advice (such as auditing) very consistently, without implementing any interface, which gives great flexibility for modification without touching the business logic.

提交回复
热议问题