Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Aspect vs Objects

 
Sunderam Goplalan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Matt Weisfeld
author
Greenhorn
Posts: 24
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Sunderam Goplalan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Thanks. In this example though, Objects seem to fit the bill. As you said, in other scenarios/contexts, Aspects can be leveraged.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic