| | |
c++ design problem
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
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 |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion count database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive return sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock word wordfrequency wxwidgets





