The Artima Developer Community
Sponsored Link

Java Buzz Forum
AOP Kata: Favour OO

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
AOP Kata: Favour OO Posted: May 5, 2004 10:12 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: AOP Kata: Favour OO
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement
We have learned to teach OO programmers to Favour Composition. Why do we do this? Because inheritance is bad? Of course not. inheritance is a very powerful design tool at our disposal. If you imagine taking it away from your arsenal (not the damn English football team that I dislike ;) ) you would see people weeping. When inheritance fits a problem it is elegant and beautiful to behold. If you had to use another technique it would feel like a hack. That is how you will feel if you learn to use AI techniques and they were suddenly taken away. The problem is that when you use these powerful tools for evil instead of good, then you end up with a grimace. A crazy inheritance hierarchy is an incredibly brittle software design, and will constrain you. Human nature is to play with the new shiny toy (well for some people. The cynics just complain in the corner). You have to make sure that the toy doesn't overwhelm you and influence your design decisions. If inheritance doesn't feel right.... don't do it! So, back to Favouring Composition. By planting this seed into a developers mind, they will hopefully think for another nanosecond before they make the Car extend Engine, just because they want to get some of the methods for free. Thus, my mantra to myself is Favour traditional OO interfaces when designing with AI in my kit bag. With this seed I stop myself from jumping to the oh this would be fun if I wrote an uber-aspect which could do X, Y, and Z!. It doesn't mean that I won't use AI techniques when the shoe fits though... and when they DO fit, man are they warm and comfy slippers.

Read: AOP Kata: Favour OO

Topic: Poll Results: Do you want to see Java set free (that is, open sourced)? Previous Topic   Next Topic Topic: Meta-Programming: Listening to Stu

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use