Coding classes with 1 to N relationships

R

ree

Most books don't go into how to code one to many relationships. They just
seem to basically cover one to one. Can some one point me out how to guide
me to a link on the net where I can get more information.

By they way I found a book that covered a bit on it but i am confused with
...UnboundedSetByValue in the following examples shown in the book.

LISTING 2.9. THE ApartmentBuilding CLASS DECLARATION
// Tenant
#include “Tenant.h”
class ApartmentBuilding
{
public:
ApartmentBuilding();
~ApartmentBuilding();
.. . .
//## Association: Unnamed
//## Role: ApartmentBuilding::Houses
const UnboundedSetByValue<Tenant> get_Houses() const;
void set_Houses(const UnboundedSetByValue<Tenant> value);
private:
UnboundedSetByValue<Tenant> Houses;
};


LISTING 2.8. THE Tenant CLASS DECLARATION
// ApartmentBuilding
#include “AprtmntB.h”
class Tenant
{
public:
Tenant ();
~Tenant ();
.. . .
//## Association: Unnamed
//## Role: Tenant::Lives at
const ApartmentBuilding get_Lives_at() const;
void set_Lives_at(const ApartmentBuilding value);
private:
ApartmentBuilding Lives_at;
};
-----------
 
V

Victor Bazarov

ree said:
Most books don't go into how to code one to many relationships. They just
seem to basically cover one to one. Can some one point me out how to guide
me to a link on the net where I can get more information.

By they way I found a book that covered a bit on it but i am confused with
..UnboundedSetByValue in the following examples shown in the book.
[...]

"UnboundedSetByValue" is not a standard template. Perhaps you could
try using std::set or std::vector instead. In that case you should
get a copy of Nicolai Josuttis' book on the Standard Library or any
other good C++ book, they usually cover at least std::vector use.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top