This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I haven't got very far with my project yet, but I can't at the moment see any reason for subclassing data. The additions required do not replace or change any existing methods. I would be interested to hear from anyone who could argue in favour of subclassing. Catherine
I favor to modify rather than subclass. However, the advantage of subclassing is: 1) small code, so easy to read. 2) better performance in case of object lock (parent and subclass both have synchronized methods) Please make more comments on the topic or correct mine. Ruilin
Modify when there is a problem with the class--bad method signature, import statement wrong, ... Extend to create a derived class that "is-a" base class (to use the oo terminology), but has variations in the method behavior. For example, I created a DataClientLocal class that extends the DataClient class. It has the same methods, but instead of accessing the database remotely, it uses local access. ------------------ --glenn