Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Statement.getResultSet() to return a reference instead of a pointer?: msg#00022

db.carob.general

Subject: Re: Statement.getResultSet() to return a reference instead of a pointer?

Marc Herbert <Marc.Herbert-NAAfj4rwCWC8rjiVs5Nzzw@xxxxxxxxxxxxxxxx> writes:

>> Just one question ... what will happen with getResultSet() when
>> lastResultPtr is null?
>
> Good question :-)
>
> Could we use a different semantic to flag the end of the list? This
> one is very Java/JDBC oriented, not C++. I find it's a pity to use
> pointers to mimic null java references.
>
> On the other hand iterators - a more C++ oriented solution - are
> probably closer to the current code.

A couple more words to clarify my opinion ("La nuit porte conseil" -
nighttime brings advice).

The issue with pointers is that you always have to ask who owns the
pointed-to object. Consequences are double deletions bugs and memory
leaks. As opposed to C, C++ allows to write code with very few
pointers, and even better to encapsulate their use inside objects
(which is not the case here).

Iterators look like pointers for legacy reasons, but they don't need
to be pointers, and moreover no programmer ever asks himself if he has
to delete iterators (!).


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo