944,192 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 3798
  • C++ RSS
May 8th, 2007
0

C++ and data access

Expand Post »
hi, I have been trying to get into C++ for a while now. My background is in VB.net. I do have experience programming with C++ (and some C) through my classes, but nothing complex... the biggest thing that I seem to be having trouble comprehending is how data access is handled.

the main aspect is developing applications that are data-driven. see .net makes it easy to connect to different data sources like databases, access files, and xml files. but whenever I look in C++ books they always talk about using the STL like lists, stacks, and other structures. But is that really the way you're supposed to do it? Am I supposed to load an ENTIRE data set into memory then pull out the data that I need from there? I've seen some mention of working with records, but that seems clunky and inefficient...

so I guess what I'm asking is, what are some of the different ways that serious application developers store and access data when they are working in C++? and by serious, I don't necessarily mean like Microsoft Windows devs... rather I mean just not the simple little rinky dinky programs that are in textbooks. like maybe just someone who wants to say write a program to keep logs of notes or structured collections like bills or something like that, or maybe as complex as an email system, but without having to rely on a rdbms...

thanks in advance for your insight
-SelArom
Similar Threads
Reputation Points: 20
Solved Threads: 1
Junior Poster in Training
SelArom is offline Offline
54 posts
since Oct 2004
May 8th, 2007
0

Re: C++ and data access

It depends on the data, but simplest answer would be an SQL database.
Most/all DBs provide C/C++ APIs for access.

You guessed correctly abt STL, its a set of template classes created to make life easier for a programmer, and NOT for the purpose to providing a way storing/accessing huge amount of data persistently.
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
May 8th, 2007
0

Re: C++ and data access

thank you for your reply. that is what I figured... but if the solution is to use a database system of some sort, what advantage is there to using c++ over say one of the new .net languages? since the bottleneck is the database and not memory, why would I develop the application in c++? (this isn't intended to be sarcastic, I really want to learn more about why people still use c++ to develop applications)

thanks
-SelArom
Reputation Points: 20
Solved Threads: 1
Junior Poster in Training
SelArom is offline Offline
54 posts
since Oct 2004
May 8th, 2007
0

Re: C++ and data access

>see .net makes it easy to connect to different data sources like
>databases, access files, and xml files.
This is true.

>but whenever I look in C++ books they always talk about using the STL
>like lists, stacks, and other structures.
That's because those books teach standard C++ and can't reasonably cover such things as database access and XML processing.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
May 8th, 2007
0

Re: C++ and data access

Click to Expand / Collapse  Quote originally posted by SelArom ...
why would I develop the application in c++?
For the love of it..

First, when you're developing something using .NET or MFC or J2XX or some such framework, the design of their application is [to some extent] limited. If the designer is not too experienced I would say it's limited to a large extent. In C++ on the other hand you have a free hand at that.
Secondly from my own experience I'll say this: Framework (MFC, J2XX...) based applications are bound to be slower than the ones written without them (C/C++, Core Java) as the a developer of framework has to consider a larger group of clients than the developer of a single application. Thus the developer of a single application will surely design something that's more fitting to his/her requirements.
Third reason is there are no frameworks for business logic part of applications, say if you're developing an application that connects a stock broker to a stock exchange and provides for all trading facilities, you'll have frameworks (e.g. .NET) that can make life easier to create a GUI and access to DB, but it can't provide you any help in implementing the rules/regulations of stock trading, so this has to be done in C++/Java/...
A word on STL, it's meant only for aiding in implementing your business logic. Take teh previous example, once you've read teh data from DB you need to make some decisions based on that by correlating them and applying some rules, to hold this data in memory and manipulate it you'll use STL.
Finally IMHO .NET is meant for interoperability of different languages/technologies. And that's what it should be used for.
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
May 8th, 2007
0

Re: C++ and data access

> Third reason is there are no frameworks for business logic part of applications

There is always J2EE. Business methods of the Entity bean having CMT (container managed transactions) are implemented by the container.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
May 8th, 2007
0

Re: C++ and data access

Click to Expand / Collapse  Quote originally posted by ~s.o.s~ ...
> Third reason is there are no frameworks for business logic part of applications

There is always J2EE. Business methods of the Entity bean having CMT (container managed transactions) are implemented by the container.
Thought someone might say that.. .. Even in telecom domain we have frameworks (aka platforms) that provide basic services needed by telco applications, but same issue there as well.. I would still say that a guy designing on his own will do a better job (surely not as easily)..
Last edited by thekashyap; May 8th, 2007 at 3:40 pm. Reason: serviced => services
Reputation Points: 254
Solved Threads: 74
Practically a Posting Shark
thekashyap is offline Offline
804 posts
since Feb 2007
May 8th, 2007
0

Re: C++ and data access

Say that in a Java forum and you would get gobbled up by the supreme freaks who believe that the more things the container does, the better. In case you haven't worked with J2EE, in almost every scenario, CMT does a great job. The only times 'own designing' i.e. BMT is required is when fine grained control is required over transcations, a thing rarely needed is normal J2EE applications.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Ideas beyond my skill level
Next Thread in C++ Forum Timeline: Help needed :(





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC