Tagged Questions
0
votes
2answers
129 views
How to design member access for an Article-type class? [duplicate]
I am doing a final project in a C++ class writing a very simple usenet-like client/server. I figure that since it's usenet-like I'll have a NewsGroup class and an Article class, I'm now working on my ...
4
votes
3answers
390 views
C++ vs Objective-C design principles of setters and getters
In C++ I was told that my classes shouldn't have getters and setters: Doing it wrong... blog post.
On the other hand, in Objective-C, the direct use of ivar is discouraged, because the getters allow ...
2
votes
4answers
380 views
Good design pattern for a c++ wrapper around a c object
I have written an extensible c++ wrapper around a very hard to use but also very useful c library. The goal is to have the convience of c++ for allocating the object, exposing its properties, ...
4
votes
6answers
2k views
Design: Calling back to the parent class
When modelling an object with children it's common to include the children via composition, as a member of the parent class. Sometimes however the children need to tell the parent something, they need ...
0
votes
1answer
151 views
Designing classes containing the same objects but different amount of them
I am creating a main object, MACHINE, which will contain a diversity of several other objects -- AXIS, AMPLIFIER, ENDEFFECTOR, etc. The number of contained objects will vary depending on the MACHINE ...