Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-03-22
7
Medium Priority
?
316 Views
Last Modified: 2012-05-11
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
Comment
Question by:star90
  • 4
  • 3
7 Comments
 
LVL 35

Accepted Solution

by:
sarabande earned 2000 total points
ID: 35197196
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
 

Author Comment

by:star90
ID: 35200301
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
 

Author Comment

by:star90
ID: 35200314
Thanks for the  info about the FastObjects (Poet)
I will read about it.
0
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
LVL 35

Expert Comment

by:sarabande
ID: 35200982
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
 

Author Comment

by:star90
ID: 35201385
1) Why t2 should not have primary key?
2) I am new to ODBMS, please explain what is "normal" and array column?
0
 
LVL 35

Expert Comment

by:sarabande
ID: 35206583
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
 

Author Comment

by:star90
ID: 35207120
Thanks for the explanation.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question