Solved

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

Posted on 2011-03-22
7
313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 34

Accepted Solution

by:
sarabande earned 500 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 34

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 34

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
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…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

631 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