| Who's Online | There are currently, 32 guest(s) and 2 member(s) that are online.
You are Anonymous user. You can register for free by clicking here | |
| Login | | Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name. | |
 | |
|
Verification Guild: Forums |
|
| View previous topic :: View next topic |
| Author |
Message |
David-Robinson Newbie


Joined: Oct 02, 2006 Posts: 2 Location: UK
|
Posted: Mon Oct 02, 2006 5:42 am Post subject: |
|
|
Hi Gopi,
the first point to understand is that AOP sits on top of OOP - even if you do hard-core AOP coding, you are still working with classes and other OOP things. The second point is that OOP says you have to compose a class in one file (well, the class header anyway). AOP says you can compose it from any number of files. That's really the key difference between them. Of course, this lets you do a number of new and fun things, some of which are dull-but-useful, some of which are exciting-but-useful (and frowned upon by the puritans of the world) and some of which, as Adam pointed out, can be harmful.
I'd play down the significance of the latter though, because crazy people write crazy code and they'll do it no matter what language you give them. I can't think of a single language that doesn't have something "harmful" in it, and yet the world still turns and the sun still rises. Polymorphism can be "harmful". Handles can be "harmful". Inheritance can be "harmful". I've seen all of these cause big problems that were very hard to track down and fix, but would I ban the use of them? No way! Why should I give up programming power just to cater for the lowest common denominator? The Linux kernel works even though it makes extensive use of the goto statement, and Linus Torvalds put it wonderfully with:
"> However, I have always been taught, and have always believed that
> gotos are inherently evil. They are the creators of spaghetti code
No, you've been brainwashed by CS people who thought that Niklaus Wirth actually knew what he was talking about. He didn't. He doesn't have a clue." http://kerneltrap.org/node/553/2131
Perhaps the best reason to consider using AOP is the exciting-but-useful (and frowned upon by the puritans of the world) one....
Adam made a good point when he said "the designer of incrementer has CHOSEN to allow subclasses to change the implementation of changeable by using the virtual keyword".
Well that's just fantastic *if* the designer:
a) knows *everything* I could possibly want to do with his code
b) manages to code consistently with no bugs
c) actually remembers to build in the required hooks (callbacks, virtual functions, facades, whatever)
d) builds in enough hooks for me to use
If I ever encounter this, I'll let you know. In reality, you'll probably find some code that doesn't quite do what you want, and you'll find it just before a big deadline when the original author is not available to fix it for you. At this point the conceptual beauty of a pure OOP solution is probably not what you'll be caring about.
The cool thing about AOP is that it can let you fix the code without touching the original source. There are many reasons why you might not be able to change the original source - it's 3rd party code, it's part of your IP repository, it's used elsewhere and you don't want to mess up someone else's project, etc. Perhaps you don't *want* to change the original code - you are prototyping an idea or only you care about the change you are making.
It doesn't really matter *why* you want to do this. What matters is that you *can*. Rather than putting all of the power into the hands of the designer, AOP puts it back into the hands of the user [1]. It lets "you" decide when and how you use the code.
Check out http://www.verilab.com/downloads/sample_chapter_verilab_aop_cookbook.pdf for more info.
Cheers
David
[1] Well, it normally does. Despite what you'll hear from people who've never used the language, you *can* finalise a class in e (but perhaps not all AOP languages?), which means it can't be extend by anyone. However, you have to make a concious decision that you really don't want someone to change it later. In OOP, just forgetting to type "virtual" is enough.[/url] _________________ --
David Robinson
Verification Consultant
Verilab
david.robinson@verilab.com
|
|
| Back to top |
|
 |
JL Junior


