The Artima Developer Community
Sponsored Link

Java Buzz Forum
AOP Amok

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
Thomas Gideon

Posts: 70
Nickname: cmdln
Registered: Aug, 2003

Thomas Gideon is a hacker curmudgeon.
AOP Amok Posted: Aug 8, 2003 10:28 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Thomas Gideon.
Original Post: AOP Amok
Feed Title: Command Line Interface
Feed URL: http://www.gideonfamily.org/roller/rss/cmdln?catname=Java
Feed Description: The blog of a programmer-hacktivist-curmudgeon who occasional rants about society, work, and technology, among other things. Now how do I get to a command prompt on this thing?
Latest Java Buzz Posts
Latest Java Buzz Posts by Thomas Gideon
Latest Posts From Command Line Interface

Advertisement

Is it just me or does this example seem incredibly forced? To start with, although I know this isn't the code about which the questions are being asked, why does the Content object require these "atoms" for it's properties? Mebbe I'm missing something, but when I see getName() (and hasName really is just getName in disguise), it immediately implies there is a private access name variable encapsulated in the class and the only relevant pattern at play here is retrieval of it's value. Mebbe this is bad naming, but the hasText and hasHtmlText seem to be to be even worse. What's wrong with polymorphism, here? How are you supposed to test this outside of the live container? How do you do static analysis on this code? What prevents some empty class from having so many introductions and advices that it's unmanageable?

As for the question itself, while I am not so sure about using ThreadLocal variables as Jon Lipsky suggests, I agree with his approach of abstracting away via a SecurityContext and hiding some system-level interaction with the container. Why re-invent the wheel? Carlos admits he's using WebWork, isn't he using a container that offers some security management service already? If not, why not? If there's a valid reason, what's the harm in making securable objects implement a Securable interface that AOP advice implementations can use to get the authentication token, via some of the suggestions in the article's comments, and meeting the AOP injection halfway?

Is this just using AOP to being using AOP? How does this make the code simpler and easier to understand? That is why we are all using the tools and techniques we use, right? To help tame the complexity inherent in software development? Don't mistake me, although I have yet to use it, I have sufficiently read up on AOP to understand what it is and does. I could be wrong, but Carlos' circumstances don't seem to indicate that AOP is the way to go, here; at least not for everything he seems to be using it for.

Read: AOP Amok

Topic: Red vs Blue: The Blood Gulch Chronicles [2003] Previous Topic   Next Topic Topic: [ANNOUNCE] Tomcat 4.1.27 Stable Released

Sponsored Links



Google
  Web Artima.com   

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