Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
User Journal

Journal slothman32's Journal: c++ designing 2

Are there any good sites online about how to design and structure a C++ program?
Such as where to put objects and when/how to encapsulate.

For a similar question: if I use a Vector class and make the template point to a class of type 'item', would another class be called 'itemset" be useful?
The 'item' class would have things like owner and bitmap while the 'itemset' class would have a Vector of those 'item's as well functions like "Reorder()" and "Print()".
Or is there a better way of doing things like that?

P.S. This is copied from a post of mine on another forum, the one in my sig.

This discussion has been archived. No new comments can be posted.

c++ designing

Comments Filter:
  • Is to think of everything as data, and therefore, how is it stored in a good third normal form database?

    At which point, the rest of your questions become easy- interfaces are for standard table types, inherited collection classes for data sets, child classes for rows in the data set.

    I'm not sure why you wouldn't use the system classes for vector graphics though. For one thing, there are some nice standardized libraries like OpenGL that you can use, that haven't really changed much in the last 15 years.

  • Maybe that would be OK, but beware of making classes just for the hell of it.

    C++ is not an object oriented language. It's an object-capable language. It supports multiple paradigms, including OOP. Don't feel like you have to stick everything into an object, or build a hierarchy out of everything.

    Personally, I'd probably forget about making an itemset. I'd declare a typedef for an itemvector which is a set or a vetor of items.

    Look at this:
    http://www.sgi.com/tech/stl/for_each.html [sgi.com]

    I'd use that to print my vect

A morsel of genuine history is a thing so rare as to be always valuable. -- Thomas Jefferson

Working...