*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Aspect vs Objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Aspect vs Objects" Watch "Aspect vs Objects" New topic
Author

Aspect vs Objects

Sunderam Goplalan
Ranch Hand

Joined: Oct 10, 2011
Posts: 73
Hi Matt,

Recently I've started liking Aspect oriented programming. I use Spring framework based off of Java and Spring solves some of the cross cutting concerns of business applications using Aspects in a less intrusive way.
Aspects, like objects in OO world, also aid in achieving modularity.

How would you compare Aspects with Objects?

Regards
G Sunderam


SCJP 5.0 , SCEA Java EE 5
Matt Weisfeld
author
Greenhorn

Joined: May 01, 2013
Posts: 24
    
    5
This is an interesting topic. Your question may fit well with an earlier thread on separating behaviors in classes. For example, you can use a hierarchy of birds. When you ask people to describe the most common behavior of birds almost everyone would say 'flight". However, not all birds fly. So you would have to decide if you want to create a Bird class that doesn't include a "flight" method. Perhaps you would need 2 classes, FlyingBirds and FlightLessBirds that inherits from the Bird class. There really is no right or wrong way to handle the design - it just makes for interesting discussions. Not all dogs can bark either. Aspects may allow a different approach to thye design. Is this what you were thinking?


Matt Weisfeld
Sunderam Goplalan
Ranch Hand

Joined: Oct 10, 2011
Posts: 73
Yes. Thanks. In this example though, Objects seem to fit the bill. As you said, in other scenarios/contexts, Aspects can be leveraged.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Aspect vs Objects
 
Similar Threads
spring aop
Such Honesty
Why shouldn't we use AspectJ/AOP?
Spring Persistence with Hibernate book - Aspects
How to get method invocation context