To that end, can someone point to me an example of object-oriented code that they feel is elegant?
To that end, can someone point to me an example of object-oriented code that they feel is elegant?
I wrote an abstract base class that contains all of the boiler plate code for dealing with SharePoint, and then one subclass for each type of message I need to deal with; those subclasses only need to override a few methods to deal with the fields from the XML message and with the specific SharePoint list they need to write to.
It is not great (the task is just too dull for that), but I am happy with the approach I have chosen because I can add support for new message types fairly easily.
That being said, I do not think OOP is the answer to all (programming) questions, nor is it the worst idea ever. Some programs can be expressed in terms of objects and inheritance very easily, just as some can be expressed in functional terms very easily.