Originally posted by Steve Dalton:
Some of our most heavily used classes are often inherited multiply as what you might call 'mix-ins'. I know that in Java you can use interfaces to achieve similar results to Multiple Inheritence (although without implementation in the interface of course) and that you could also use other alternatives such as aggregation and delegation. But in certain circumstances I just can't see anything nearly as intuitive as multiple inheritence.
A lot of the objects in our system provide statistics to a central controller that sits on the network monitoring the server farm. There is a central Singleton StatisticsManager object along with other objects that are used for transport of data etc. Objects provide statistics by inheriting from the StatableObject interface which contains a small amount of functions - the main one being SetStatistic. Objects call this SetStatistics method when they want to update a particular statistic. How would you implement a similar system in Java, I couldn't think of anything nearly as intuitive.
Originally posted by Andrew Shafer:
Parmeet, I understand how an interface works in practice, but in theory I'm a bit confused about the difference between extending an abstract class or implementing an interface.
It just seems like a way to get multiple inheritance.
Originally posted by Mohamed Yousuff:
Also always try to use column names rather than the column number. This is because when you install the application to the actual machine and create the tables, you are restricting yourself to create the fields in the same order. Also in future if you remove a field in the middle then the field order will change again. In this case, you have to change your code again.