codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  C++ Design Problem  neo7890 at 19:17 on Friday, August 22, 2008
 

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.










CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Passing value through function then print... GONE WRONG!!
•  form/cgi help
•  looping problem ... a lil help please
•  Re: Help: Trouble with z-Index and SELECT lists
•  Re: google search results in a new window?
•  javascript: Cannot successfully pass data from popup to parent
•  javascript to open a pop up then close opener window
•  C++ Design Problem
•  Replay Solutions Virtual Job Fair - Sr. C++ Engineer Wanted


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2008