Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,847 members, 7,810,265 topics. Date: Saturday, 27 April 2024 at 03:32 AM

Java: Aop And Annotations - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Java: Aop And Annotations (935 Views)

(2) (3) (4)

(1) (Reply) (Go Down)

Java: Aop And Annotations by logica(m): 2:35pm On Jan 21, 2010
Anybody using these?

I am beginning to wonder how I've done without annotations for so long. They've been particularly useful in conjunction with AOP (AspectJ) and the JPA annotations have eliminated the use of XML files and simplified relation definitions, etc.

Which are the ones you use most often? Of course mine are those for the JPA and now AspectJ will feature more often.
Re: Java: Aop And Annotations by candylips(m): 6:01pm On Jan 21, 2010
lol an app without annotation is so 2006 wink

i don't use AspectJ i find Spring AOP sufficient for most of my needs

i use annotations everywhere in my app from JPA annotations to Spring annotations to Junit annotations.

i also have a few annotations defined at the API level for third part use by client apps
Re: Java: Aop And Annotations by logica(m): 6:14pm On Jan 21, 2010
But since AspectJ is basically an extension of the Java language itself, does it not appear to have an edge over Spring AOP?
Re: Java: Aop And Annotations by candylips(m): 6:29pm On Jan 21, 2010
It does most definately

I haven't done anything fancy with AOP yet, most of what i have done has been around seperating out cross cutting biz logic into aspects which can be reused by my app or by client programs accessing my app via a public API or webservice
Re: Java: Aop And Annotations by logica(m): 6:45pm On Jan 21, 2010
Which would u prefer:

@OrderBy or @Sort in sorting a list of entities?
Re: Java: Aop And Annotations by candylips(m): 2:16pm On Jan 22, 2010
Are you referring to JPA's @OrderBy or @Sort.

i have only used @OrderBy in the past because it gives me the ability to sort a collection at the SQL level.
Re: Java: Aop And Annotations by logica(m): 2:47pm On Jan 22, 2010
I am comparing the JPA @OrderBy and the Hibernate @Sort. I prefer the @Sort because it is based on the Java Collections API and can therefore handle more complex sort needs. @OrderBy as you pointed out can only be used in an SQL query, whereas @Sort is not tied to SQL.
Re: Java: Aop And Annotations by candylips(m): 3:18pm On Jan 22, 2010
you are right.

I normally prefer to get my collections sorted by the database for the simplest cases.

Ofcourse there will be cases where database sorting might not be enough but i haven't come across this yet in the apps i work with
Re: Java: Aop And Annotations by logica(m): 3:56pm On Jan 22, 2010
Besides the database can only do numeric and string sorts. Anything more than that will quickly get complex.
Re: Java: Aop And Annotations by candylips(m): 5:22pm On Jan 22, 2010
true

but info stored in the db are usually strings ,numbers or dates.

i see your point about complex sorting but those tend to be application logic specific

(1) (Reply)

Hello / Sergey Brin (One Of Google's Founders)'s Personal Resume / Videocrat Android App By Me.. Check And Rate

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.