Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aspect-oriented programming in android

Tags:

java

android

aop

What would be the best way to implement Aspect-oriented programming (AOP) in an Android application?

Would it be efficient with the mobile battery?

like image 482
Javi Avatar asked Sep 21 '10 10:09

Javi


People also ask

What does Aspect Oriented Programming?

Aspect-oriented programming (AOP) is an approach to programming that allows global properties of a program to determine how it is compiled into an executable program. AOP can be used with object-oriented programming ( OOP ). An aspect is a subprogram that is associated with a specific property of a program.

Is Android programming object oriented?

Most Android developers will use Java to write their apps. Java is an object oriented programming language. But what precisely does that mean? Java is the primary language used to create Android apps.

What is Aspect Oriented Programming in spring framework?

One of the key components of Spring Framework is the Aspect oriented programming (AOP) framework. Aspect-Oriented Programming entails breaking down program logic into distinct parts called so-called concerns.

What is the difference between object oriented and aspect oriented design?

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.


1 Answers

It depends in how it is implemented.

For instance, AspectJ's compile-time weaving would work on android but runtime weaving do not. Android does not support bytecode generation.

Check the Guice wiki:

Behind the scenes, method interception is implemented by generating bytecode at runtime. Guice dynamically creates a subclass that applies interceptors by overriding methods. If you are on a platform that doesn't support bytecode generation (such as Android), you should use Guice without AOP support.

like image 70
Macarse Avatar answered Sep 30 '22 06:09

Macarse