Tagged Questions
12
votes
4answers
548 views
Is there a different usage rationale for abstract classes/interfaces in C++ and Java
According to Herb Sutter one should prefer abstract interfaces (all pure virtual functions) to abstract classes in C++ to decouple the implementation as far as possible. While I personally find this ...
0
votes
1answer
96 views
The design of a generic data synchronizer, or, an [object] that does [actions] with the aid of [helpers]
I'd like to create a generic data-source "synchronizer," where data-source "types" may include MySQL databases, Google Spreadsheets documents, CSV files, among others. I've been trying to figure out ...
5
votes
3answers
467 views
Checking preconditions or not
I've been wanting to find a solid answer to the question of whether or not to have runtime checks to validate input for the purposes of ensuring a client has stuck to their end of the agreement in ...
7
votes
5answers
872 views
Interface and Inheritance: Best of both worlds?
I 'discovered' interfaces and I started to love them. The beauty of an interface is that it is a contract, and any object that fulfills that contract can be used wherever that interface is required.
...
9
votes
4answers
2k views
The term “interface” in C++
Java makes a clear distinction between class and interface. (I believe C# does also, but I have no experience with it). When writing C++ however there is no language enforced distinction between class ...
2
votes
2answers
174 views
How is this “interface”-like structure/pattern called?
Let's assume we have an XmlDoc class that contains basic functionality for dealing with an XML data structure and saving/loading data to/from a file. Now we have several subclasses, A, B and C. They ...