Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
> Hi > I am getting better at OOP design but far from an expert! > If you give me more info about the functions you wish to implement I could try to help further... > regards > richard
Thanks for your suggestion. This works only for classes which are co-related. There are situations when both the classes would not be logically related, but depend on each other. I will tell a specific case in my project so that it would be much clearer. Consider two classes 1) BOException Is a specific Exception class derived from 'Throwable' (i.e. BOException extends Throwable). This is a custom exception class which contains some of the transaction information (like connection name, username, userid etc.). 2) BOTransaction Is a transaction class containing transaction details As per case 1), since BOException contains transaction information it depends on BOTransaction. Now we have a situation where we have two dependend class which are not logically related. I am not sure whether we could apply a super class to solve the above. Observed - The same situation may get solved in C++ by using forward declaration within each class. We cannot achieve the same in Java since we dont have the concept of diffrentiating header file (*.h) and source file (*.cpp). Thanks & Regards Replies:
|
Sponsored Links
|