Joined: Mar 01, 2004 Posts: 6 Location: Austin, TX
|
Posted: Sun Oct 08, 2006 1:30 pm Post subject: Technical vs. Marketing Arguments - AOP/OOP |
|
|
Adam,
| AdamRose wrote: |
There are a number of ways to answer your question. One is a general question about OOP vs AOP, the other is a specific question of Vera and SystemVerilog vs E.
A useful reference for discussions about the first of these questions can be found at : http://www.infosun.fmi.uni-passau.de/st/papers/EIWAS04/stoerzer04aop_harmful.pdf
While there are a few heretics in the s/w community, I think this can reasonably be said to reflect the majority opinion amogst s/w engineers.
|
If by "heretics" you mean the good folks at IBM, and teams of people around the world using AspectJ and similar languages, I suppose you're correct. Let's divide this question into two parts. First, is AOP a useful programming paradigm? Second, is the discussion surrounding AOP in the verification space technology driven, or market driven? That is to say, is the crap that those of us who enjoy having AOP in our toolbox have to take a result of pure technical issues, or based on the fact that SystemVerilog doesn't have AOP, so to acknowledge that AOP has value would be to say that SystemVerilog may have some missing features?
I strongly believe that marketing *is* the primary reason for the way this discussion has played out. If SV supported AOP, we wouldn't be having this discussion in quite the same way. But, in case it isn't, let's address some of the points about AOP that have been made so far.
| AdamRose wrote: |
There is an often ( although I would say less often nowadays ) expressed opinion that AOP is the only way to achieve the necessary flexibility required for doing verification.
<snip>
- because an understanding of how to use OO properly is not yet widespread amongst verification and hardware engineers.
<snip>
The second is becoming less true as OO verification methodologies such as Synopsy' VMM and Mentor's AVM become more widespread
|
The fact that the main contributors to this thread are folks who either work for EDA companies or are consultants, plus my experience working with several clients in e, C++, SystemC, and Vera environments over the last couple of years suggests to me that, in fact, there is still a deep misunderstanding about exactly how to use both OOP and AOP techniques in the hardware verification community.
| AdamRose wrote: |
While E does have a lot of flexibility built in to it, it is the flexibility of the Wild West. You can do anything you like, but you might well get shot by a random stray bullet, and you may have unwittingly fired that bullet yourself.
|
Instead of going through this from a hardware verification perspective for now, I'd like to point everyone to an excellent article written by Ramnivas Laddad, and posted on the IBM developerWorks site:
AOP@Work: AOP myths and realities
http://www-128.ibm.com/developerworks/java/library/j-aopwork15/
In the article, Ramnivas discusses in great detail several myths about development in AOP, some of which directly address points made in this discussion thread:
Myth 1: AOP is good only for tracing and logging
Myth 2: AOP doesn't solve any new problems
Myth 3: Well-designed interfaces obviate AOP
Myth 4: Design patterns obviate AOP
Myth 5: Dynamic proxies obviate AOP
Myth 6: Application frameworks obviate AOP
Myth 7: Annotations obviate AOP
Myth 8: Aspects obscure program flow
Myth 9: Debugging with aspects is hard
Myth 10: Aspects can break as classes evolve
Myth 11: Aspects can't be unit tested
Myth 12: AOP implementations don't require a new language
Myth 13: AOP is just too complex
Myth 14: AOP promotes sloppy design
Myth 15: AOP adoption is all or nothing
I'd also like to point out another article by Nicholas Lesiecki, a software engineer at Google:
AOP@Work: Enhance design patterns with AspectJ, Part 1
AOP makes patterns lighter, more flexible, and easier to (re)use
http://www-128.ibm.com/developerworks/java/library/j-aopwork5/index.html
It took years for the software development community to understand how to use OOP effectively. It will probably take years more for AOP techniques to fully take hold. That doesn't mean the feature doesn't add value - in my experience, it adds tremendous value. It also doesn't mean that OOP techniques are obsolete. If the tools, languages, and libraries most commonly used for hardware verification development weren't under the control of the Big Three EDA companies, we might actually be able to get past this perpetually silly AOP vs. OOP argument and focus on figuring out how to apply the right solutions where appropriate in order to be successful at our primary goal - taping out reliable products as quickly as possible. _________________ JL Gray
Verification Consultant
http://www.verilab.com
http://www.coolverification.com (blog) |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
| |
|
|