[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 317
  • Last Modified:

What is the best way to start with Object Database and Visual C++ 2010

Hi,
I want to start working with Visual C++ 2010 and Object databases.
Currently I want to save VC++ Containers like MAP and VECTOR.

1) I want to know which Object Database is recommended and where can I find simple examples for connecting to Visual C++ 2010.

2) Assuming I use for now MYSQL (until I learn to use the object Database),
In order to save MAP I can think of using the keys in each table as the keys values of the MAP and to use column for the Data.
How can I save a vector in a table?
Thanks.
0
star90
Asked:
star90
  • 4
  • 3
1 Solution
 
sarabandeCommented:
normally only a vector of a structure should be stored to a table where each member of structure would be a column in the table. if you have multiple vectors of single data elements - say string or int - all running the same index you also could have a table where you would store all these vector data using the index as primary key.

for Object Databases i only know FastObjects (Poet) which has a class wizard included that could generate code out of the objects of the database.

Sara
0
 
star90Author Commented:
Thanks for the answer,
Here is a more detailed example;
1) Regarding MAP objects:
Lets say I have 1000 points of time.

time(1) = 1313  
Map (of time 1313)           .
key    value              
"try1"   5
"try2"   9
"try3"   11
-------------------------------
time (2)= 1566
Map (of time 1566)           .

key    value              
"try1"  1 5
"try2"   19
"try3"  111
"try4"   15
"try5"   19
"try6"  111

--------------------------------

I can keep each Data Map in  a separate table using the keys of the Map as primaries keys of the tables.
This way Ill have 1000 tables (table1313    table 1566 etc )
 is it logic to build it this way?


2) Regarding Vectors:
Lets say I have 2 points of time
time(1)=14443
Vector(1)= 1,4,6,7,3,6,3

time(2)=14500
Vector(2)=1,4,6,3,7,3,76,3,5,23,56,2,5,3,6,32,56,2,6,23,6,2,5,2,4,2

I don´t know in advance how many components are in the vectors so it means that if I keep the Data in one table (using the time as primary keys ) I will have to add new columns to the table and to spend empty columns on vector(1)
because vector(2) is bigger (assuming I mark the end of vector 1 in column 7 with -9999 for example)

The other option is to have a separate table for each point of time.
Any recommendations?
0
 
star90Author Commented:
Thanks for the  info about the FastObjects (Poet)
I will read about it.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
sarabandeCommented:
if the only difference is the number of try values in a RDBMS you would have two tables t1, t2, where t1 has time and key as columns and t2 which has pkey_t1, try for columns. t2 has no primary key but an index on first column.

in a ODBMS you only have one object with time and key as 'normal' columns (members) and try as an array column.

Sara
0
 
star90Author Commented:
1) Why t2 should not have primary key?
2) I am new to ODBMS, please explain what is "normal" and array column?
0
 
sarabandeCommented:
t2 is only a link table which has first column a reference to primary key of t1 and second column the item which needs multiple entries. the pk of t1 will occur multiple in t2 (for each occurrence of try) and therefore cannot be primary key of t2 which must be unique key. you also cannot use the pair of both columns as pk cause even that could get duplicate key (see try2 and try5 of 2nd sample). so the only way to have a pk for t2 is to add an artificial key, for example a sequence number. but this has no advantage and slows down insertion.

in an ODBMS you can have single attributes same as in RDBMS. but ODBMS also allows to have other objects as attributes (for example you have 2 objects Customer and Address, then the Customer can have an attribute Address which itself has some attributes) and allows to have the same attribute more than once (normally called 'set' or 'array' attribute). in a relational database that is forbidden because of first normal form (1nf).

you can think of an ODBMS object as a structure in C/C++ which can have member arrays and member structures.

Sara
0
 
star90Author Commented:
Thanks for the explanation.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now