aspectj - When we used aop compile and classloader weaving? -
what better use or maybe when use : weaving compile time , classload time or runtime default spring strategy? give me practical example using weaving compile time or classload time? .
what better depends on situation, e.g.:
- for production aspects makes sense weave them during compile-time because way right in class files, have no overhead load-time weaving , need during runtime aspectjrt.jar on classpath.
- for development or debugging aspects might mean overhead in production (specific types of fine-grained logging, tracing, monitoring necessary support bug tracking in production) more flexibly applied on demand via load-time weaving.
- if want weave (third-party) class files not have sources, can either use post compile time (binary) weaving , create new, woven classes or jars replacing original ones , deploy those, or can use ltw. whatever makes more sense in situation , dependent on whether aspects production or debugging/monitoring.
this list incomplete, there more factors , situations can lead decision. ltw can make sense production aspects, ctw can make sense debugging aspects. technical environment limits options.
Comments
Post a Comment