On May 2, 2006, at 1:32 PM, Mike Woodworth wrote:
My lack of experience in other languages is showing, but whats the advantage of an abstract method? how is that different than an empty method in the superclass? I assume there's some nicety with compiler errors, but that would seen to negate the comment about unimplemented interface methods below.
An abstract method forces the subclass to supply an implementation (much the same way a method declaration in an interface does) where as an empty method simply supplies a noop default implementation (which in some cases may be desirable) but does not guarantee an implementation.
So, you would use an interface if you wanted to define behavior between two otherwise unrelated objects. and an abstract class would be used for defining behavior of more closely related objects that have some common implementation details.
The answer to the question that originally started this thread is basically: You would need an abstract class to do what you want (add implementation details without providing a complete implementation), but unfortunately, RB doesn't support the concept of an abstract class, so if this functionality is important to you, then you should file a feature request for abstract classes, otherwise just define setter/getter pairs in your interface for the properties you wish to force implementation of.
-jason _______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
