| | |
c++ design problem
![]() |
•
•
Join Date: Jul 2008
Posts: 19
Reputation:
Solved Threads: 0
i have two classes. One is room and the other is container.Room is the class which you write, container is a 3rd party class, you can't change
the class definition of container.
in the constructor of container, large amount of memory is allocated.
In the ctor of room, a small amount of memory is allocated.
Would you go in for an inheritance relationship or a composition between 'room' and 'container' ?
A few conditions:
1. Container has functions like open and close which even room can use and MUST re-use
2. Containers ctor should not be called as it allocates huge amounts of memory.
the class definition of container.
in the constructor of container, large amount of memory is allocated.
In the ctor of room, a small amount of memory is allocated.
Would you go in for an inheritance relationship or a composition between 'room' and 'container' ?
A few conditions:
1. Container has functions like open and close which even room can use and MUST re-use
2. Containers ctor should not be called as it allocates huge amounts of memory.
![]() |
Similar Threads
- problem with DW CSS Horizontal Spry (HTML and CSS)
- Common problem solver framework design (C++)
- Design Solution (Database Design)
- Site design problem (HTML and CSS)
- software design problem (IT Professionals' Lounge)
- Problem in resizing of resolution of windows for a web page (HTML and CSS)
Other Threads in the C++ Forum
- Previous Thread: object as parameter vs object method
- Next Thread: Visual C++ 2008 - Random location picturebox?!?
| Thread Tools | Search this Thread |
ace_thread api array based binary bitmap borland c++ c/c++ calling char class classes code coding compile console conversion count delete delete-line deploy desktop developer directshow dll download dynamic dynamiccharacterarray email embedded encryption error file forms fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream information input int integer java lib linkedlist linker loop looping loops map math mathhomeworkhelp matrix memory multiple news node number numbertoword output parameter pointer problem program programming project python random read recursion reference reverse richedit rpg string strings temperature template test text text-file tree url variable vector video win32 windows winsock word wordfrequency wxwidgets





