Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
1 answer
174 views

How do you add feature to a class that was originally designed wrong in the first place? [duplicate]

I have a Surgeon class that is constantly changing class Surgeon { string name, discipline; public: Surgeon(string _name, string _discp) : name{_name}, discipline{_discp}{} void writeDir(...
user3904534's user avatar
1 vote
2 answers
138 views

API desing for storing data of multiple stage in object

struct co_ordinate { double x; double y; }; // -----> DESIGN 1 class Land { public: Land(std::vector<co_ordinate> co) shape_before_plotting(co) {} ...
Aadarsh Sharma's user avatar
3 votes
1 answer
245 views

Design a class that holds parsing information

Let say I own a resturant that makes a pie. I want to cut this pie according to the input parsed from the file. That hold the key to the information on how the Pie is to be cut. I use ...
vanta mula's user avatar
7 votes
5 answers
2k views

Is it a good idea to experiment with design patterns?

I have been reading a lot about different design patterns, their pros, cons, main usage etc. However, I like to experiment and try to invent my own ways of the implementations (even if they are not ...
Pins's user avatar
  • 201
0 votes
3 answers
339 views

How to represent personality of a person in class?

Lets say I have a class Person. class Person{ Person(std::string, int); void walk(); void talk(); void eat(); private: int age; std::string() name; }; Now lets say I want ...
solti's user avatar
  • 369