Association vs Dependency (Offbeat) 2003-12-28 - By ShriKant Vashishtha
Back Hi All,
I am slightly confused in finding the difference between association and dependency.
For me, whenever the variable is intialized at a local scope or passed as a parameter in a method, its denoted as dependency. However, for association, I believe, the object needs to be on global scope (as an instance variable). However, I rarely use any object at a global scope, unless I know that it is used for maintaining the state of class or need to be used across different methods. So most of the time, I end up with dependency .
Am I missing something over here.
Thanks -ShriKant
-- ---- ---- ---- ---- ---- ----- Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected) <DIV>Hi All,</DIV> <DIV> </DIV> <DIV>I am slightly confused in finding the difference between association and dependency.</DIV> <DIV> </DIV> <DIV>For me, whenever the variable is intialized at a local scope or passed as a parameter in a method, its denoted as dependency. However, for association, I believe, the object needs to be on global scope (as an instance variable). However, I rarely use any object at a global scope, unless I know that it is used for maintaining the state of class or need to be used across different methods. So most of the time, I end up with dependency .</DIV> <DIV> </DIV> <DIV>Am I missing something over here.</DIV> <DIV> </DIV> <DIV>Thanks</DIV> <DIV>-ShriKant</DIV><p><hr SIZE=1> Do you Yahoo!?<br> <a href="http://antispam.yahoo.com/whatsnewfree">Protect your identity with Yahoo! Mail AddressGuard</a> ==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|